• Hi.
    I’m have a page that is pulling in 2 categories – News and Events.
    I would like to add a class to the different posts so that I can style them differently. How do I do that?

    Here’s the code I’m using – Can I add another class to the_title H2?

    <?php
    if ( is_single() ) {
    the_title( '<h2 class="entry-title"> ','</h2>' );
            } else {
    the_title( '<h2 class="entry-title" <a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
             }
    if ( 'post' === get_post_type() ) : ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    Thanks in advance

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Styling different categories on same page’ is closed to new replies.