Forums

[Plugin: NextGEN Gallery] Insert gallery contents into template (6 posts)

  1. fluvius
    Member
    Posted 4 years ago #

    Hi,

    I've created a gallery using the NextGEN Gallery plugin and placed some sponsors logos into it.
    I now want to display those logo images in the footer area of my site full sized (not as thumbnails that click through to the full sized versions). I don't want a slideshow or anything as fancy as that either, just a way to pick up the contents of said gallery and place them in my footer.

    Is it possible to achieve this, possibly by placing some code in the footer.php template file?

    All help gratefully received.

    Tony.

  2. Andy Potanin
    Member
    Posted 3 years ago #

    I don't think NextGEN has any functions you can put into your template files to display its galleries/slideshows/etc. However, you can do the following:

    <?php
    $custom_gallery_content = '[gallery=1]';
    echo apply_filters('the_content', $custom_gallery_content);
    ?>

    Obviously, $custom_gallery_content can be whatever tags you would use within a post/page to display your gallery.

    Hopefully this helps somebody else out.

  3. staceyk18
    Member
    Posted 3 years ago #

    Hey,

    I used the code above, and it works perfectly! Just wondering though if it is possibly to have a different gallery on each post? I have put the above code in my sidebar, and would like the gallery to change, depending on the post.

    I thought I may be able to use the get custom fields tag, but not luck!

    Any one got any ideas?

  4. Andy Potanin
    Member
    Posted 3 years ago #

    Yes, you should be able to do something like this:

    <?php
    if(is_post(X)) { echo apply_filters('the_content', '[gallery=1]'); }
    if(is_post(X)) { echo apply_filters('the_content', '[gallery=2]'); }
    if(is_post(X)) { echo apply_filters('the_content', '[gallery=3]'); }
    ?>

    Where X would be different post/page IDs.

  5. beinha
    Member
    Posted 3 years ago #

    andypotanin, thanks for posting, I was looking for a solution for my sidebar and your code works perfect.

  6. meet6669
    Member
    Posted 3 years ago #

    Hi Andypotanin,

    I have been searching all over the internet on how to embed a slideshow as header. I tried a number of codes and only yours WORKED !. Thanks for the code and if possible, let me know whether I can change the width and height of the above given template code.

    Thanks
    Jimmy

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.