• Is there a way to a assign a class to an output function such as “the_excerpt”. These functions basically wrap the excerpt in a ‘p’ tag and then output it.

    Is there a way apply a CSS class to the excerpts? I want to assign class=”excerpt” to them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You would just need to define the class in the stylesheet. You can insert something like:

    .excerpt {
    font family: Verdana, Arial, Helvetica, sans-serif;
    color: #8B7F74;
    font-size:12px;
    }

    Then when you use the <div class="excerpt"><?php the_excerpt(); ?></div> tag, whatever your excerpt is will have the formatting your specified in the CSS.

    I usually put my CSS stuff under ‘navigation’ or with whatever section uses the .name { format.

    Thread Starter kuttnhaste

    (@kuttnhaste)

    Yeah I could do it that way however I was wondering if they had a method of putting a class directly on the ”p” tag. eg: <p class="excerpt">excerpt text here</p>.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CSS classes to output functions?’ is closed to new replies.