Title: Shortcode in Custom Field
Last modified: August 20, 2016

---

# Shortcode in Custom Field

 *  Resolved [richenginner](https://wordpress.org/support/users/richenginner/)
 * (@richenginner)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-in-custom-field/)
 * Hello i have a wordpress theme and i need use a shortcode into custom field.
 * Its a line of my code: (Title of Tab)
 *     ```
       <?php if ( get_post_meta($post->ID, 'part3', true) ) : ?>
   
                   <li><a href="#tab_grubu_3-3"><span><b><strong>Descargalo</strong></b></span></a></li>
   
                   <?php endif; ?>
       ```
   
 * Second Line: (Key and content of Custom Field)
 *     ```
       <?php if ( get_post_meta($post->ID, 'part3', true) ) : ?>
   
             <div id="tab_grubu_3-3" class="clearfix">
   
               <div class="video">
   
                 <?php $key="part3"; echo get_post_meta($post->ID, $key, true); ?>
   
               </div>
   
             </div>
   
             <?php endif; ?>
       ```
   
 * How to allow a shortcode in this code?
 * Thank you very much

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-in-custom-field/#post-2499506)
 * do you mean you have shortcode within your custom field, and want to execute 
   it when you show the field?
 * [http://codex.wordpress.org/Function_Reference/do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode)
 * example:
 * `echo do_shortcode(get_post_meta($post->ID, $key, true));`
 *  Thread Starter [richenginner](https://wordpress.org/support/users/richenginner/)
 * (@richenginner)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-in-custom-field/#post-2499545)
 * it not work..
    I had already tried before
 *     ```
       <?php if ( get_post_meta($post->ID, 'part3', true) ) : ?>
   
             <div id="tab_grubu_3-3" class="clearfix">
   
               <div class="video">
   
                 <?php $key="part3"; echo do_shortcode(get_post_meta($post->ID, $key, true)); ?>
   
               </div>
   
             </div>
   
             <?php endif; ?>
       ```
   
 * this is the link and the shortcode: “Descargalo” TAB
 * [http://cineshared.com/terror-miedo/saw-1-juegos-macabros-latino/](http://cineshared.com/terror-miedo/saw-1-juegos-macabros-latino/)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-in-custom-field/#post-2499562)
 * what is the exact content of your custom field?
 * it might be that `[plusviral]` is no shortcode;
 * does the code come from a plugin?
    if so, what plugin?
 *  Thread Starter [richenginner](https://wordpress.org/support/users/richenginner/)
 * (@richenginner)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-in-custom-field/#post-2499613)
 * is a plugin.. is a shortcode and only work in post area plusviral.com

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

The topic ‘Shortcode in Custom Field’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [richenginner](https://wordpress.org/support/users/richenginner/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-in-custom-field/#post-2499613)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
