Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- 'p' => 1234,
- 'post_type' => 'any',
- 'post_status' => 'any'
- );
- $query = new WP_Query( $args );
- while ( $query->have_posts() ) : $query->the_post();
- // display the post
- endwhile;
- wp_reset_postdata();
- $args = array(
- 'labels' => $labels,
- 'description' => '',
- 'public' => true,
- 'publicly_queryable' => true,
- 'exclude_from_search' => false,
- 'show_ui' => true,
- 'menu_position' => 60,
- 'menu_icon' => null,
- 'capability_type' => post,
- 'hierarchical' => false,
- 'supports' => array('title', 'editor', 'author', 'excerpt', 'trackbacks', 'custom-fields', 'revisions'),
- 'rewrite' => true,
- 'query_var' => true,
- 'can_export' => true,
- 'show_in_nav_menus' => true,
- );
- register_post_type('chart', $args);
- $args = array(
- 'p' => 1234,
- 'post_type' => 'any',
- 'post_status' => array('draft')
- );
- $args = array(
- 'p' => 1234,
- 'post_type' => 'any',
- 'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash')
- );
- $query = new WP_Query();
- $posts = $query->query( $args );
- $args = array(
- 'post__in' => array( 123 ),
- 'post_type' => 'any',
- 'post_status' => 'any',
- );
- $query = new WP_Query( $args );
- // ... etc.
Add Comment
Please, Sign In to add comment