Support

Account

Home Forums Add-ons Gallery Field Slideshow ACF

Unread

Slideshow ACF

  • Hey everyone. I’m new to ACF and wordpress coding and I’m trying to create a slideshow. But after some reading and trying different ways, I’m stuck.
    Hopefully someone wants to help me on the right track?

    This is my index page.

    <?php get_header();?>
    
    <?php $images = get_field('project-images'); ?>
      <?php if( $images ): ?>
    
       <div class="slideshow">
    
          <?php foreach( $images as $image ): ?>
    
             <img src="<?php echo $image['url']; ?>" />
    
          <?php endforeach; ?>
    
       </div>
    
    <?php endif; ?>
    
    <script type="text/javascript">
    (function($) {
    $('.slideshow').slick();
    })(jQuery);
    </script>
    
    <?php get_footer(); ?>
    

    And this is my header page:

    <!doctype html>
    <html <?php language_attributes(); ?>>
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
    	<link rel="profile" href="https://gmpg.org/xfn/11">
    
    	<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.5.9/slick.css"/>
    	<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.5.9/slick.min.js"></script>
    
    	<?php wp_head(); ?>
    </head>
    
Viewing 1 post (of 1 total)

The topic ‘Slideshow ACF’ is closed to new replies.