• Hi,

    I’m trying to set up an image slider with Slick (http://kenwheeler.github.io/slick/) and Simple Fields but I’m lost.

    I had it working with WCK Custom Fields and Custom Post Types Creator pluging, using the following

    <div class="slick-slider clearfix">
    <?php foreach( get_cfc_meta( 'slick_slides' ) as $key => $value ){ ?>
    <div class="slide"><img src="<?php the_cfc_field( 'slick_slides','image', false, $key ); ?>"/></div>
        <?php } ?>
    </div>

    I’ve now installed Simple Fields and set up a field group with teh slug slick-slides and a repeater field of type file with the slug images, and ticked the option for ‘Enable Extended Return Values’ but I have no idea how to call the values from Simple Fields to the code above.

    I’ve also failed to get the meta box working correctly on Pages and Posts.

    I set up a Post Connector titled, Slideshow images connector and linked the field group to Posts and pages. The meta box shows up but when I choose ‘Slideshow images connector’ from the dropdown menu, I only get a link Show custom field keys, and when I click that nothing happens, even though I have saved the page/post first after choosing the connector.

    Has anyone got Simple Fields to work with Slick, and if so, could you possibly post your solution? 🙂

    Thanks in advance for any pointers.

    Cheers,
    Tracy

Viewing 1 replies (of 1 total)
  • Thread Starter Freelancealot

    (@freelancealot)

    So, I’ve managed to get the Slick slider working with Simple Fields with the following code:

    <div class="slick-slider clearfix">
    <?php $aboutslideshow = simple_fields_get_post_group_values(get_the_id(),"Slides", true, 2);
            if ( isset($aboutslideshow) && count($aboutslideshow) > 0 ) {
    	foreach ( $aboutslideshow as $slide ) {
    	$slideimg = wp_get_attachment_image($slide['Image'], 'full');
    			?>
                <div class="slide">
                <?php echo $slideimg ;?>
               </div>
    	<?php }}?>
    </div>

    But I can’t for the life of me figure out how to get the image description or caption for the image. I’ve tried many variations, this is the last one:

    <div class="slick-slider clearfix">
    <?php $aboutslideshow = simple_fields_get_post_group_values(get_the_id(),"Slides", true, 2);
    
    	if ( isset($aboutslideshow) && count($aboutslideshow) > 0 ) {
    	foreach ( $aboutslideshow as $slide ) {
    	$slideimg = wp_get_attachment_image($slide['Image'], 'full');
    	$caption = get_the_excerpt();
    ?>
                <div class="slide">
                <?php echo $slideimg ;?>
      <p><?php echo $caption; ?>  </p>
               </div>
    	<?php }}?>
        </div>

    But this just gets the excerpt for the page, which is not what I want.

    Can someone please, please, please help. I’ve spent over two hours now trying to figure it out and I’m sure there’s an easy way of doing it that I’m not seeing.

    Thanks for your help in advance.

    Cheers,
    Tracy

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Simple Fields] Image Slider using Slick’ is closed to new replies.