gafanhoto
Member
Posted 8 months ago #
Hello everyone,
I need display posts related at current date, for example:
Today: September, 15
-Random post published in September, 15.
I try this:
$d = getdate();
$q = new WP_Query( 'post_type=historia&posts_per_page=1&monthnum='.$d["mon"].'&day'. $d["mday"] );
But don't worked. Anyone can help me?
Here are the arguments that can be passed
http://codex.wordpress.org/Template_Tags/get_posts
monthnum is not there!
what does not work?
impossible to say from that short piece of code.
there has to be more code such as a loop to show the results of the query.
http://codex.wordpress.org/Class_Reference/WP_Query#Usage