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 669173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:07:19+00:00 2026-05-14T00:07:19+00:00

I have created some functional categories that I use to show/hide markup elements. However,

  • 0

I have created some functional categories that I use to show/hide markup elements. However, when I go to list the legit categories, these show up too, which I would expect. I want to list the legitimate categories and omit others.

I need to know how you would do it under two circumstances….

1) Each category that I want to exclude is preceded by an underscore character in its name.

2) Each category that I want to exclude is NOT preceeded by a special character and I will just provide an ID to the script that handles the exclusion listing.

  • 1 1 Answer
  • 1 View
  • 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-05-14T00:07:20+00:00Added an answer on May 14, 2026 at 12:07 am

    A check over at the codex for the wp_list_categories template tag (http://codex.wordpress.org/Template_Tags/wp_list_categories) describes three parameters of wp_list_categories() that allow you to control the inclusion or exclusion of categories.

    exclude
    (string) Exclude one or more categories from the results. This
    parameter takes a comma-separated list
    of categories by unique ID, in
    ascending order. See the example. The
    child_of parameter is automatically
    set to false.

    exclude_tree
    (string) Exclude category-tree from the results. This parameter added
    at Version 2.7.1

    include
    (string) Only include the categories detailed in a
    comma-separated list by unique ID, in
    ascending order. See the example.

    You might have checked this already, and maybe you are looking for a more dynamic way to exclude categories with the prefix you describe.
    A: you could hard-code the categories you want to exclude in your call to wp_list_categories().

    B: you could write a function that loops through the category names (using get_categories() and create a comma separated string of of the category id’s that preg_match() the prefix you designated. Pass the string to wp_list_categories argument under the exclude parameter.

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

Sidebar

Related Questions

I have created some JQuery that will expand a div 'popup' on hover and
I have created an app that sends intents among multiple activities. After doing some
I've created a Basic MSI project and have a fully functional installer. Some directories
I am trying out some examples with analytical functions and i have created a
I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
I have to create a wrapper DLL that exports some symbols (functions). Within its
I have created some python code which creates an object in a loop, and
I have created some tests in my WPF application. Right now I am working
I have created some simple charts (of type FastLine) with MSChart and update them
I have created some documents and managed to make some simple queries but I

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.