You could also use wp_list_pages()
(Codex ref):
<?php
$has_pages = wp_list_pages( array( 'echo' => false ) );
if ( $has_pages ) {
// There are pages; do something
}
?>
Related Posts:
- Can I display submenus in groups, using wp_list_pages?
- A function like is_page() but returns true if on any sub page of given page
- Overriding the currently selected menu item
- Get all children page ID’s including parent by title
- How can I automatically add child pages to pages in a WP menu?
- Determine page content based on page parent
- Check if page has subpages
- wp_nav_menu: output featured image of each page listing
- Problems in creating a static site with WordPress
- Subpage Conditional
- How to create an user defined page?
- What is the difference between $paged and $page?
- Custom SQL Query for WordPress page
- Change admin startpage to Pages-page?
- How restrict page for users logged? [closed]
- Only allow new subpages to be created
- Hide Visibility Option From WordPress Publish Metabox
- How to highlight the current page in the nav menu?
- How to make nested page structure?
- Redirect to a page if ancestors is empty
- Get Order of Meta Box in a Page/Post
- Custom Menus, Widgets & Conditional Statements
- Modify Page Title before output via wp_page_list
- Getting post content within wp_nav_walker
- List Child Pages of Parent Parent Page (Child pages from Grand Parent)
- How to add meta boxes to Pages
- Missing parent page attribute
- Hiding Page by Title from Editing
- Two Search pages, One search form
- Why doesnt ONE of my links in the footer work properly? [closed]
- Create subpage – filter parent pages list
- Does loading of sub pages in menu cause load to the server?
- Use lots of pages, or categories/posts?
- How to have custom tinyMCE buttons break onto next line when too long
- Get page by its ID and display it on another one
- How do i change page template in bulk?
- Weird issue with is_pages() with array
- How to show the root webpage on all subpaths
- category slug and page slug same
- New user Registration data imported into Page
- Could be a namespace conflict (?) with login form and register form on the same page
- The concept of non-blog content
- Loading Multiple Comments Pages via Ajax?
- Change base URL of pages created by certain users
- Remove Content edit box from ALL pages (not posts)
- What is full URL for a post?
- How to list a page tree?
- How to create a page and display only the posts with a specific custom field value?
- Remove comment section from new page
- WordPress pages not working out correctly with HTML
- Change page name in admin list
- how avoid the link of the current post in the menu in the sidebar?
- Dynamic page with comments
- How to rewrite a page url
- Manage content on multiple pages synchronysly?
- Display pages in alphabetical order
- Print page content with formatting when doing custom SQL query
- get_page() – Only variables can be passed by reference
- Need Help with Custom ModRewrite
- How does wordpress link page templates to individual pages
- Is there a template tag/function for getting the URL (or slug or name or ID) of the blog page when using a “static” front page
- Creating new page/tab in groups section not working! [closed]
- Prompting for review / reapproval of page content
- Limit the amount of main pages
- Add separate list of pages under Admin
- remove “Edit” from select pages
- How to get the Page Name of the current page?
- Add custom action to the page listing screen
- How to list pages from an author?
- How can I order these pages in this navigation bar on this old wordpress theme?
- Cannot update page – with too many characters?
- Share a folder with files
- Using WP page password protection as defacto login
- Front Page post mirroring revisions to other pages, constantly updating itself
- Unable to remove page from primary menu
- Is it possible to embedd this web app to my website [duplicate]
- Using external DB within wordpress
- Microsoft Security Essentials is blocking my WordPress website in IE11
- Author information on all pages
- Pre-populating new Page creation with shortcodes
- Issue in If else condition [closed]
- WordPress Pages “allow comments” meta option can’t be checked
- Loading internal page
- Firing page_publish where page is child page
- Add role and edit page capabilities
- Google indexed pages for one page site
- WordPress, page 2 shows the same posts as page 1
- Parent for a single (single.php)
- Create a new page for each form selection
- pagination does not work with query_posts. Help! [duplicate]
- How can one get page by pagename if it is a child page?
- Archive with specific keyword by category sorted by date
- How to pass the Querystring in pages?
- I have over 3000 child pages – but I need a different main page
- Edit the text location of a form
- Split Page Links
- Ask for template when adding a new page
- How to view front-end of WordPress website, using Atom?
- Can’t create new pages in wordpress
- Custom template is not showing up in templates dropdown list after re-naming it