Support » Plugins » Specify image size with $image['url'] (SMOF and ACF)

  • Resolved mak1wp



    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:

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

    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:

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

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


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.