Historically I’ve had better luck using get_posts()
over get_pages()
. Especially in the case of a custom post type, I’d recommend using something like
$args = array(
'post_type' => 'home_section',
);
$hp_sections = get_posts( $args );
instead of using get_pages()
.
Reference
Related Posts:
- Hook for post and page load
- Integrating a custom post type into a page hierarchy
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- Searching multiple custom post types and pages
- Return current page type
- Custom Post Type as Page parent
- How to add a post from a custom post type as the static page?
- Get page by template?
- TV Show database – Best way for structuring it?
- Is there a way to make a custom Page type?
- Menu position (admin menu) of pages
- How to Add Pages Under Custom Post Type URL Structure?
- Custom Posts on Different Pages
- Pagination with custom loop
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- How to create user personal pages with information from their meta profile fields?
- Exclude Custom Post Type & Pages From Auto-Tag Function
- Custom Post Type Name Causing Problem
- wp_list_pages doesn’t work in hierarchical custom post type
- Making pages also serve as taxonomies? Or give full pages to taxonomies?
- Share parent path between Custom Post Types and Pages?
- Check if admin is editing page or custom post type
- remove child post from custom post type archive
- Pull in custom content types into page template
- custom posts on different page
- Trying to edit the single page from a Custom Post
- How do I fix permalinks for custom post types that has the same slug as a page?
- Create custom PAGE with register_post_type
- Should I use custom taxonomy or custom post type
- Disable featured image
- Making a custom help center page
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- create a template page for a post
- Page vs Custom Post Types Differences/Issues
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Exclude pages in archives results
- Make parts of your wordpress website completely built with data from external APIs?
- Trouble with CPT Child 404
- Database to page routing API?
- Assign same parrent Page to pages AND custom post types
- Allow Static Page Load Dynamic Child Pages
- Static page determines as home, but it is not
- How to use Custom Page Templates for hierarchical Custom Post Type
- Top Level pages in wordpress giving 404, but child pages working fine
- Page for custom post type
- Why does not this wp_redirect work in is_single()?
- Pros and cons of a custom page vs custom post type template file
- How to include custom post type posts on a page?
- the_content(); of custom post type treated as an array or object
- Multiple pages per post (not pagination)
- Can I change my post type to anything and my site still work?
- Page listing Custom Posts
- Display an authors post on a single page only when they are logged in
- Why are some of my custom posts not showing up on my page?
- Merge page with custom post type
- Conflict between wp_list_pages and get_posts – list pages not displaying
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- URL Rewrite – Page Archive
- Render a Post or Page using the correct file
- Under What Conditions Can I name my CPT the same as my CPT Page?
- custom post creation on front page – on submit a search is done
- Am I mixing up the concept of posts pages and categories?
- How to setup different permlalinks for posts and pages?
- Sets post_parent in custom post type posts automatically based on cpt->page name
- Tag template not returning posts [closed]
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How to set a ‘page’ as parent of a custom post type?
- Add custom template ‘sub-page’ to Custom Post type?
- How to use posts as tabs in a custom page?
- Custom Post Type Single Page and Archive Page redirects to Home Page
- How to stop a permalink redirecting to a page whit same slug but different permalink
- Disable Sidebar on certain pages
- Cannot save pages after migration
- Displaying posts inside table having issues
- Show posts from custom post type sorted by category/taxonomy on a one-pager/page
- How to make “single post” permalink maintain it’s sub-page structure
- How to manage a custom post type archive as a page?
- How to manage a custom post type archive as a page?
- Include images from pages in wp search.php results in default wp search
- WordPress Contents Migration
- Creating Slider in wordpress theme with custom post
- How can I make my CPT read from page-*post-type*.php?
- One Post with different content, depending on a Page
- Cannot use pages created on WP
- Use the page picker from wordpress menu creation page
- Different post types arranged on one page
- How to display data with pagaination on backend?
- archive.php can’t find categorized posts
- Pulling Content from Existing Database
- Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?
- Excerpt for each post type and for is_front_page
- Programmatically Split A Post Into Multiple Pages
- query_post while (have post) get_template_part()?
- “regular” pages not found after changing permalink
- Using custom post types within a section of a template
- How to store queried custom data and use it in multiple pages?
- Highlight specific menu item when custom post is page
- How do I hide single category post on my post page
- How to add a regular page under a custom post type?
- An script/Plugin for automatic page creation per term