How to use multiple featured images in my home slider
-
The theme I’m working with currently uses the featured image of a post category as the slider images. I’d like to set multiple images in the slider without needing to make multiple posts. I tried to use the plug-in (which works great btw) but I don’t know how to adapt the code to pull in all of those images.
I wish I could be more specific, but as I’m not that experience with PHP, I’m not sure what to edit to pull in the images from the plug in. Here is the code from the loop-slider.php file
<!-- BEGIN .flexslider --> <div class="flexslider loading" data-speed="<?php echo of_get_option('transition_interval'); ?>"> <!-- BEGIN .slides --> <ul class="slides"> <?php $slider = new WP_Query(array('cat'=>of_get_option('category_slideshow_home'),'posts_per_page'=>of_get_option('postnumber_slideshow_home'))); ?> <?php if($slider->have_posts()) : while($slider->have_posts()) : $slider->the_post(); ?> <?php if (isset($_POST['featurevid'])){ $custom = get_post_custom($post->ID); $featurevid = $custom['featurevid'][0]; } ?> <li> <?php if ( get_post_meta($post->ID, 'featurevid', true) ) { ?> <div class="feature-vid"><?php echo get_post_meta($post->ID, 'featurevid', true); ?></div> <?php } else { ?> <?php if ( '' != get_the_post_thumbnail()) { ?> <div class="feature-img"> <a href="<?php the_permalink(); ?>" href="<?php the_permalink() ?>" rel="bookmark" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'organicthemes' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail( 'featured-img' ); ?></a> </div> <?php } else { ?> <a class="feature-img" href="<?php the_permalink() ?>" rel="bookmark" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'organicthemes' ), the_title_attribute( 'echo=0' ) ) ); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/default-slide.png" alt="<?php the_title(); ?>" /></a> <?php } ?> <?php } ?> </li> <?php endwhile; ?> <?php endif; ?> <?php wp_reset_postdata(); ?> <!-- END .slides --> </ul> <!-- END .flexslider --> </div>
https://www.ads-software.com/plugins/dynamic-featured-image/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to use multiple featured images in my home slider’ is closed to new replies.