WordPress.org

Ready to get started?Download WordPress

Forums

Post Time and Date (5 posts)

  1. BuzzLightyear
    Member
    Posted 9 years ago #

    On my site (www.GreatBligty.com) I have a category called 'Social Diary' in which people list social events in Britain which may be of interest to visitors. However when content is posted the time and date of the post is placed under the posts title. I am finding that this is confusing people as they believe this is the date and time of the social event rather than the time it was placed on the site. I believe the simple solution would be to place the word 'Posted' before the post date and time. How is this done? Does anyone have any better ideas?

  2. BuzzLightyear
    Member
    Posted 9 years ago #

    Make that http://www.GreatBlighty.com - sorry !

  3. Lorelle
    Member
    Posted 9 years ago #

    First, check to see if your Theme uses a caegory.php template file. If it does, look in there for what I'm going to describe. If it doesn't, then look in the index.php template file.

    Open it and search for the_time. It will show up in something like this:

    <h3 class="storytitle">
    <a href="<?php the_permalink() ?>" rel="bookmark">
    <?php the_title(); ?></a>
    </h3>
    <div class="meta">
    <?php the_time() ?></div>

    Now, there are two ways you can do this.

    1. Type in something like this into that section of code (try to match this but you can say something different):

    <div class="meta">
    Posted: <?php the_time() ?>

    2. Do the same thing but put the "posted" into an "echo" tag like this (this is the better choice of the two):

    <div class="meta">
    <?php _e('Posted: '); ?><?php the_time() ?>

    Take care not to delete or mess with the rest of the code around it.

    Here is more information that might help you:

    http://codex.wordpress.org/Formatting_Date_and_Time
    http://codex.wordpress.org/Post_Meta_Data_Section
    http://codex.wordpress.org/Stepping_Into_Template_Tags

  4. BuzzLightyear
    Member
    Posted 9 years ago #

    I'm using a slightly modified version of the standard theme. I therefore have index.php and category-85.php as an option to edit - I notice the code you have suggested is in both - which one do I edit?

  5. BuzzLightyear
    Member
    Posted 9 years ago #

    In fact it turns out that it is archive.php that has to be edited. Thanks for the code anyway!

Topic Closed

This topic has been closed to new replies.

About this Topic