According to what I read it is because of an odd implementation of that function, apparently the number is used to add a Limit statement to the SQL that is used to get the pages. Then it applies the child_of requirement after retrieving the data from the database. So if you limit the query to 3 chances are you will not get any results that are also a child_of your page.
Instead leave the number parameter off and do the limit in your foreach block. Ie increment a variable and if it is greater than your limit, exit the for loop.
Related Posts:
- ssl_error_rx_record_too_long and Apache SSL [closed]
- Environment variable to control java.io.tmpdir?
- What is spark.driver.maxResultSize?
- Add robots.txt to root
- Using wp-uploads instead of wp-content/uploads
- Cannot get pages or posts to display
- how do I disable new user registration email for specific admin user?
- Disable WordPress Redirect From terminal
- Move wordpress files to sub-folder
- How do you set the default page in WordPress?
- www.website.com works but website.com redirects to website.com/index.html
- Copy wordpress settings to another blog
- Where do I add my own configuration needs and how do I access them?
- how to server over http and https with one installation
- command for checking Apache configuration
- Not able to access wordpress website publicly installed on azure VM having apache server as xampp
- Reading settings from app.config or web.config in .NET
- How to import a module given the full path?
- Encrypt Password in Configuration Files?
- Encrypt Password in Configuration Files?
- How to solve the error “SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.” in IE
- How to set NotebookApp.iopub_data_rate_limit and others NotebookApp settings in JupyterHub?
- Is it possible to get a page link from its slug?
- Add infinite scroll to content splitted post
- Check if wp-login is current page
- How to get current page ID outside the loop?
- Sending the reset password link programatically
- Contact Form on WordPress Sites?
- Page returns 404 with POST variables, but not without
- Determine if page is the Posts Page
- Custom templates not showing up in template dropdown
- Hook for post and page load
- Getting only direct child pages in WordPress with get_pages
- Get page id by template
- Page template query with WP_Query
- Get the Current Page Number
- Using pre_get_posts on true pages and static front pages
- Get the content of a specific page (by ID)
- How to get page title with the page ID?
- Show more than 20 items in pages or posts edit dashboard
- Allowing user to edit only certain pages
- Pass PHP variable to javascript
- Get page content using slug
- How to display last 3 posts (recent posts) in a static page?
- wp_nav_menu: show menu only if one exists, otherwise show nothing
- How to display page content in a page template?
- How to give paged links custom title?
- How to set post slug when using wp_insert_post();?
- Integrating a custom post type into a page hierarchy
- Why isn’t is_page working when I put it in the functions.php file?
- How to enable custom fields for pages (if not a bad practice)?
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- How can I keep the content of my pages version controlled?
- How to load javascript on custom page template?
- How to check if I’m on the last page of posts?
- How to configure WordPress to handle 75,000 pages?
- How to update page status from publish to draft and draft to publish
- Check if is on child-page of a particular page
- Change page template programmatically ?
- Stop WP from creating “Sample Page” and “Hello World!” post
- Conditional tag to check if ‘page.php’ is being used?
- How to intercept already localized scripts
- Keyboard shortcut for updating a page or post?
- Customizing the URLs of WordPress Login and Sign-up Pages?
- Control verbosity level of WP DEBUG?
- Apply the_title() filter in post & page title, but not in menu title
- Get the ID of the page a menu item links to?
- How to disable posts and use pages only
- Searching multiple custom post types and pages
- featured image as background image on pages
- Check IF is a “single product page” and Check the “role” for a Redirect
- How can I debug the TTFB in WP?
- A check for if is parent page, if has children, if has grandchildren
- How to display by default only published posts/pages in the admin area?
- Change the_title() of a page dynamically
- Get current menu_order
- Difference between an archive and a page listing posts
- Delete Associated Media Upon Page Deletion
- Is there a way (plugin?) to restrict a user to being able to edit just one page?
- Multisite Network Port Num Issues?
- How to load JS and CSS only on specific Pages using is_page()?
- Listing pages which uses specific template [duplicate]
- A way to automatically install pages on theme install?
- Improve wordpress security by hiding non public resources
- Proper way to get page content
- Disable Attachment Pages Completely
- Access the same page from multiple urls (wildcard)
- Create a page without adding a page in the Database
- The next_posts_link() works only with original $wp_query
- Get content from one page and show it on another page
- Individual Widgets per Page
- How can I reverse engineer a Permalink to Find the Page?
- Is there a way to change the default page template selection?
- How to Check if a Page Exists by URL?
- Can I have two child pages of different parents with the same name?
- What methods to use to create small, editable pieces of text for static pages?
- How to add a .php file to WordPress
- How can I get the title attribute from get_the_post_thumbnail()?
- Show Default Editor on Blog Page ( Administration Panel )
- How to Remove all Instances of edit_post_link