Shortcodes and excerpts
-
Hi,
I’m trying to get my shortcodes to play nice with my excerpts, and I’m getting nowhere.I know that this has been answered numerous times, but I’ve read and tried everything that I can.
I just don’t know a heck of a lot about PHP.
I’ve tried many variations of the following in my child theme’s functions.php, but all to no avail.
<?php add_filter('get_the_excerpt', 'do_my_shortcode_in_excerpt'); function do_my_shortcode_in_excerpt($excerpt) { return do_shortcode(wp_trim_words(get_the_content(), 55)); }
Can anyone lend a hand?
Thanks,
Chris
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Shortcodes and excerpts’ is closed to new replies.