Title: Custom Post Type will not execute shortcode
Last modified: August 30, 2016

---

# Custom Post Type will not execute shortcode

 *  Resolved [Meeker](https://wordpress.org/support/users/meeker/)
 * (@meeker)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-will-not-execute-shortcode/)
 * Hi there,
 * I have created a Custom Post Type. One of the fields in the CPT holds a Revolution
   Slider shortcode e.g. [rev_slider test1]. So each page of the CPT therefore has
   a different slider.
 * I want to be able to call this shortcode into the template. Calling it directly
   does not work as it only retrieves the shortcode and does not execute it e.g.
 *     ```
       $testslider1= get_field('rev_slider',$post->ID);
       	if( $testslider1{
       	echo '<div class="test1-slider"> '.$testslider1.'</div>';
       }
       ```
   
 * I have also tried executing the shortcode directly, it does not appear to be 
   able to pull in CPT content:
 * `echo do_shortcode(‘.rev_slider.’);`
 * Any ideas? Thanks…

Viewing 1 replies (of 1 total)

 *  Thread Starter [Meeker](https://wordpress.org/support/users/meeker/)
 * (@meeker)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-will-not-execute-shortcode/#post-6278446)
 * No sooner do I post, than I cracked it!
 * $testslider1 get_field(‘rev_slider’,$post->ID);
    echo do_shortcode(”.$testslider1.”);
 * It was putting the double quotation marks before and after which worked. Solved!

Viewing 1 replies (of 1 total)

The topic ‘Custom Post Type will not execute shortcode’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [execute](https://wordpress.org/support/topic-tag/execute/)

 * 1 reply
 * 1 participant
 * Last reply from: [Meeker](https://wordpress.org/support/users/meeker/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-will-not-execute-shortcode/#post-6278446)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
