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
- Saving Taxonomy Terms
- $wp_query->queried_object->ID throws warning: Undefined property
- The Operator “NOT IN” Does Not Work In tax_query
- How to get_queried_object on multiple objects?
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- How to get the parent’s taxonomy?
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- Querying Posts by Taxonomy From Alternate Network Site
- Help with hierarchical custom taxonomies and permalinks…almost there
- custom post type paging not working past page 3
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”
- Query for posts in 2 taxonomies
- Exclude current post when getting related post on custom post type and taxonomy
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- using custom taxonomies on non wp table?
- Paginated Taxonomy Term Archive including one post per term
- WP_Query search posts by custom post type and custom taxonomy
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- Is it possible to create a shortcode that will query a post based on taxonomies?
- wp_query to find posts by year and month
- Querying Term Posts in Loop
- Custom Post Type Loop within Shortcode
- 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
- Display CPT posts based on specific taxonomy
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Filtering WP_Query
- 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
- 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
- WordPress sort search results by custom order
- Filter term taxonomy metabox in custom post type
- Custom WP Query on custom meta and sort by multiple meta keys value
- Custom taxonomies relationship
- First custom field value (out of several) displayed twice after query
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- WP_Query orderby and tax_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
- WP_query – Filter by tax_query and meta_query using multiple select
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- how to get this tax_query working?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- REST filters only firing when I have a param set
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- How to get the post terms from a child taxonomy
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- tax_query (if the terms are empty)
- How to count other posts not having specific taxonomy terms?
- Exclude latest post from WP_Query taxonomy term loop
- Get posts by category name
- foreach loop inside the loop creating duplicates in output
- Custom Taxonomy Filter Issues
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Display featured posts for a custom post type by taxonomy
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- What is the most efficient way to execute recursive complex queries?
- conditional filter
- set object terms after some some time of published post – functions.php
- Sort custom posts by date and then by taxonomy
- have to do a while have post to show for two custom post types sharing the same taxonomy?
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- display post count in archive page that have relation with another taxonomy term
- How to select custom posts thats are tagged with multiple taxonomies using wpdb
- Store a value in global scope after init hook is fired
- How to search through all child taxonomies using WP_Query?
- Filter posts by their related field’s custom field
- Output all terms slugs for a loop filter
- WP_query sort by taxonomy
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- 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?
- Creating adminable dynamic filtering on custom post type
- Checking Taxonomy Terms for a Custom Post Type With get_the_terms Not Working
- Dropdown switching subcategories portfolio
- Custom post type and custom taxonomies display
- WP_Query for CPT with filter by another WP_Query
- How to pass taxonomy terms to WP_Query along with $args?
- WordPress custom post type
- Custom Taxonomy Query by Taxonomny not working
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Storing/querying custom date data
- WP Query Post Type with same Taxonomy name
- Catergory args causing loop not to show
- WP Query Conditionally query meta and taxonomy
- WP Query – Can’t get posts with specific taxonomy