kisukedeath

Wp Query - get posts arguments

Jul 13th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.17 KB | None | 0 0
  1. $query = new WP_Query(array('post_type' => 'page'));
  2. $posts = $query->get_posts();
  3.  
  4. foreach($posts as $post) {
  5.     // Do your stuff, e.g.
  6.     // echo $post->post_name;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment