Skip Navigation

[Resolved] Custom fields output as shortcodes in excerpts using 2 different plugins

This support ticket is created 9 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by dbarber 9 years, 9 months ago.

Assigned support staff: Caridad.

Author
Posts
#173460

I've got a couple of plugins that are having problems with custom fields (hidden link and hidden link).

Both support Custom Post Types but neither seems to process custom fields in manually created post excerpts.

I created a support ticket at ThemePunch (developers of the first plugin) and they're always very quick to respond (I had another thread about a similar issue with another of their plugins over here https://toolset.com/forums/topic/revolution-slider-version-does-not-recognize-wpcf/).

But since the problem has shown up in 2 different plugins, I thought I'd start a thread here.

#173664

Dear Dbarber,

The excerpt by default doesn't process shortcodes in it, but rather hides them. You can force it to happen by adding this line to functions.php in your theme. This tells wordpress to process shortcodes in the excerpt too:

add_filter('the_excerpt', 'do_shortcode');

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad

#173786

Hi Caridad

I tried the snippet above and it did not work. But if I add the following:

add_filter( 'get_the_excerpt', 'do_shortcode', 5 );

It does work when WordPress is used to process the excerpts, just not the plugins.

Showbiz Pro came back to me and said that their plugin does not support shortcodes at this point, so I'll have to wait on them until they add support.

I haven't contacted the developer of the Filtering plugin, so I'll have to hang tight on that one.

Anyway, in case anyone else needs this, here's the full code that worked for me:

add_filter( 'the_excerpt', 'do_shortcode');
add_filter( 'get_the_excerpt', 'do_shortcode', 5 );

Cheers