do_shortcode or what?
-
Hi everyone.
I have a problem with showing shortcode on a template, and outside the the_content.
As I read on codex help, do_shortcode should do the job but it doesn’t (in my case).
So to clarify what I want to do, imagine I have a function which gets some info from database and brings it on the page like this:<php get_post_meta($post->ID,'_product_info_product_link', true); ?>
If I add echo, it easily shows:
[WP_CART:PRODUCT-NAME:PRICE:PRODUCT-PRICE:END]
which I stored in a database. Everything going smooth till here.
But as I understood from codex help, if I put the output of “get_post_meta” in do_shortcode, it should do what a shortcode suppose to do. But it doesn’t.
<?php echo do_shortcode(get_post_meta($post->ID,'_product_info_product_link', true)) ?>
and it just shows “[WP_CART:PRODUCT-NAME:PRICE:PRODUCT-PRICE:END]”.So I guess maybe the reason is that I am doing it wrong or I understood it wrong. Does any one knows what should I do?
BTW, shortcode works properly in “the_content” AND I am new to wordpress :).
Thanks in advance.
- The topic ‘do_shortcode or what?’ is closed to new replies.