WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Want date to appear once per group of posts per day. (13 posts)

  1. h2orange
    Member
    Posted 8 years ago #

    How can I do this? I imagine I need to make a change in the loop, but cannot find where. Thanks so much.

  2. FruitFly
    Member
    Posted 8 years ago #

    You'll want to use the_date template tag, instead of the_time (or whatever you're using currently).

  3. h2orange
    Member
    Posted 8 years ago #

    Thanks... where in the loop do I make the change, however?

  4. FruitFly
    Member
    Posted 8 years ago #

    Depends on where you want it. :)

    Usually, if I'm using the_date, I put it above the post (in most templates, div class="post"), or just after the start of the loop, but that's more personal preference than anything else. Just remember, wherever you put it, it's only going to appear once for each date, so if you have it at the end of the post, it might not make logical sense to readers.

  5. h2orange
    Member
    Posted 8 years ago #

    I'm running K2. Does that make a difference? Every time I make a switch, all that remains is my header... I imagine I must delete something to balance the addition of the_date, but having a tough time finding what to get rid of...

  6. FruitFly
    Member
    Posted 8 years ago #

    I've never tinkered with K2 before, so I just did. :)

    Putting <?php the_date(); ?> JUST after

    if (is_single()) include (TEMPLATEPATH . '/navigation.php');
    ?>

    seems to work. Of course, to style it, you're going to need to wrap it in a tag to style... so you can make it <div class="thedate"><?php the_date(); ?></div> and then add a div.thedate style to your style.css.

  7. h2orange
    Member
    Posted 8 years ago #

    Thanks for all your help.

    So I've just tried this, and the result leads me to believe that something else is to blame, as I've gotten the same tired old result... Only my header loads.

    Any idea why? This has apparently worked for you, but all that I get is a header adding the code anywhere...

  8. FruitFly
    Member
    Posted 8 years ago #

    Honest truth? I'd have to see your site, and likely have to see your templates to really have a running start. As that's kind of hard to do, here's some things you can try.

    I'm guessing you've made other edits to theloop.php - backup your edited copy, then grab a fresh copy of the default that comes with the theme, try just the_date... if that works, then there's some other edit you've made that's conflicting. From there, you can start making the edits again on the new copy, or you can just try to figure out where the conflict is between the two files.

    If that doesn't solve it, my next guess would be a plugin that you've installed that doesn't like it... try deactivating your plugins and one by one activate them again.

    After that... well, I'm stumped.

  9. h2orange
    Member
    Posted 8 years ago #

    Great logic... So it works with you WITHOUT removing any other code? Hmmm... it must be a plugin as it still doesn't work woth the fresh copy.

    The domain is LessPopular.com, but I'm using the registered only plugin at present.

    I'll look at the plugins...

  10. FruitFly
    Member
    Posted 8 years ago #

    Yeah, I didn't remove anything from the base theloop.php, just added in the_date tag. Worked fine for me, but I don't have any plugins installed on my test environment either.

  11. h2orange
    Member
    Posted 8 years ago #

    Alright, so I was finally able to get this to work. I really owe you a big thanks, FruitFly, as you were as persistant as a fruitfly in helping me through this. I had to do a bit more than you to accompplish this, however.

    1. I cut "else" text from the Dunstan's Time Since plugin line. Cut "else" as well as the text the follows including "the_time."

    2. Place the_date in it's own div on the line below
    <div id="post-<?php the_ID(); ?>" class="item entry">

    Done deal.

  12. FruitFly
    Member
    Posted 8 years ago #

    Glad to know you've got it working... and what can I say? I'm stubborn. :)

  13. h2orange
    Member
    Posted 8 years ago #

    hehehehe... thanks so much.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags