WordPress.org

Support

Support » How-To and Troubleshooting » Change slug for category name

Change slug for category name

  • Hi, I need to show the category name instead of the slug, at the ‘gallery-category’… May I have to change the ‘slug’ of the last line? can you help me?

    $gallery_category = array(
            'hierarchical' => true,
            'labels' => array(
                'name' => _x( 'Gallery Category', 'taxonomy general name' ,'theme' ),
                'singular_name' => _x( 'Gallery Categories', 'taxonomy singular name','theme' ),
                'search_items' =>  __( 'Search Categories', 'theme' ),
                'all_items' => __( 'All Categories', 'theme' ),
                'parent_item' => __( 'Parent Category', 'theme' ),
                'parent_item_colon' => __( 'Parent Category:', 'heme' ),
                'edit_item' => __( 'Edit Category', 'theme' ),
                'update_item' => __( 'Update Category', 'theme' ),
                'add_new_item' => __( 'Add New Category', 'theme' ),
                'new_item_name' => __( 'New Category Name', 'theme' ),
                'menu_name' => __( 'Category', 'theme' ),
            ),
            'show_ui' => true,
            'query_var' => true,
            'rewrite' => array( 'slug' => 'gallery-category' ),
        );

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator keesiemeijer

    @keesiemeijer

    What is the category name? I think you can change it to whatever you want (spaces will be replaced by dashes).

    Re-save your permalinks structure at Settings > Permalinks in your admin panel after changing the rewrite argument.

    mmmh… no, because the slug doesn’t have accents or latin characters, and I need them to show, that’s because I need the category instead of the slug. For example the category name is NiƱo (kid) and what is showing is the slug that is nino, and this is not the correct word… I don’t know how to do it

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change slug for category name’ is closed to new replies.