In addition to my previous answer add following code. It should work fine
add_filter( 'views_edit-books', 'add_filter_link' );
function add_filter_link( array $views ) {
$url = add_query_arg( array('bfilter'=>'parents','post_parent'=>0,'post_type'=>'books'), 'edit.php' );
$views[ 'post_parent' ] = sprintf(
'<a href="%1$s"%2$s>%3$s</a>',
esc_url( $url ),
( is_filter_active() ) ? ' class="current" aria-current="page"' : '',
'Post Parents'
);
return $views;
}
function is_filter_active() {
return (filter_input( INPUT_GET, 'bfilter' ) ==='parents');
}
if you already not used bellow code then add that too
function make_post_parent_public_qv() {
global $pagenow;
if ( is_admin() && $pagenow == 'edit.php' )
$GLOBALS['wp']->add_query_var( 'post_parent' );
}
add_action( 'init', 'make_post_parent_public_qv' );
Related Posts:
- Genesis filterable portfolio isotope [closed]
- How can I made custom taxonomies relationship?
- Filter in Custom post type to find the parent post
- Custom Post Type Loop within Shortcode
- Fetch taxonomies by custom post type id array
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- Filter by custom taxonomy slug on a custom post type
- wpdb custom post_type problem
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Display CPT posts based on specific taxonomy
- Setting proper query for multiple custom admin filters
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- shortcode to show custom post types by category
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- wp_query check if integer exists in custom field’s array
- convert custom query to wp_query
- Wrong request query on cpt and tax
- How can I see a list of my Custom Post Types of the last term I was in?
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Filtering WP_Query
- Search / Filter posts on Title/Content OR Tags
- using $wpdb to get custom post type with term
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Custom-Posttype & Custom Taxonomy WP_Query
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Displaying custom taxonomy in the admin list of a custom post type
- Converting the_content string to an array?
- Categories of custom taxonomy don’t show any posts
- WordPress sort search results by custom order
- How to filter wp_list_categories output with some custom post type meta query?
- How to Filter custom post type by taxonomy?
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Filter term taxonomy metabox in custom post type
- creat filter with wp_query
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Custom WP Query on custom meta and sort by multiple meta keys value
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- What’s the WP way to load remaining custom posts?
- Custom taxonomies relationship
- Sort and filter custom post type posts by custom taxonomy
- How to have this permalink structure: post_type/postname/custom_inner_page
- Query Custom Post Type Taxonomy term with multiple parameters
- Get terms that contain posts that in turn belong to other terms?
- First custom field value (out of several) displayed twice after query
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- Filter Posts from the Main Query
- WP_Query orderby and tax_query
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- Retrieve custom post types by custom taxonomies with WP_Query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Can I display custom post types in home.php or need page template?
- How to make WP_Query not to show irrelevant posts?
- WordPress wp_query() basic question about args
- Create an archive page for custom post type with custom taxonomy
- Using page slug in wp_query
- WP_Query() with custom post type and taxonomy — get all terms?
- WPDB for post count on post
- Custom taxonomy wp_query woes.
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Creating two loops based on different logic
- Filter posts by tax (dropdown) and meta value
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- WP_Query parameter conflict
- how to get this tax_query working?
- WP Query tax_query not returning posts
- Create a custom wp_query from a specific custom post type with specific taxonomy
- The most recent post of custom taxonomy
- How to use costum database table for custom post type
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Problems with the WP_Query query for a Custom post type
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Display all Custom taxonomy terms and their relevant custom posts
- Get posts of an specific term of a custom taxonomy
- Query pulling all taxonomies, not one I am specifying
- Creating adminable dynamic filtering on custom post type
- Checking Taxonomy Terms for a Custom Post Type With get_the_terms Not Working
- CPT Efficient way to display posts from different categories with custom query
- Get archive of posts separated by taxonomies and subtaxonomies
- Query Pulling the same post twice
- Dropdown switching subcategories portfolio
- Custom post type and custom taxonomies display
- WP_Query for CPT with filter by another WP_Query
- Get posts associated with custom taxonomy alternate way
- How to pass taxonomy terms to WP_Query along with $args?
- WordPress custom post type