Skip to main content

Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

  • This topic is empty.
Viewing 16 post (of 16 total)
  • Author
    Posts
  • #297761
    Aleaume20
    Participant

    add_action( ‘init’, ‘create_cw_hierarchical_taxonomy’, 0 );
    //create a custom taxonomy name
    function create_cw_hierarchical_taxonomy() {
    $labels = array(http://www.rachat-de-credit-simulation.com/rachat-de-credit
    ‘name’ => _x( ‘Topics’, ‘taxonomy general name’ ),
    ‘singular_name’ => _x( ‘Topic’, ‘taxonomy singular name’ ),
    ‘search_items’ => __( ‘Search Topics’ ),
    ‘all_items’ => __( ‘All Topics’ ),
    ‘parent_item’ => __( ‘Parent Topic’ ),
    ‘parent_item_colon’ => __( ‘Parent Topic:’ ),
    ‘edit_item’ => __( ‘Edit Topic’ ),
    ‘update_item’ => __( ‘Update Topic’ ),
    ‘add_new_item’ => __( ‘Add New Topic’ ),
    ‘new_item_name’ => __( ‘New Topic Name’ ),
    ‘menu_name’ => __( ‘Topics’ ),
    );
    // taxonomy register
    register_taxonomy(‘topics’,array(‘post’), array(
    ‘hierarchical’ => true,
    ‘labels’ => $labels,
    ‘show_ui’ => true,
    ‘show_admin_column’ => true,
    ‘query_var’ => true,
    ‘rewrite’ => array( ‘slug’ => ‘topic’ ),
    ));
    }

    `

    Reference : https://www.wpblog.com/create-custom-taxonomies-in-wordpress/

Viewing 16 post (of 16 total)
  • The topic ‘Display custom taxonomy (like “the_category”) for custom post type’ is closed to new replies.