Forums

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

  1. robotor
    Member
    Posted 3 months 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!

    http://wordpress.org/extend/plugins/meteor-slides/

  2. robotor
    Member
    Posted 3 months ago #

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

    <?php
    if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(get_page(array_pop(get_post_ancestors($post->ID)))->post_title, "width: 1024, height: 658" ); }
    ?>
  3. JLeuze
    Member
    Posted 3 months 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
    Member
    Posted 3 months ago #

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

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

  5. robotor
    Member
    Posted 3 months ago #

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

  6. JLeuze
    Member
    Posted 3 months ago #

    Cool, I'll see what I can do!

Reply

You must log in to post.

About this Plugin

About this Topic