Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9192417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:55:05+00:00 2026-06-17T20:55:05+00:00

I have a made a custom post type called Member Resources the posts under

  • 0

I have a made a custom post type called “Member Resources” the posts under this CPT have a few taxonomies such as categories and tags.

Tags = “Diversity” Categories = “Guidance”

When I go to the following urls:

http://www.domain.com/tags/diversity

http://www.domain.com/tags/guidance

No posts appear.

Though I have set public => true on the CPT function.

Posts are displaying if you go to the Member Resources archive page though, so they are displaying, but not when you filter them by taxonomies.

Update –

Adding the following code to my functions.php file allows the member-resources CPT to show in Category and Tags pages respectively, but now in the wordpress backend under the “Pages” tab and all other content tabs such as posts etc it seems to have overrided my pages and posts and is showing just the member-resources posts.

add_action( 'pre_get_posts', 'add_my_custom_post_type' );

 function add_my_custom_post_type( $query ) {
if ($query->is_main_query()) 
    $query->set( 'post_type', array( 'member-resources' ) );
return $query;
} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:55:07+00:00Added an answer on June 17, 2026 at 8:55 pm

    your code looks correct. but you are including the CPT member-resources in too many of wordpress’s queries. the is_main_query means “the loop” i think.

    so you need to restrict this to just running when on a tag archive page.

    the following code is from the wordpress site

    add_action( 'pre_get_posts', 'foo_modify_query_exclude_category' );
    function foo_modify_query_exclude_category( $query ) {
        if ( ! is_admin() && is_main_query() && ! $query->get( 'cat' ) )
            $query->set( 'cat', '-5' );
    }
    

    You need to do a similar thing but determine if you are in a “tags” page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made some meta_values under a custom post type called 'Show'. I have confirmed
Ok I have made my custom post type and they work fine(code shown below).
I have made a custom UISwitch (from this post) . But the problem is,
I have made a post type, events, that use a custom field, Datum (Swedish
I have made a custom suface button according this example: <Button> <Button.Template> <ControlTemplate TargetType=Button>
I have cells in UITableView , I have made custom frame for the label
I have made a custom form in a module where I have used a
I have made a custom formwizard and incorporated it into my admin interface. Basically
I have made my custom module in magento, in which I have set discount
i have made my custom Static Library (.a) successfully. i have tested it in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.