WordPress.org

Ready to get started?Download WordPress

Forums

Gallery to Slideshow
[resolved] How to put the gallery in the single.php?? (4 posts)

  1. albertrubis17
    Member
    Posted 1 year ago #

    Hi! sksmatt. I would like to ask, how can I call the gallery to slide show using php in a single post? Should I use do_shortcode or a code that will call the gallery to slideshow parameter?

    Nice plugin!
    ~Thanks

    http://wordpress.org/extend/plugins/gallery-to-slideshow/

  2. Matt
    Member
    Plugin Author

    Posted 1 year ago #

    Hi albertrubis17,

    The gallery should work on single pages and posts or any other regular content that has the [gallery] shortcode. If you would like however to insert in some other placeyou could hook up to the mv_gallery_to_slideshow_has_gallery and return true on any page you want.

    Kind Regards!

  3. jdan
    Member
    Posted 1 year ago #

    Hi Matt,

    I'm relatively new to WordPress and the idea of plugins and hooks. I want to follow-up on your answer to the above question. I have a post-type of project, and I want the gallery to always show up on the project pages without the user having to add [gallery] manually. I'm starting to get somewhere from your answer and reading the WP codex but I'm still stuck.

    Would I add something regarding "mv_gallery_to_slideshow_has_gallery" to the functions.php page and then a modified <?php add_action( $tag, $function_to_add, $priority, $accepted_args ); ?> to the single-project.php where I want the gallery to show up? Sorry that I have to ask for a more detailed answer than you gave above.

    Thanks Matt! I really like your plugin, it's really clean and easy to understand and modify to suit my needs.

  4. jdan
    Member
    Posted 1 year ago #

    I figured out how to do it. It was pretty simple, and Matt had given the answer before.

    Including
    <?php echo do_shortcode('[gallery]'); ?>
    in single-*post-type*.php includes the gallery in the template.

    and adding:

    function my_gallery_to_slideshow_has_gallery( $params ){
        return true;
    }
    add_filter( 'mv_gallery_to_slideshow_has_gallery', 'my_gallery_to_slideshow_has_gallery' );

    to functions.php makes it show as the gallery-to-slideshow

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic