Excerpt
-
Hello guys,
I would like filter meta_description by filter the_excerpt but it did work.. Could you please help me on that ?
Do you have any way to filter meta-description; i would like delete the first tag of the content.Below my code, it works on the blog page (where i have a view on all my post) but not on each post !
function override_excerpt( $content ) { $raw_excerpt = $content; if( '' == $content ) { $content = get_the_content(); $regex = '/(<div class=\"intuitioncompanydescription\">(.*?)<\/div>(.*?)<h3>Poste<\/h3>)/s'; $content = preg_replace ( $regex, '', $content ); } return apply_filters ('wp_trim_excerpt', $content, $raw_excerpt ); } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'override_excerpt', 1);The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Excerpt’ is closed to new replies.