wp_list_pages
will only output hierarchical post types. If we look at the function in source, we’ll see that it calls get_pages
to load pages for output. If we look at get_pages
function in source, we’ll see:
// Make sure the post type is hierarchical
$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
if ( !in_array( $post_type, $hierarchical_post_types ) )
return false;
The default post
post type is not hierarchical, so the function outputs nothing. If your event
post type is also not hierarchical then that would explain why it also outputs nothing.
Related Posts:
- Search query -> Show all pages except certain template
- How can I create a meta_query with an array as meta_field?
- Query multiple meta key values?
- Differences between wpdb->get_results() and wpdb->query()
- Reversing the order of posts AFTER the query is performed
- what are the numbers between curly brackets in search query
- Using WordPress public query variables
- wpdb get posts by taxonomy SQL
- How to List Events by Year and Month Using Advanced Custom Fields?
- Is there any difference between hooks posts_where with posts_join and posts_search performance wise?
- Remove [gallery] shortcode altogether
- Get a user’s most recent post title
- add_query_arg() XSS Vulnerability
- $query->query_var[‘post_type’] not set for pages
- Different Main Navigation per category
- Show recent products first but “sold out last” in query
- Show All Posts Insert Edit Link
- Get IDs of posts currently visible on archive
- Get posts by category with pure SQL query
- can’t get query to order posts by acf datepicker
- Custom query to get terms from post ids
- Help with wordpress custom query and advanced custom fields plugin
- WordPress query by category, sorted by custom field
- Mysql / WordPress killing my server with 80k users [closed]
- Query all posts and not repeat the same tag
- Deleting data from a custom table in WordPress
- How to echo excerpts with wp_list_pages?
- How many queries are normal to execute on a WP site?
- How to optimize my query filtering out unwanted data?
- Remove posts from query for events whose start date has passed
- Insert static element only once in query archive
- How to run a mysql query when admin updates user role?
- Error when using setup_postdata()
- pre_get_posts : ‘post__not_in’ doesn’t work with global variable
- Getting post data from private page
- Missing posts in a query
- Alter a specific query on WordPress
- Query reset problem or flawed code to enable custom post type query
- SQL query to select posts from multiple categories
- Why a URL with a query is always slower than that without a query?
- Maintaining Queries in URL
- Protect sequence of pages with same password for each of two groups of users
- How is it possible to get top comment from all children?
- Select Query demand excesive resources [closed]
- Create Indexes for Slow Queries
- Query to get number of posts last week
- MySql Query very slow
- wpdb query problem to access previous 3 days posts
- I want to create a filter for the query string is this possible?
- Exclude categories from the_category();
- How can i show all categories using wp query?
- All in One Calendar Plugin Custom Post Type Query [closed]
- Get Posts from Last 24 hours and Sort them via GD Star Rating
- Query returning same results even though the ID changes
- How to get events using multiple custom meta fields?
- Get posts from category with custom query
- Random Page Rewrite
- How to pull posts into two columns with different image sizes using $counter variable?
- WP_User_Query with more than two custom meta values
- Select column name dynamically mySQL Query
- how do i register global query in template
- WordPress Mysql query and Duplicate
- How to “orderby” the first array in a meta_query that uses multiply keys?
- Sort query_terms_list for post_tags alphabetically
- Target a page with query
- List only parent attributes on woocommerce admin atrributes page
- Order posts ascending from posts in array
- Display data from phpMyAdmin with WordPress
- Add rewrite rule for archive search
- custom sorting media with multiple filters – error: not unique table/alias: wp_postmeta
- How can I get posts by 2 meta keys, prioritising one of them?
- SQL query to list all posts of specific post type with a specific set of associated postmeta values as a column
- implementing my wp_query using $wpdb class
- Category_in return empty
- Query reversed when I use “category__not_in”
- modifying main query to query for ranges e.g. from 1999 to 2016
- How to reduce the load / no of queries on MySql Database
- Querying users by meta value and getting a strange answer
- Display result from custom post meta query
- Show certain number of post from tags
- Wpdb empty result only if language is Russian
- Display Upload Author & Get Uploaded Post ID
- Display list of most recent grandchild (third tier) pages
- How can I display a number to represent the order of post?
- Problem on wpdb queries, wp_insert_post, wp_insert_user etc. The query runs twice
- Sort order in get_posts [closed]
- Query unique author ids with published post of type job
- Sort loop with query in the link
- About WP’s save_post action
- $wpdb: how to use a query as a base for another query?
- Wpdb generates too many queries
- Multilingual WordPress page – using URL to determine language?
- list or get meta_key where meta_value is ‘something’
- Query posts alphabetically within this function
- Conditional Tag Custom Querys?
- WP_Query with checkbox meta_query – WordPress [duplicate]
- What is the best way to cache pages and queries in WordPress?
- WP Query outputs three items within a div
- Query filter on custom post by current author in post widget for elementor query id
- Querying Posts from ACF Repeater Subfield Select Value