Support » Fixing WordPress » Categorizing in the different ways?

  • Hi,

    I’m working on a WordPress-site for a magazine that will have many articles at their site and now I need to find out a good way to categorize the articles in WP.

    The client wants me to categorize the posts according to the following principles:
    • Issue (for example ”#1 2016”)
    • Type of article (for example ”interview”, ”column”)
    • Subject (for example ”sports”, ”politics”)

    My thought is to use WordPress categories for the ”type of article” and the tags for the ”subject”. The one thing that I now need to figure out is what to do with the ”issue”. Can I create a new type of categorizing besides categories and tags? Or can anyone think of att good way to use either the categories or the tags to categorize two of the ”principles” (issue, type of article and subject) in? I though want to be able to list either of the three ”principles” separately.

    Thanks in advance!

    / Isak

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern

    (@sterndata)

    Support Team Volunteer

    What you want is a “custom taxonomy”. https://generatewp.com/taxonomy/

    Another option is to use a plugin like IssueM: https://wordpress.org/plugins/issuem/ I’ve used it on a literary mag.

    • This reply was modified 2 years, 7 months ago by  Steven Stern.

    That did it! Big thanks!

    If I want to grab the value of an custom taxonomy and display it on the website. How can I do that?

    The case: The website now displays the date when the article was published, but I want to change that so that the issue from which the article is taken displays instead.

    The Custom Taxonomy looks lite this:

    // Register Custom Taxonomy
    function nummer() {
    
    	$labels = array(
    		'name'                       => _x( 'Nummer', 'Taxonomy General Name', 'text_domain' ),
    		'singular_name'              => _x( 'Nummer', 'Taxonomy Singular Name', 'text_domain' ),
    		'menu_name'                  => __( 'Nummer', 'text_domain' ),
    		'all_items'                  => __( 'Alla', 'text_domain' ),
    		'parent_item'                => __( 'Överordnad kategori', 'text_domain' ),
    		'parent_item_colon'          => __( 'Överordnad kategori:', 'text_domain' ),
    		'new_item_name'              => __( 'Nytt namn på nummer', 'text_domain' ),
    		'add_new_item'               => __( 'Lägg till nytt nummer', 'text_domain' ),
    		'edit_item'                  => __( 'Redigera nummer', 'text_domain' ),
    		'update_item'                => __( 'Uppdatera nummer', 'text_domain' ),
    		'view_item'                  => __( 'Titta på nummer', 'text_domain' ),
    		'separate_items_with_commas' => __( 'Separera nummer med komman', 'text_domain' ),
    		'add_or_remove_items'        => __( 'Lägg till eller ta bort nummer', 'text_domain' ),
    		'choose_from_most_used'      => __( 'Välj bland de mest använda', 'text_domain' ),
    		'popular_items'              => __( 'Populära nummer', 'text_domain' ),
    		'search_items'               => __( 'Sök nummer', 'text_domain' ),
    		'not_found'                  => __( 'Hittades inte', 'text_domain' ),
    		'no_terms'                   => __( 'Inga nummer', 'text_domain' ),
    		'items_list'                 => __( 'Nummerlista', 'text_domain' ),
    		'items_list_navigation'      => __( 'Nummerlista navigering', 'text_domain' ),
    	);
    	$args = array(
    		'labels'                     => $labels,
    		'hierarchical'               => true,
    		'public'                     => true,
    		'show_ui'                    => true,
    		'show_admin_column'          => true,
    		'show_in_nav_menus'          => true,
    		'show_tagcloud'              => false,
    	);
    	register_taxonomy( 'nummer', array( 'post' ), $args );
    
    }
    add_action( 'init', 'nummer', 0 );
    • This reply was modified 2 years, 4 months ago by  isakengstrom.
    • This reply was modified 2 years, 4 months ago by  isakengstrom.
    Moderator Steven Stern

    (@sterndata)

    Support Team Volunteer

    There are a number of functions you could use, but I think get_the_terms is probably the one you need.

    https://developer.wordpress.org/reference/functions/get_the_terms/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Categorizing in the different ways?’ is closed to new replies.