• Resolved rlthorman

    (@rlthorman)


    I am trying to have all posts within the Category-9 “Links” to appear with a smaller font.

    I was able to successfully edit all Category-9 “Links” posts in Category and Single page view to show a smaller font using a div class.

    But I have not been able to edit the Main Index to show a smaller font for posts assigned with Category-9 “Links” appears with other posts.

    I was trying to edit it using the following
    <?php if (in_category('9')) {echo '<div class="links">';} ?>
    but that is a total guess as to how to go about it and it’s not working.

    Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Your best bet is to set conditional CSS based on the post_class declaration.

    Thread Starter rlthorman

    (@rlthorman)

    Thanks, Norcross! Worked like a charm. For others that are interested, what I did is this:

    1. Replace the <body> tag in the header file with <body <?php body_class(); ?>>

    2. Replace the postentry div class in the index.php, single.php, category.php, etc. (for consistency) with <div id="post-<?php the_ID(); ?>" <?php post_class('postentry'); ?>>

    3. Added the following styling to my CSS file,

    #postarea .category-links h2 {font-size:20pt;}
    #postarea .category-links h2 a {font-size:20pt;}
    #postarea .category-links p {font-size:13pt; line-height:15pt}

    Hope that helps someone else and thanks again Norcross!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I edit the look of posts w/in a specific category on main index page?’ is closed to new replies.