Advertisement
Guest User

WP custom taxonomy custom post type loop.

a guest
Jan 17th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. $args = array(
  2. 'post_type' => 'wineinput_custom',
  3. 'meta_key' => 'wine',
  4. 'showposts' => -1,
  5. 'tax_query' => array(
  6.     array(
  7.     'taxonomy' => 'categories',
  8.     'terms' => $subcategory3->term_id,
  9.     'field' => 'term_id'
  10.         )
  11.     ),
  12.     );
  13.     add_filter( 'posts_orderby', 'orderby_custom_fields' );
  14.     query_posts($args);
  15.    
  16.  
  17.         while ( have_posts() ) : the_post();
  18.  
  19.  echo '<li ">
  20.       <a class="wine-name-style" style="padding-top: 0px; padding-bottom: 0px;" id="inline" href="#">';
  21.       echo get_post_meta($post->ID, 'wine', true);
  22. echo '</a>';
  23. echo '</li>';
  24. endwhile;
  25. wp_reset_query();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement