[resolved] Specify image size with $image['url'] (SMOF and ACF) (3 posts)

  1. mak1wp
    Posted 3 years ago #


    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.


  2. mak1wp
    Posted 3 years ago #

    I'm a numpty. Looks like this isn't a possibility.


    ACF - instead of using:

    I've used

    SMOF - I'm not too sure how to create arrays and such. So instead of using the options framework to add a slide, I've done it via a custom post type - with help from this link http://wp.tutsplus.com/tutorials/create-a-responsive-slider-plugin-with-flexslider/

  3. diego.webdg
    Posted 2 years ago #

    THANK YOU so much!!!

Topic Closed

This topic has been closed to new replies.

About this Topic