qlstudio

4 Trees - Tag Based Management Example

Nov 18th, 2012
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // home / about - arguments ##
  2. $args = array (
  3.     'post_type' => array( 'post', 'page' ), // select from a range or post types
  4.     'tax_query' => array(
  5.         'relation' => 'OR',
  6.         array(
  7.             'taxonomy' => 'post_tag',
  8.             'field' => 'slug',
  9.             'terms' => 'about' // this determines the slug of the term to use !! ##
  10.         ),
  11.         // add a second taxonomy to the selection ##
  12.         array(
  13.             'taxonomy' => 'page_tag',
  14.             'field' => 'slug',
  15.             'terms' => 'about'
  16.         )
  17.     ),
  18.     'orderby' => 'modified', // order by latest modified ##
  19.     'order' => 'DESC',
  20.     'posts_per_page' => 1, // only get one result - the latest edited ##
  21. );
  22.  
  23. // pass arguments to wp_query and return an object to the variable $about ##
  24. $about = new WP_Query( $args );
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×