• Resolved Rolf Hassel

    (@samwan)


    I’m using WordPress as a classifieds website where people can post their ads. I would like to highlight the latest ads (posts). For example the latest ads (postings) in the past 24 hours or the latest in the past 7 days etc.

    I know what i want to set in the css, but i dont know how the php code would be. Can someone give an example on this?

    I’m using the following code to highlight featured ads (sticky post):

    <?php if(is_sticky($post_ID) == true) echo ‘<span class=”featured”></span>’; else echo ”; ?>

    Now i need something like that for the post of the last 7 days and the last 24 hours.

    Best Regards Rolf

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php code for latest posts’ is closed to new replies.