• Hey everyone,

    Trying to put in a tiny bit of code to the right of the date display on my site, so that’ll it will have the DATE and then a little piece of text saying ‘X posts so far today’ where X is a count of the posts for that day.

    So eg. it would say September 10th 2006 – 5 posts so far today

    I’m just going around in circles trying to get the syntax right, any help appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter tcal

    (@tcal)

    SELECT COUNT(*) FROM wp_posts where post_date = CURRENT_DATE()

    if i can get that query to work i can do it. But my MySQL is very week, trying to work out how i can get the post_date or post_date_gmt to equal a MYSQL variable for todays date.

    Any help appreciated!

    For displaying the date, just use this:
    <?php the_time('F jS, Y') ?>

    For the other one, I think there is a plugin for it? Let me look once..

    spencerp

    By the way.. take a look at my blog once.. I got the date code from there. 😉

    Thread Starter tcal

    (@tcal)

    yep, I know the code for the date thanks.

    But I still can’t get this ‘X posts so far today’ to work.

    It should be just a case of running a SQL query where it shows all published posts from wp_posts where the date = the day passed in from the loop.

    I’ve searched for a plugin but can’t find any.

    Any help appreciated!

    jwurster, you’re just as awesome as I am! Thanks! =)

    spencerp

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘display count of posts on a day’ is closed to new replies.