Display multiple custom post types and sort them chronological by one of their fields
There is no output for this sample code because the IF statement you used will never return true, since the string ‘post_type’ will never be equal to any other string but ‘post_type’. Use get_post_type(): if ( get_post_type() == ‘eventtype1’ ) { To order by a date custom field, you will need to use the same … Read more