How To Style Excerpts Separately?

  • Anonymous


    The excerpt and the post content use the same css commands .entry-content p,. I would like to know how I can separate the excerpts from the post content in order to use a different font size for both of them.

    Thanks in advance.

    EDIT: I resolved the problem.

    I added the following to my functions.php (in child theme) file to create a separate class for excerpts.

    add_filter( "the_excerpt", "add_class_to_excerpt" );
    function add_class_to_excerpt( $excerpt ) {
    return str_replace('<p', '<p class="excerpt"', $excerpt);

    CSS Class:

    .excerpt {
    font-size: 14px;


Viewing 1 post (of 1 total)

  • You must be logged in to reply to this topic.
Graphene Themes Forum