WordPress.org

Support

Support » Themes and Templates » [Plugin NextGen Gallery] Shortcode tags hardcoded outside the loop

[Plugin NextGen Gallery] Shortcode tags hardcoded outside the loop

  • mariostella
    Member

    @mariostella

    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!

Viewing 12 replies - 1 through 12 (of 12 total)
  • mariostella
    Member

    @mariostella

    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

    Alex, where are you?

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

    But we ned a little help =D

    mariostella
    Member

    @mariostella

    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.

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

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

    mariostella
    Member

    @mariostella

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

    mariostella
    Member

    @mariostella

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

    Jorge Carbwood
    Member

    @jlcarbwood

    <?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.

    lwatkins
    Participant

    @lwatkins

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

    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?

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

    Great solution! Thank you!

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

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin NextGen Gallery] Shortcode tags hardcoded outside the loop’ is closed to new replies.