Advertisement
wardhanarizaldi

WP CPT display custom query

Jan 19th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1.    <!-- Display custom query CPT -->
  2.  
  3.             <h2>Menu Unggulan</h2>
  4.             <?php
  5.             $homepageMenus = new WP_Query(array(
  6.                 'post_type' => 'menu',
  7.                 'tax_query' => array(
  8.                     array (
  9.                         'taxonomy' => 'sajian',
  10.                         'field' => 'slug',
  11.                         'terms' => 'unggulan',
  12.                     )
  13.                 ),
  14.             ));
  15.              while($homepageMenus->have_posts()) {
  16.                  $homepageMenus->the_post(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement