Hello Alexandregaeta,
If your shortcode is not working in excerpts, it might be due to the fact that WordPress, by default, doesn’t execute shortcodes in excerpts. You can enable shortcode execution in excerpts by adding a filter to your theme’s functions.php file.
Here’s an example of how you can enable shortcode execution in excerpts:
// Enable shortcodes in excerpts
function enable_shortcodes_in_excerpt() {
add_filter('the_excerpt', 'do_shortcode');
}
add_action('init', 'enable_shortcodes_in_excerpt');
You can add this code to your child theme’s functions.php file. This code adds a filter to the excerpt, applying the do_shortcode function, which allows shortcodes to be executed in the excerpt.
Please be cautious when adding code to your theme’s files, and ensure you have a backup before making changes.
Thanks
Sujapati