Support » Fixing WordPress » How to Change Title Font Size Specifically?

  • I know that we can tweak the title font size using style.css file in wordpress, but that affects the titles of all the posts. My question is how to do it specifically, without affecting the rest of the posts.

    To be precise, I would like to know how I can display my latest post’s title prominently while retaining others as they are.
    I’m showing only my newest post in full (using this hack) so I want its title to be bigger and prominent.

    Can somebody tell me the hack for showing only my first (latest) post with a larger title?

Viewing 4 replies - 1 through 4 (of 4 total)
  • That is controlled in the post.php and style.css files. So not sure if you can change it individually.

    lol…how good is your php? cuz mine is terrible! I have a concept for you, maybe you can piece it together…..or someone can come along and help you out.

    I use the bit of code below to alternate adding a class of odd or even to each post. That way in css I can change things up based on whether the post class is odd or even. Now I know that’s not what you want to do…..but this code is based on a counter, and the bit of code you used is too. If ya can figger a way to piece together your code with some of this, you could assign a class to your first post, then be able to style anything you want in it differently

    <?php if (have_posts()) : ?>
             $c = 0; // set up a counter so we know which post we're currently showing
             $extra_class = 'even' // set up a variable to hold an extra CSS class
             <?php while (have_posts()) : the_post(); ?>
             $c++; // increment the counter
             if( $c % 2 != 0) {
    	  // we're on an odd post
    	   $extra_class = 'odd';
             } else {
             $extra_class = 'even'; }
             <div id="post-<?php the_ID(); ?>" <?php post_class($extra_class) ?>>

    My knowledge of PHP is zero and I can’t help myself with what you said. 🙁

    I hope somebody simplifies it for me, or comes up with something rather clear-cut. Thanks for the reply, appreciated.

    Does nobody here know how to do it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Change Title Font Size Specifically?’ is closed to new replies.