Metaslider not working with loop that calls only the latest post in a category
-
Hello,
I had this setup and working correctly, and then one day out of the blue (I don’t know if wordpress, metaslider, or another plugin updated???) it stopped working.
So on my frontpage I was using this loop to call only the very most recent post in a specific category, and inside of that post was the shortdcode for the metaslider. We did it this way so we could schedule a new frontpage slider each week.
<?php if(have_posts()) : ?><?php $args = array( 'cat' => 167, 'posts_per_page' => 1, ); query_posts( $args ); while(have_posts()) : the_post(); ?> <div class="post"> <div class="featured-image"> <?php the_post_thumbnail( 'medium' ); ?> </div> <!--<h2 class="content-title"><?php the_title(); ?></h2>--> <div class="contententry"> <?php the_content(); ?> <p class="metadata"> <?php edit_post_link('Edit'); ?> </p> </div> </div> <?php endwhile; ?>
After whatever changed, the metaslider no logner displayed, and we could see code on the font page…
var metaslider_135 = function($) { $('#metaslider_135').addClass('flexslider'); // theme/plugin conflict avoidance $('#metaslider_135').flexslider({ slideshowSpeed:6000, animation:"fade", controlNav:false, directionNav:true, pauseOnHover:true, direction:"horizontal", reverse:false, animationSpeed:600, prevText:"<", nextText:">", slideshow:true }); }; var timer_metaslider_135 = function() { var slider = !window.jQuery ? window.setTimeout(timer_metaslider_135, 100) : !jQuery.isReady ? window.setTimeout(timer_metaslider_135
However Metaslider is still working everywhere else on the site, making me think that for some reason it hates my loop all of the sudden? Do you have any advice or other wisdom for me?
Thanks,
- The topic ‘Metaslider not working with loop that calls only the latest post in a category’ is closed to new replies.