ShortCode not working in Excepts

User avatar
Posts: 1
Joined: 6 years ago

ShortCode not working in Excepts

Postby skipping » 6 years ago

First let me say THANK YOU for a great plugin to WP. It has eliminated a lot of redundant code from my posts and pages.

I am a newbie to WP so excuse me for my ignorance.

My challenge is that shortcodes (shortcoder included) work great in pages and posts HOWEVER
they shortcodes (shortcoder included) are ignored and displayed as text in the excepts. I realize that this is a general problem and not specific to shortcoder but any guidance in getting this resolved would be much appreciated.

I saw a post on another site that suggested that adding
// ADD Shortcode processing to Excerpts
add_filter( 'the_excerpt', 'shortcode_unautop', 11);
add_filter( 'the_excerpt', 'do_shortcode', 11);

to the function.php would resolve the issue; in my case it did not.

Post excerpts work great both auto and manual and the html I have included does get processed correctly.

Thanks for YOUR time and effort!

[sc name="Section_Menu_AboutUs"] inserted in excerpt and works on the post.
User avatar
Site Admin
Posts: 733
Joined: 7 years ago
Location: India

Re: ShortCode not working in Excepts

Postby vaakash » 6 years ago


Thanks for using my plugin. Do not add priority. Use the below code

Code: Select all

add_filter('the_excerpt', 'do_shortcode');

But make sure that the output is actually given by the "the_excerpt()" function or the "get_the_excerpt()" fuction
Thanks again for using my plugin