Call all pages, Post_type values: page corresponding pages, post corresponding article
<?PHP$args=Array( ' Post_type ' = ' page ' );$the _query=NewWp_query ($args );//The Loopif($the _query-have_posts ()) { Echo' <ul> '; while($the _query-have_posts ()) { $the _query-The_post (); Echo' <li> '. Get_the_title (). ' </li> '; } Echo' </ul> ';} Else { //no posts found}/*Restore original Post Data*/Wp_reset_postdata ();?>
To invoke the multi-ID content, modify the parameter to:
$args=array(' post_type ' = ' page ',' page_id=2,86 ');
Invokes the specified ID content and modifies the parameter to:
$args=array' post_type ' = ' page ',' page_id ' =>2);
To know how to invoke other content within a loop, see:
WordPress Theme Creation Tutorial 6: Common Template Tags
View Wp_query documentation for WordPress
WordPress Theme Maker Tutorial 5: Looping