WordPress.org

Ready to get started?Download WordPress

Forums

Most recent post emphatized (2 posts)

  1. puCK2001
    Member
    Posted 9 years ago #

    I want some post in the home page, of whom just the first with a bigger font and an image.
    Later, when i add a new post, only the last one will be emphatized automatically and the older will become unemphatized like all the others.
    How can i do that?

  2. Orin
    Member
    Posted 9 years ago #

    A way to do this is to make the first post have its own unique class and modify it with CSS rules. I called mine 'post-first', where normally it is just 'post'. In your main template you'll find the line:

    <div class="post">

    If you replace that with this:

    <div class="post<?php if(!is_single() && $post==$posts[0]) echo '-first';?>">

    The first post will be .post-first. I discovered this method in this thread.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.