mariostella
Member
Posted 3 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!
mariostella
Member
Posted 3 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
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
Posted 2 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.
adamholz
Member
Posted 2 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.
mariostella
Member
Posted 2 years ago #
Thanks, I'll try that one out, If I have not already, I can't remember right now!
mariostella
Member
Posted 2 years ago #
Yep, not working for me..have no idea why
JLCarbwood
Member
Posted 2 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.
lwatkins
Member
Posted 2 years ago #
@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?
SETH__M
Member
Posted 2 years ago #
<?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.