Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using a little handy trick to show the post-date only when the post is from another day by putting it outsite the post-area (but within the loop of course). The problem is, I styled it with a background and it looks well on the post with the date but not on the post without the date. How can I tell wordpress to show nothing when the "date is not givin".

Screenshot: http://d.pr/hY1G

Thanks!!!

share|improve this question
please post the code of that 'little handy trick' – Michael Aug 13 '11 at 10:34
pastebin.com/FZrwAjXc Heres the code. It just shows the date once per day. – juliusk Aug 13 '11 at 12:58
Close-voted as off-topic. This isn't a "bug"; rather, it's primarily a CSS question. – Chip Bennett Feb 29 '12 at 13:35

closed as too localized by toscho Jul 13 '12 at 19:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

If I understood your question, you can enclose the logic you provided with a check to see if the date has been set.

You can use:

if isset(the_date()) {
// display post-date
}

HTH

share|improve this answer
Still shows the boxes :-) davidgoltz.de/2011/blog-page – juliusk Aug 14 '11 at 8:27
You either need to pass false to the $echo parameter of the_date(), or else use the is_new_day() conditional, in order to parse your if condition properly. – Chip Bennett Nov 28 '11 at 20:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.