WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to code the Date of post, as a single header on top of all posts for the day (7 posts)

  1. drursi08
    Member
    Posted 7 years ago #

    Hey all,

    I'm looking to figure out how to code the DATE in a large, noticeable way. Rather than having the date be displayed with every post, I just want the date to appear as a header above all posts for the day.

    As an example, check out the large Dates ontop of posts at http://www.littlegreenfootballs.com and http://www.israellycool.com/

    Any idea how I could do this? Thanks!

  2. whooami
    Member
    Posted 7 years ago #

    most themes do that by default, the date part, minus the font size. you have not provided a link to your site, and im not going to look through hundreds of themes to see if I can find one that doesnt handle them that way, so I can only assume yours does as well-- perhaps youve yet to post twice in one day, so you dont even know it.

    the font size is controlled via your CSS, look for H2 or H3 and style it from there.

  3. drursi08
    Member
    Posted 7 years ago #

    My website is here: http://www.sevenstripes.com/blog

    As you can see, this theme inserts a small date under each post title.

  4. whooami
    Member
    Posted 7 years ago #

    Ok, that helps. if you look at your themes index.php, that date on every post is being called with the following:

    <?php the_time('F jS, Y') ?>

    the first step toward what you want is removing that bit of code from your index.php

    --

    The second bit (putting back one date for each day) is done by adding this:

    <?php the_date('','<h2>','</h2>'); ?>

    Putting the above line immediately below the following line:

    <?php while (have_posts()) : the_post(); ?>

    should achive what you want.

    you will get one big date enclosed with h2 tags that you can style to your liking in your css.

  5. moshu
    Member
    Posted 7 years ago #

    Just check it how it is done in the Classic theme - it works exactly the way you want it.

  6. drursi08
    Member
    Posted 7 years ago #

    Great! Thanks guys! One tiny problem now -- If you check the site, theres a "; ?>" after the name of the one made the post.

    July 4, 2006
    4th of July Tribute to the Troops
    Blogged in Misc., War on Terrorism by Dave; ?> <--- how to get rid of this?

    Should be a simple fix but I'm a bit php-challenged ;D

  7. moshu
    Member
    Posted 7 years ago #

    You should check the index.php file where "the_author" tag is and see if there is anything in "plus" there.

    Also, you should work on your stylesheet, so that the subcategories get a bit bigger font size (they are nested lists).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags