Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author CrestaProject

    (@crestaproject)

    Hi atozsoft.net,
    shortcodes are not “rendered” in the excerpt but unfortunately shows the shortcode.
    You can try to add this filter in the “functions.php” file of the theme:

    
    function modify_excerpt( $text ) {
    	$text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text);
    	return $text;
    }
    add_filter( 'the_excerpt', 'modify_excerpt' );
    

    This should remove shortcodes from excerpt.

    Best Regards,
    CrestaProject

    Thread Starter Ufuk A.

    (@tindeks2)

    hi CrestaProject,

    thanks for your reply.

    but this did not work.

    Theme Author CrestaProject

    (@crestaproject)

    Yes you’re right, in that function I did not use “the_excerpt()” function.
    I’ll fix this in the next theme update, so you can use the function that I gave you in the previous answer ??

    Best Regards,
    CrestaProject

    Theme Author CrestaProject

    (@crestaproject)

    Hi atozsoft.net,
    I think this code will solve your problem:

    
    function modify_excerpt( $text ) {
    	$text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text);
    	return $text;
    }
    add_filter( 'wp_trim_words', 'modify_excerpt' );
    

    Best Regards,
    CrestaProject

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘flash news problem’ is closed to new replies.