Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // home / about - arguments ##
- $args = array (
- 'post_type' => array( 'post', 'page' ), // select from a range or post types
- 'tax_query' => array(
- 'relation' => 'OR',
- array(
- 'taxonomy' => 'post_tag',
- 'field' => 'slug',
- 'terms' => 'about' // this determines the slug of the term to use !! ##
- ),
- // add a second taxonomy to the selection ##
- array(
- 'taxonomy' => 'page_tag',
- 'field' => 'slug',
- 'terms' => 'about'
- )
- ),
- 'orderby' => 'modified', // order by latest modified ##
- 'order' => 'DESC',
- 'posts_per_page' => 1, // only get one result - the latest edited ##
- );
- // pass arguments to wp_query and return an object to the variable $about ##
- $about = new WP_Query( $args );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement