A separate class for the excerpt
-
Hello. Is it possible to add its own class to the excerpt (inside <article> tag for example)? I tried to include like this:
add_filter( "the_excerpt", "add_class_to_excerpt" ); function add_class_to_excerpt( $excerpt ) { return str_replace('<article', '<article class="my-excerpt"', $excerpt); }However, it did not work out. Can you show the correct code for this? And, as it seems to me, it would be appropriate to add such a function to your wonderful plugin.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘A separate class for the excerpt’ is closed to new replies.