Comments 3aenoch started the conversationJuly 5, 2023 at 8:28pmBasically if I enter content into the excerpt area for a post, I would like to be able to include html and shortcodes in the nectar_excerpt that appears. It uses this code to display: echo '<div class="excerpt">'; echo nectar_excerpt( $excerpt_length ); echo '</div>';Is that something I can enable using some code in my child theme's function.php file, etc.?Thankyou! 8,839Tahir repliedJuly 6, 2023 at 1:12amHey Again,Yes, you can override the original function via a child theme as per your requirements.Path: themes\\salient\\nectar\\helpers\\blog.php .See the original code below: if ( ! function_exists( 'nectar_excerpt' ) ) { function nectar_excerpt( $limit ) { if ( has_excerpt() ) { $the_excerpt = get_the_excerpt(); $the_excerpt = preg_replace( '/\[[^\]]+\]/', '', $the_excerpt ); // strip shortcodes, keep shortcode content return wp_trim_words( $the_excerpt, $limit ); } else { $the_content = get_the_content(); $the_content = preg_replace( '/\[[^\]]+\]/', '', $the_content ); // strip shortcodes, keep shortcode content return wp_trim_words( $the_content, $limit ); } } } Thanks. ThemeNectar Support Team 3aenoch repliedJuly 7, 2023 at 7:27pmthanks for your assistance :)1 Like Sign in to reply ...
Basically if I enter content into the excerpt area for a post, I would like to be able to include html and shortcodes in the nectar_excerpt that appears. It uses this code to display:
echo '<div class="excerpt">';
echo nectar_excerpt( $excerpt_length );
echo '</div>';
Is that something I can enable using some code in my child theme's function.php file, etc.?
Thankyou!
Hey Again,
Yes, you can override the original function via a child theme as per your requirements.
Path: themes\\salient\\nectar\\helpers\\blog.php .
See the original code below:
Thanks.
ThemeNectar Support Team
thanks for your assistance :)