WordPress.org

Ready to get started?Download WordPress

Forums

Change slug for category name (3 posts)

  1. desgaus
    Member
    Posted 1 year ago #

    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.]

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    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.

  3. desgaus
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags