How to get list of pages or pages loop in wordpress

How to get list of pages or pages loop in wordpress.

Below is the code you can use to get list of wordpress pages loop using the specific parameters.

 

<?php

$child_pages = new WP_Query(
array(
‘posts_per_page’ => 100,
‘post_parent’ => 10,
‘post_type’ => ‘page’
)
);

while ($child_pages->have_posts()) { $child_pages->the_post();
echo “<br>”;

echo “<a href='”.get_permalink().”‘>”.get_the_title().”</a>”;
//get_permalink();

echo “<hr>”;
}

wp_reset_query();

?>

 

Please watch the video to better understand.

Leave a Comment