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?
- How to get URL of current page displayed?
- What is This esc_html_e() i wordpress php?
- Display only text to WordPress loop without loosing the text formatting
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- Looping through WP_Post Object
- WordPress loop specific thumbnail size
- get understrap pagination to work with custom query
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Displaying Only Certain Tags in Loop
- How to exclude specific category from the get_the_category(); array
- Way to display “Yesterday”, “Today”
- How can i display post loop in table format?
- multiple if statements [closed]
- How to select WooCommerce products by post_meta and order them
- have_posts() execution failure
- How does the ternary operator work in the wordpress loop post?
- Cannot display or echo alt text on featured image
- Using Advanced Custom Fields to create a per page slider
- WordPress Search Results for Multiple Post Types
- Using loop pagination on single.php
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- Child page menu in sidebar
- Display category name only once inside loop
- Can’t find infinite loop cause
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Widgets in the loop if active
- 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
- Why my loop isn’t working? [closed]
- Only show first image in foreach 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
- 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
- Custom Taxonomy Link Text Echo Name Not Slug
- 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
- Implement “No related posts for this entry” into the loop?
- 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 exclude the current post from the upcoming post query
- How do I display WooCommerce products in my query to rows of 3?
- When a foreach loop is used multiple times in blocks, is there a way to ensure a variable always has a unique value?
- Custom theme on multisite has issues with standard loop output
- How to get the post title inside a custom block in a loop? block.js
- How do I use fields => ids in an array with WP Query?