How to Use Custom Query Filter to Create a Taxonomy List in WordPress?

Key Takeaways

  • Nexter Blocks includes a Taxonomy Listing block that allows users to create a taxonomy list based on a custom query filter.
  • Users can add custom code in their Child theme function.php file or use Nexter Extensions to add code snippets for advanced features.
  • The example provided shows how to filter person IDs 73227, 970674, and 17293 using a custom query filter.
Table of Contents

Are you looking to create a taxonomy list using a custom query filter in WordPress? Custom query filters can be used to create a taxonomy list, which is a way of organizing and categorizing content based on specific criteria.

With the Taxonomy Listing block from the Nexter Blocks, you can easily create a taxonomy list based on a custom query filter.

To check the complete feature overview documentation of the Nexter Blocks Taxonomy Listing block, click here.

Requirement  – This block is a part of the Nexter Blocks, make sure it’s installed & activated to enjoy all its powers.

For instance, we want to create a taxonomy list showing person id.

For this, you have to add some custom code. You can add the code in your Child theme function.php file or you can use plugins like Code Snippets to add your custom code or if you are using the Nexter theme you can use Nexter Extensions which comes with various extensions for your Theme including adding code snippets. 

Note: This feature is for advanced users only. If you are comfortable with PHP only, then you should use it.

For example, we have added this code.

add_filter(‘tpgb_custom_taxo_query’, ‘tpgb_custom_taxo_query_function’,10,1);

function tpgb_custom_doc_query_function( $query_args ){

$query_args[‘meta_query’] = array(

    ‘relation’  => ‘OR’,

    array(

      ‘key’ => ‘person_id’,

      ‘value’   => 73227,

      ‘compare’ => ‘=’

    ),

    array(

      ‘key’ => ‘person_id’,

      ‘value’   => 970674,

      ‘compare’ => ‘=’

    ),

    array(

      ‘key’ => ‘person_id’,

      ‘value’   => 17293,

      ‘compare’ => ‘=’

    )

    )    

return $query_args;

}

Now to show the person ID based on this code, add the Taxonomy Listing block on the page, and select the appropriate style, layout, and taxonomy

Then go to the Query tab and in the Custom Query ID field, add the filter key i.e. tpgb_custom_taxo_query here. 

taxonomy listing custom query id new

Now it will list the person id’s.

About the Author

Photo of Aditya Sharma CMO of NexterWP
CMO at POSIMYTH Innovations · NexterWP · 7 years experience

He has spent years in the WordPress ecosystem building, breaking, and optimizing sites until they actually perform. He works at the intersection of speed, growth, and usability, helping creators ship websites that load fast and convert. An active WordPress community contributor sharing through tools, tutorials, and direct collaboration. Tested practice, not theory.

WordpressThemesElementorn8nAIClaudeAutomationServer

Share your Thoughts

Get Instant Answers to all your questions about Nexter Blocks,
Extensions & Theme trained on 1000+ Docs and Videos

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!

Related Frequently Asked Questions

What should I do if my custom query filter isn't working?

If your custom query filter isn't working, double-check the code you've added to ensure it's correctly formatted. For example, ensure that the filter key matches the one used in your Taxonomy Listing block. Additionally, verify that the Taxonomy Listing block is installed and activated as part of the Nexter Blocks. If you're using a Child theme, ensure that the code is placed in the correct function.php file.

What are the best practices for adding custom code in WordPress?

When adding custom code in WordPress, it's best to use a Child theme's function.php file or a plugin like Code Snippets. This approach keeps your customizations safe during theme updates. Additionally, ensure you have a backup of your site before making changes, as incorrect code can lead to errors. Using Nexter Extensions can also simplify this process, as it provides various tools for adding code snippets.

Does the Taxonomy Listing block support custom taxonomies?

The Taxonomy Listing block can be used to display custom taxonomies in WordPress. By selecting the appropriate taxonomy in the block settings, you can effectively categorize and list your content based on custom criteria. This feature is particularly useful for organizing content in a way that aligns with your site's specific needs.

Last reviewed: April 14, 2026

Related Docs