• Resolved Sunny Ujjawal

    (@sunnyujjawal)


    I want to display Extra Tags Taxonomy on custom post.
    What code should I use?
    https://gharvisit.com/wp-admin/edit-tags.php?taxonomy=extra_tags&post_type=estate_property

    Here is code i get from CPTUI:

    function cptui_register_my_taxes_extra_tags() {

    /**
    * Taxonomy: Extra Tags.
    */

    $labels = [
    “name” => __( “Extra Tags”, “wpresidence” ),
    “singular_name” => __( “Extra Tag”, “wpresidence” ),
    “menu_name” => __( “Extra Tags”, “wpresidence” ),
    “all_items” => __( “All Extra tags”, “wpresidence” ),
    “edit_item” => __( “Edit extra tags”, “wpresidence” ),
    “view_item” => __( “View Extra Tag”, “wpresidence” ),
    “update_item” => __( “Update Extra Tag”, “wpresidence” ),
    “add_new_item” => __( “Add Extra Tag”, “wpresidence” ),
    “new_item_name” => __( “New Extra Tag Name”, “wpresidence” ),
    “parent_item” => __( “Parent Extra Tag”, “wpresidence” ),
    “parent_item_colon” => __( “Parent Extra Tag:”, “wpresidence” ),
    “search_items” => __( “Search Extra Tag”, “wpresidence” ),
    “popular_items” => __( “Popular Extra Tags”, “wpresidence” ),
    “separate_items_with_commas” => __( “Separate Extra Tag with comma”, “wpresidence” ),
    “add_or_remove_items” => __( “Add or remove Extra Tags”, “wpresidence” ),
    “choose_from_most_used” => __( “Choose from the most used Extra Tags”, “wpresidence” ),
    “not_found” => __( “No Extra Tag found”, “wpresidence” ),
    “no_terms” => __( “No Extra Tags”, “wpresidence” ),
    “items_list_navigation” => __( “Extra Tags List navigation”, “wpresidence” ),
    “items_list” => __( “Extra Tags List”, “wpresidence” ),
    “back_to_items” => __( “Back to Extra Tags”, “wpresidence” ),
    ];

    $args = [
    “label” => __( “Extra Tags”, “wpresidence” ),
    “labels” => $labels,
    “public” => true,
    “publicly_queryable” => true,
    “hierarchical” => false,
    “show_ui” => true,
    “show_in_menu” => true,
    “show_in_nav_menus” => true,
    “query_var” => true,
    “rewrite” => [ ‘slug’ => ‘extra_tags’, ‘with_front’ => true, ],
    “show_admin_column” => false,
    “show_in_rest” => true,
    “show_tagcloud” => false,
    “rest_base” => “extra_tags”,
    “rest_controller_class” => “WP_REST_Terms_Controller”,
    “show_in_quick_edit” => false,
    “show_in_graphql” => false,
    ];
    register_taxonomy( “extra_tags”, [ “estate_agent”, “estate_agency”, “estate_developer”, “estate_property”, “e-landing-page” ], $args );
    }
    add_action( ‘init’, ‘cptui_register_my_taxes_extra_tags’ );

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to display custom tags on frontend?’ is closed to new replies.