• Resolved lsshock

    (@lsshock)


    Hi everyone, im in some dire need of assistance with achieving the following:

    On my main index i have a list of movies (thumbnails)
    I’m using query() to show and split them into rows and sort by date modified.

    Now i’d like to use my custom field which contains the date the movie will be in theaters (inTheaters) to sort the list.
    Sort if by modified date (show newest ones first) but don’t show any movies that are in in theaters right now.

    Thank in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lsshock

    (@lsshock)

    the start i’v made is

    $args = array(
    	'post_type' => 'post',
    	'showposts' => '18',
    	'orderby' => 'modified',
    	'meta_query' => array(
    		array(
    			'key' => 'inTheaters',
    			'value' => date('Y-m-d'),
    			'type' => 'DATE',
    			'compare' => '>='
    		)
    	)
     );
    $my_query = new WP_Query();
    $my_query->query( $args );

    to clarify my question, im sorting by modified date and dont want to show posts which are before the current date (based on the custom field)

    Thread Starter lsshock

    (@lsshock)

    the above works, the problem was my post date’s

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter by modified date and custom field’ is closed to new replies.