Support » Themes and Templates » Styling Excerpts

  • Can anyone please explain how/where one can create class(es) for Excerpts so they may be styled with CSS? I’m hoping to display the excerpts on my category archive pages in a “magazine style”. Using “yoko” theme.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p



    some plugins to look into:

    Thanks, t-p. Rather than rely on plugins (I already use Thumbnails for Excerpts) I’m trying to learn how to do this via PHP and CSS. I’m a retired guy with little coding experience, just an insane desire to understand how to make a web site that can display media I’ve created. I’m trying to understand how the coding works as much as I’m trying to get the site up and functional. I do appreciate your suggestion, and any advice you might have on where I can learn more about how to style content in WP. -Les

    You could simply put your excerpt into some html tags and apply a CSS class to it.

    Something like that:

    <span class="myExcerptClass"><?php the_excerpt() ?></span>

    And in your CSS stylesheet
    .myExcerptClass { styling goes here }

    Thanks, nicosFR. That seems pretty simple and I used it to make some styling of the excerpt happen. Now I just have to figure out the CSS box model and apply it to the excerpt.

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