Support

Account

Home Forums General Issues 'Daily Features' Posts by Date Reply To: 'Daily Features' Posts by Date

  • Hi @adammm

    This task can be spit up into a few tasks:

    1. Find today’s date. This can be done with the date function is PHP. Please research this first, but it will look something like this:

    
    $today = date('Ymd');
    

    2. Next step is to add the date field to the ‘feature’ post type. It seems like you have already done this. Make sure the save_format is ‘yymmdd’ This JS format will match the PHP format of Ymd

    3. Lastly, just add in a meta query into the query_posts parameters. Please research this, but it will look something like this:

    
    <?php query_posts( 'post_type=feature&posts_per_page=1&meta_key=date_field_name&meta_value=' . $today); ?>	
    

    Hope that helps