WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin NextGen Gallery] Shortcode tags hardcoded outside the loop (13 posts)

  1. mariostella
    Member
    Posted 5 years ago #

    Hello! I need shortcode tags to work even if not inserted in the post page but as hardcoded in template pages.
    You know how they get reproduced as simple text, so what is the function they have to be wrapped up in to work fine?
    I found the do_shortcode function for WP shortcodes, but I need it for NextGen Gallery. I need to show always the same gallery in the same place (outside the loop....).
    How do I go about with this? Thanks!

  2. mariostella
    Member
    Posted 5 years ago #

    Alex, would you happen to know how to solve this? What is the variable/function/query/god-knows-what to call in the do_shortcode function? Is do_shortcode even gonna work with NGG?
    Thanks

  3. trusktr
    Member
    Posted 5 years ago #

    Alex, where are you?

  4. trusktr
    Member
    Posted 5 years ago #

    I will be donating to this great plugin once i start having income from my online store! ;)

    But we ned a little help =D

  5. mariostella
    Member
    Posted 5 years ago #

    I worked around this by creating two private posts then quering the content of those posts (one has the picture gallery with lightbox effect inside, the other the slideshow) so now it works fine, but it's kinda bulky and I'd rather go with something sleeker.

  6. adamholz
    Member
    Posted 4 years ago #

    <?php echo do_shortcode('[normal nextgen gallery shortcode goes here]'); ?>

    I use this a lot with the album shortcode and it works fine.

  7. mariostella
    Member
    Posted 4 years ago #

    Thanks, I'll try that one out, If I have not already, I can't remember right now!

  8. mariostella
    Member
    Posted 4 years ago #

    Yep, not working for me..have no idea why

  9. Jorge Carbwood
    Member
    Posted 4 years ago #

    <?php echo do_shortcode('[normal nextgen gallery shortcode goes here]'); ?>

    This work for me, but I want to get the id = value from a custom value. How i do that, i try several ways and i get to echo the value but it won't pass it to the ID.

  10. lwatkins
    Member
    Posted 4 years ago #

    @JLCarbwood - That is exactly what I am trying to do. Did you ever find a solution?

  11. hobbsy
    Member
    Posted 4 years ago #

    JLCarbwood - could you maybe add that value as a custom field to the page/post?

    and then pull it into the code you posted above:

    <?php echo do_shortcode('[nggallery id=<?php echo get_post_meta($post->ID, "nameofyourcustomfield", true); ?>]'); ?>

    I'm not a NextGEN or WordPress expert so it's just a guess. Worth a try?

  12. SETH__M
    Member
    Posted 4 years ago #

    <?php echo do_shortcode('[normal nextgen gallery shortcode goes here]'); ?>

    Great solution! Thank you!

  13. Jim R
    Member
    Posted 4 years ago #

    I"m trying this:
    do_shortcode('[nggtags gallery='. single_tag_title() .']');

    All it does for me is print the value of single_tag_title.

Topic Closed

This topic has been closed to new replies.

About this Topic