I need a code added to a code for wordpress

Discussion in 'Programming' started by Sami4u, Oct 17, 2009.

  1. #1
    Hi,

    I need help with a code Please.

    This is the code I have only problem is if I make no posts that day ft page is blank.

    <?php 
    $today = getdate();
    query_posts('year=' .$today["year"] .'&monthnum=' .$today["mon"] .'&day=' .$today["mday"] );
    ?>
    Code (markup):
    I would like the this added to the code.

    count number of posts today
    if posts >= 1 then
    display today's posts
    else
    display latest 2 posts

    Thanks in advance

    Butterflies Forever

    Sami
     
    Sami4u, Oct 17, 2009 IP
  2. epikpoker

    epikpoker Well-Known Member

    Messages:
    213
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    116
    #2
    Try checking here - http://codex.wordpress.org/The_Loop

    I think you need a "have_posts" call in there to check.
     
    epikpoker, Oct 17, 2009 IP
  3. Sami4u

    Sami4u Guest

    Messages:
    559
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,

    I'm not a coder all of this stuff is greek to me. Just hoping someone might me able to tell me it.

    Butterflies Forever

    Sami
     
    Sami4u, Oct 17, 2009 IP
    bogart likes this.