Ready to get started?Download WordPress


Meteor Slides
Questions: how to remove navigation for a single slide, how to recursive (6 posts)

  1. robotor
    Posted 2 years ago #

    I have two tricky questions:

    1) How can I automatically hide the navigation when only a single slide is in the slideshow?

    2) If no matching slideshow slug, what would be the method to "look back in the page ancestry" and display the topmost ancestor's slideshow instead? I am looking into making "section" slideshows, if that makes sense. Slideshows that display on every page in a "Section" - example: all pages and sub pages in the "about us" section of a website.

    My current code displays a slideshow based on page slug:

    if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow($post->post_name, "width: 1024, height: 658" ); }

    I believe we should need to integrate something based on this, but I cannot quite get it:
    echo get_page(array_pop(get_post_ancestors($post->ID)))->post_title;

    Thank you!


  2. robotor
    Posted 2 years ago #

    Woohoo, I believe may have found my solution for the second question on my own, am testing this further now:

    if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(get_page(array_pop(get_post_ancestors($post->ID)))->post_title, "width: 1024, height: 658" ); }
  3. Josh Leuze
    Plugin Author

    Posted 2 years ago #

    I haven't really been testing the slideshow with one slide, but this has been coming up more often, so I will probably add better support for a single slide in a future version.

    You can load the navigation conditionally using a custom slideshow template. Take the code for the navigation from lines 65-97 and wrap them in a conditional like this:

    <?php if ( $loop->post_count > 1 ) : ?>
    	<?php // Adds Previous/Next and Paged navigation
    	<?php endif; ?>
    <?php endif; ?>

    Did you get that second question figured out?

  4. robotor
    Posted 2 years ago #

    Thank you, I did get that second question figured out.

    I'll give the conditional php a shot...

  5. robotor
    Posted 2 years ago #

    Placing the conditional around the navigation is the perfect fix for that. I recommend building it into the next plugin version.

  6. Josh Leuze
    Plugin Author

    Posted 2 years ago #

    Cool, I'll see what I can do!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic