Answer from an older PHP noob:
<?php
$pages = get_pages('child_of=1015&sort_column=post_title');
$count = 0;
if (!empty($pages)) {
foreach($pages as $page) {
// show stuff
} // end foreach
} else {
echo '<p>There’s no content here. Check back later.</p>';
}
?>
Related Posts:
- How to hide all child pages with post_query?
- Display child page content of a specific parent on home page
- Trying to display ads on only a third of posts in a loop. Keep getting Error 500?
- Getting only direct child pages in WordPress with get_pages
- Query multiple custom post types in single loop
- Knowing the total number of posts before to get into the loop
- Build a content and excerpt grid loop with paging and options for # of posts
- Installing wp3.2.1 on IIS; getting empty sessions
- How to loop over custom fields in a page template?
- Alter secondary loop to exclude posts from current page category
- Specific Loop For 2 Within Each
- Woocommerce, recognize the loop of related products
- Store loop into array
- Looping through WP_Post Object
- Output 2 items within the Loop
- Show Custom Taxonomy Title
- How to exclude specific category from the get_the_category(); array
- spliting posts into two columns
- How to speed up a wordpress function with multiple loops?
- How can I add pagination and how can I change thumbnail size?
- How to Display a Single Post Excerpt
- $wpdb->flush(); breaks the loop
- APC 500 Internal server error [closed]
- Use object in template part
- Get first URL from post content
- How do I list the child of a child page [duplicate]
- Changing layout with wp_customise
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Iterate through posts based on array of categories
- get author_name from queried post
- How to add condition in wordpress loop? [closed]
- Alert Bar section within WP loop is displaying even though there are no posts
- Load wordpress content in other domain
- Widgets in the loop if active
- Plugin PHP file gives error 500 [closed]
- How to get post ID in a Page?
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Echo a shortcode div after every 3 posts
- How to avoid duplicates when creating recent network posts
- variable value disappears in a second loop
- get_the_ID() in the footer returns wrong value
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Why my loop isn’t working? [closed]
- Only show first image in foreach loop
- How to get current post category details inside “loop”?
- How to pass current loop data into nested loop
- Get all posts as an array ID => Name
- How to get post ID from button and pass title to Modal
- WP_Query multiple post results
- Convert Featured products loop into Recent products loop?
- Wpdb get->results to out the the month from the db
- Do not duplicate posts with multiple categories in multiple loops
- Infinite Loop – WP_Query
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- WordPress loop is not working
- How to create Loop code for Menu using WordPress?
- Problem in replacing the_content with the_excerpt()
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- How to Add a cutsom slug to my custom author role
- Give ID to divs inside the loop
- Pagination contents not changing in Front page WordPress
- How to output the taxonomies that are assigned to each custom post?
- Display all categories including sub categories under a list ul
- Where does php code to load data go?
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Custom Loop.php having a loop inside a loop
- Latest posts feed with a specific post always first
- How to output values from a loop into a javascript array
- Child and Parent Pages list of sub pages
- Exclude category and post from loop in custom category.php
- Making list of posts with chosen description
- How fix error in the WordPress loop?
- what’s the syntax for if the image exists get the image?
- Add div after every 4 posts then every 2 posts for a responsive loop
- how to remove replicating a tag inside loop?
- My query keeps looping infinitely ! how to stop it?
- Efficient way of querying for a “fallback” post?
- PHP: Why does my code work in index.php but not a widget?
- Loop 1 user randomly
- Create a hierarchical loop at predefined markup requirements
- enumerating custom taxonomies?
- PHP Shortcode – 500 error
- Problems With Query and/or Template Part and/or PHP
- Two loops in one function
- How to display thumbnail if post is assigned one otherwise not
- Pagenav Not appearing on custom Template
- Error trying import one category on page
- the_post_thumbnail unless video id is added
- Remove the_content From Loop
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- Pagination in category.php not functioning
- For each loop will not append to the_content hook
- How to handle parent and child pages?
- How do I remove blog entries from home page Twenty Eleven child theme?
- How to create a loop that will display one post and stop?
- Pagination not working properly
- How do I display WooCommerce products in my query to rows of 3?