• Resolved mak1wp

    (@mak1wp)


    Hello,

    I’m using SMOF (slightly modified options framework) to display a (flexslider) slider, but haven’t a clue how to specify a cropped image size. ie. thumbnail.

    Huge thanks in advance if anybody can help me with this.

    The PHP used to display the slider is:

    <?php
         $slides = $data['pingu_slider']; //get the slides array
    		foreach ($slides as $slide) {
    		echo
    	'<li>
    	<a href="'. $slide['link']. ' ">
    	<img src="' . $slide['url' ] . '" />
    	</a>
    
    		<div class="flex-title">'.  $slide['title']. ' </div>
    		<div class="flex-caption">'. $slide['description']. ' </div> 
    
    		</li>';
    }
    ?>

    I’m looking to somehow specify a custom crop size with the $slide[‘url’ ]

    I’m also using ACF (advanced custom fields) – again with flexslider – to display gallery post type slides. I have exactly the same issue here, where the URL is being pulled in, with no clue how to specify the ‘thumnail’ URL for example.

    The code used for the ACF gallery is:

    <?php
    	$images = get_field('post_gallery');
    	if( $images ): ?>
    
        <div id="slider" class="gallery-slider">
        	<ul class="slides">
                <?php foreach( $images as $image ): ?>
                    <li>
                        <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
                        <div class="slide-caption"><?php echo $image['caption']; ?></div>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    <?php endif; 
    
    ?>

    A massive thanks to anyone who can shine some light on this for me.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Specify image size with $image['url'] (SMOF and ACF)’ is closed to new replies.