WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Meteor Slides] slideshow will not render on page of posts (4 posts)

  1. robotor
    Member
    Posted 2 years ago #

    Hello,
    This is sort of an advanced question for the plugin developer.

    First off, I love your plugin. It's the best I have used :)

    The way I use it will pull a slideshow with the same slug name as the page in question, unless the page has a "thumbnail", which will override the slideshow. Here's my code:

    <div id="feature">
    	<?php
    		if ( has_post_thumbnail() ) {
    			// the current post has a thumbnail
    			the_post_thumbnail();
    		} else {
    			// the current post lacks a thumbnail
    			if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow($post->post_name, "random: 1" ); }
    		}
    	?>
    </div>

    Now where it stops working is on the "page of posts" itself. My "page of posts" is the "news" page, and has the slug "news." For some reason, Meteor Slides will not render the slides when matched up with this "page of posts." It only renders the container div.

    Ideas?

  2. Josh Leuze
    Member
    Posted 2 years ago #

    Thanks, I'm glad you like it!

    I tested this out and the main blog page is outputting the slug of the first blog post on that page.

    I'd suggest adding a conditional for the blog page:

    <div id="feature">
    	<?php
    		if ( has_post_thumbnail() ) {
    			// the current post has a thumbnail
    			the_post_thumbnail();
    		} elseif ( is_home() ) {
    			// the blog homepage
    			if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow("news", "random: 1" ); }
    		} else {
    			// the current post lacks a thumbnail
    			if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow($post->post_name, "random: 1" ); }
    		}
    	?>
    </div>
  3. robotor
    Member
    Posted 2 years ago #

    Hey - that did it - it's a great idea. And, your update found the "page of posts" and not the actual "home" page - which perfect. Thank you!

  4. Josh Leuze
    Member
    Posted 2 years ago #

    No problem, it's kind of strange that the blog homepage is called "home" regardless of whether it is the actual site homepage or not!

Topic Closed

This topic has been closed to new replies.

About this Topic