Support » Fixing WordPress » How to display date under post title?

  • Resolved Hopper

    (@faithfilly)


    I’m starting with the index.php file of the theme SimpleLine 1.0 based on Sandbox, designed by sofish (who is Chinese). You can see that myblog does not display when the posts were published.

    So far, I’ve tried each one of these codes (separately):

    <div id=”content”>Published on <?php the_date(‘F j, Y’); ?></div>

    and

    <span class=”postDate”><?php the_date(‘F j, Y’); ?> in <?php the_category(‘, ‘) ?></span>

    in several different areas of the file, but nothing I do is bringing up the date.

    Here is what’s in my index.php:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I’d like the dates for every post to always show up (archives, category listings, searches), so I think I’d need to edit more than just the index.php, right?

Viewing 7 replies - 1 through 7 (of 7 total)
  • vtxyzzy

    (@vtxyzzy)

    You are correct in thinking that you might need to edit several files.

    Try using the_time() instead of the_date().

    Hopper

    (@faithfilly)

    That idea didn’t work. I hope it helps if I use the pastebin like I should have in the first place. Maybe you didn’t see my index.php file?

    I also noticed that a date shows up when people leave comments, but it leaves the same date as the previous comment (the date never changes).

    I’ve never seen a WordPress template with so many things to fix. Is that what themes based on Sandbox mean?… that it pushes users to have to play in the dirt to learn? Do I give up or keep going with the theme? I spent endless hours searching for one I like and I like the look and design of this one (it figures).

    Here is the link to the index.php file.

    vtxyzzy

    (@vtxyzzy)

    EDIT: Looks like you already have it solved. Please use the dropdown at top right to mark this topic ‘Resolved’ so others will not keep looking to solve it.

    I don’t know what you have tried, but give this a shot. Put this:

    <span class="postDate"><?php the_time('F j, Y'); ?> in <?php the_category(', ') ?></span>

    just ahead of this:

    <div class="entry-content">

    Hopper

    (@faithfilly)

    No… I don’t have it resolved. You must have looked at my site when I had another theme installed.

    However, I think you have helped me tremendously by telling me exactly where to place the code.

    Your instructions fixed the index.php, but now I can’t get the date to show up on individual posts. It doesn’t work when I put the code in the same place in the page.php

    Also, the date for new comments only repeats the same date as the last comment made before I changed themes.

    Hopper

    (@faithfilly)

    FINALLY!! It makes sense!! Thank you vtxyzzy!

    I had to be sure that the code got placed exactly in the right spot in every file!

    Why do people assume everyone knows where to put the codes?

    I’m amazed that most of the time no mention is made of what files they go in or exactly where in the file it goes!!!!

    Not everyone has a great memory, so when good instructions are given, it is greatly appreciated! Thanks again.

    Hopper

    (@faithfilly)

    I spoke too soon. I can’t get the comments to publish the date properly. It will only put the original publication date of the post.

    In the edit window of the comment, it does have the correct date. When the comment get published, it doesn’t put that correct date in.

    I’ve read posts on this before, but they haven’t helped. They say the dates shows correctly at the back end, but the front end does not. The feed for the comments though do show the right date.

    Here is the code in the comments.php

    Hopper

    (@faithfilly)

    Since my issue is no longer as what the title of this thread is, I created a new post entitled, “Wrong date displayed for comments.”

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to display date under post title?’ is closed to new replies.