Advertisement
kkarpieszuk

QA: query for not translated CPT

Jun 23rd, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <div style="margin: 200px; z-index: 100; background: yellow; position: relative">
  2.             <?php
  3.             $myp = new WP_Query( array(
  4.                             'post_type' => 'not-translated',
  5.                             'name' => 'test post'
  6.                     )
  7.                             );
  8.            
  9.             if ( $myp->have_posts() ) {
  10.                 echo '<ul>';
  11.                 while ( $myp->have_posts() ) {
  12.                     $myp->the_post();
  13.                     echo '<li>' . get_the_title() . '</li>';
  14.                 }
  15.                 echo '</ul>';
  16.             } else {
  17.                 echo 'no posts';
  18.             }
  19.             ?>
  20.  
  21.         </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement