• I configured my wordpress so that 5 entries are on one page. All titles are the same fontsize.

    Is it possible to have a bigger type for the latest entry, so that it looks like “breaking news” and everybody looks there first.

    Thanks

Viewing 1 replies (of 1 total)
  • Sure, just use some simple PHP to do it. Try something like (this is heavily over simplified for use as an example):

    $firstpost = TRUE;

    if (have_posts()) :
    while (have_posts()) : the_post();

    $postclass = ($firstpost == TRUE) ? 'breakingnews' : 'normalpost';
    $firstpost = FALSE;

    ?>

    <div class="<?php echo $postclass; ?>">
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>
    </div>

    <?php endwhile; ?>
    <?php endif; ?>

    That’ll set a class of breakingnews for the first post div and the class normalpost to the rest of the post divs on the page.

    Then just do something like this for your CSS:

    .breakingnews h2 {
    font-size: 50px;
    }
    .normalpost h2 {
    font-size: 20px;
    }

    That’ll make a big ass header for the first post, and smaller for the rest. Obviously you won’t wanna use that CSS, but that gives you an idea how to lay it out.

    You’ll probably also want to use like is_home() so that you don’t get the breakingnews class on the next page and such.

Viewing 1 replies (of 1 total)

The topic ‘Special format for latest entry’ is closed to new replies.