WordPress.org

Ready to get started?Download WordPress

Forums

Meteor Slides
Using my custom meta to choose which slideshow to display (2 posts)

  1. madebymartin
    Member
    Posted 2 years ago #

    Hi
    In my theme I have a slideshow at the top of the page that shows the default-slideshow.
    I also have other slideshows and would like to be able to choose which slideshow is displayed on any given page by using custom meta boxes in the editor.
    I have added the custom meta (text field) to the page editor and would like to return this custom meta into the template in order to select which slideshow will display.

    EG. I have: SLIDESHOW1 and SLIDESHOW2 (created using Meteor Slides) and would like to type either of these names into the custom meta box so that slideshow is displayed.

    I would normally use the following to display the text that was entered into the custom meta box:
    <?php echo get_post_meta(get_the_ID(), "example_meta_ID", true); ?>
    But I am struggling to work out how to combine this with the Meteor Slides template code that calls for the slideshow:
    if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( "default-slideshow", "random: 1, pause: 0" ); }

    Any help would be massively appreciated!
    Cheers

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

  2. Josh Leuze
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Martin, try using this:

    <?php if ( get_post_meta( $post->ID, "slideshow_value", $single = true ) != "" ) {
    
    	$custom_slideshow = get_post_meta( $post->ID, "slideshow_value", $single = true );
    
    	if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( $custom_slideshow, "random: 1, pause: 0" ); }
    
    } ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic