Title: do_shortcode or what?
Last modified: August 21, 2016

---

# do_shortcode or what?

 *  [gustavoo](https://wordpress.org/support/users/gustavoo/)
 * (@gustavoo)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/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.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/do_shortcode-or-what/#post-3906468)
 * the ‘shortcode’ is possibly no shortcode in the direct sense of how WordPress
   uses shortcodes; [http://codex.wordpress.org/Shortcode_API](http://codex.wordpress.org/Shortcode_API)
 * try:
 *     ```
       <?php echo apply_filters( 'the_content', get_post_meta($post->ID,'_product_info_product_link', true) ); ?>
       ```
   
 * as this code is not generic to WordPress, have you contacted the plugin’s or 
   theme’s developer for support?
 *  Thread Starter [gustavoo](https://wordpress.org/support/users/gustavoo/)
 * (@gustavoo)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/do_shortcode-or-what/#post-3906530)
 * Dear alchymyth
 * Thank you so much for your reply.
 * It is not what I want but the code that you wrote does what I want. So my problem
   solved in other sense.
 * Again thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘do_shortcode or what?’ is closed to new replies.

## Tags

 * [do_shortcode](https://wordpress.org/support/topic-tag/do_shortcode/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [the_content](https://wordpress.org/support/topic-tag/the_content/)

 * 2 replies
 * 2 participants
 * Last reply from: [gustavoo](https://wordpress.org/support/users/gustavoo/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/do_shortcode-or-what/#post-3906530)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
