WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?

Your code is invalid (syntax error, missing closing array and semi-colon), and incorrectly nested – if you were to properly indent your code, you’d have something like: $args = array( ‘tag’ => ‘tag-AAA,tag-BBB’, array ( ‘orderby’ => array( ‘title’ => ‘ASC’, ‘post_date’ => ‘DESC’, ) ), ); See how orderby isn’t actually a property of … Read more

Exclude page from loop results

You need the WP_Query documentation. WP_Query is very powerful, and you can do a lot with it 🙂 In your case, I don’t think exclude is a valid parameter. What you’re probably looking for is this: $query->set( ‘post__not_in’, array( 34 ) ); Here’s the Post & Page Parameters section of the documentation, which covers this … Read more

Display Featured Posts Grid on Static Page (Gazette)

Bingo. I added the featured content template (as originally and later suggested by @user53340) to the page.php with a condition so the featured grid would only display on the page I designate. Add to page.php if ( is_page(ID) ) { // Include the featured content template. get_template_part( ‘featured-content’ ); } After changing the front page … Read more

WPQuery calling specific posts problem

If you don’t specify the order and orderby arguments with your query, the results will be ordered ascending by date, no matter what order you put the pages in with post__in. If you have an order in mind that isn’t covered by one of the regular orderby arguments, you’ll have to define a metavalue on … Read more