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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:54:53+00:00 2026-06-17T15:54:53+00:00

I want to be able to sort my category listings by different fields. I

  • 0

I want to be able to sort my category listings by different fields. I figure tags (or any arbitrary field) is a good way to do this. But I can’t see how to add tags to a Category.

Ideas?

  • 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-17T15:54:53+00:00Added an answer on June 17, 2026 at 3:54 pm

    From this WordPress StackExchange Q&A:

    Add custom taxonomy fields when creating a new taxonomy

    These are not tags, but custom fields being saved in wp_options table. And they are saved and retrieved using the category ID, e.g., get_option( "taxonomy_$t_id" ).
    Check the full Q&A for other solutions. Revised code:

    add_action( 'category_edit_form_fields', 'extra_edit_tax_fields_wpse_29322', 15, 2 );
    add_action( 'category_add_form_fields', 'extra_add_tax_fields_wpse_29322', 10, 2 );
    add_action( 'edited_category', 'save_extra_taxonomy_fields_wpse_29322', 10, 2 );
    add_action( 'create_category', 'save_extra_taxonomy_fields_wpse_29322', 10, 2 );   
    
    // Edit existing taxonomy
    function extra_edit_tax_fields_wpse_29322( $tag ) 
    {
        // Check for existing taxonomy meta for term ID.
        $t_id = $tag->term_id;
        $term_meta = get_option( "taxonomy_$t_id" ); 
        ?>
        <tr class="form-field">
        <th scope="row" valign="top">
            <label for="cat_Image_url"><?php _e( 'Category Navigation Image URL' ); ?></label>
        </th>
            <td>
                <input type="text" name="term_meta[img]" id="term_meta[img]" value="<?php echo esc_attr( $term_meta['img'] ) ? esc_attr( $term_meta['img'] ) : ''; ?>">
                <p class="description"><?php _e( 'Enter the full URL to the navigation image used for this category.' ); ?></p>
            </td>
        </tr>
        <?php
    }
    
    // Add taxonomy page
    function extra_add_tax_fields_wpse_29322( $tag ) 
    {
        ?>
        <div class="form-field">
            <label for="cat_Image_url"><?php _e( 'Category Navigation Image URL' ); ?></label>
            <input type="text" name="term_meta[img]" id="term_meta[img]" value="">
            <p class="description"><?php _e( 'Enter the full URL to the navigation image used for this category.' ); ?></p>
        </div>
        <?php
    }
    
    // Save extra taxonomy fields callback function.
    function save_extra_taxonomy_fields_wpse_29322( $term_id ) 
    {
        if ( isset( $_POST['term_meta'] ) ) 
        {
            $t_id = $term_id;
            $term_meta = get_option( "taxonomy_$t_id" );
            $cat_keys = array_keys( $_POST['term_meta'] );
            foreach ( $cat_keys as $key ) 
            {
                if ( isset ( $_POST['term_meta'][$key] ) )
                    $term_meta[$key] = $_POST['term_meta'][$key];
            }
            // Save the option array.
            update_option( "taxonomy_$t_id", $term_meta );
        }
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i do this? (c#) Basically, i want to be able to sort
I want to be able to sort files based on what day they were
I have main categories and sub categories. I want to be able to sort
I want to be able to achieve the following using guice/gin: Get all sort
I want to be able to hide a selector if it contains any data.
I want to be able to sort elements based on an attribute in my
I want to be able to sort a DataGridView by the ComboBoxColumn so I
i have a string that looks like this apples,fish,oranges,bananas,fish i want to be able
I have a list of userprofiles that I want to be able to sort
I have a collection (list) of objects. I want to be able to sort

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.