Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.