WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a shortcode and placed it in my functions.php and registered it with:

add_shortcode('featured-attribution', 'gteh_author_shortcode');

It works fine on posts and pages.

I created a custom post type, and when I use the shortcode in the content, it just displays the shortcode rather than the function. I am using the_content() to display the content so not sure why it is not working. In fact, the custom post type is just using single.php so not sure why it works on single posts, but not single custom post type pages...

Does anyone have any suggestions?

share|improve this question
Add <?php echo has_filter( 'the_content', 'do_shortcode' ) ?> into your single.php file and tell us what will be printed. – Eugene Manuilov Aug 9 '13 at 6:37
just the number 11 is printed. – gteh Aug 9 '13 at 15:03
show your single.php file. – Eugene Manuilov Aug 11 '13 at 6:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.