Forums

Display posts related at current date (3 posts)

  1. 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?

  2. nsathees
    Member
    Posted 8 months ago #

    Here are the arguments that can be passed
    http://codex.wordpress.org/Template_Tags/get_posts

    monthnum is not there!

  3. alchymyth
    The Sweeper
    Posted 8 months ago #

    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

Reply

You must log in to post.

About this Topic

Tags