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?

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.