• Micha

    (@hellstrom)


    Hi Folks,

    I have a small, but a bit annoying problem. I created a custom post type with custom tags. All is working as expected, except when clicking on “most used tags” it’s just showing a box containing a zero. I can view the custom tags in menu, I can create them and they are counted correcly when assigned. Hopefully someone has an idea. here’s my code:

    add_action( 'init', 'create_post_type' );
    	function create_post_type() {
    		register_post_type( 'svo_players',
    			array(
    				'labels' => array(
    					'name' => __( 'Spieler' ),
    					'singular_name' => __( 'Spieler' )
    				),
    				'description' => 'Spieler...',
    				'public' => true,
    				'show_in_nav_menus' => false,
    				'query_var'         => true,
    				'menu_icon' => 'dashicons-carrot',
    				'supports' => array('title','editor','thumbnail','custom-fields','revisions'),
    				'has_archive' => true
    			)
    		);
    	}
    	// dashicons-flag
    	// https://melchoyce.github.io/dashicons/
    
    	add_action( 'init', 'create_playerTeam', 0 );
    	function create_playerTeam() {
    		$labels = array(
    			'name'              => _x( 'Mannschaft', 'taxonomy general name' ),
    			'singular_name'     => _x( 'Mannschaft', 'taxonomy singular name' ),
    			'search_items'      => __( 'Mannschaften durchsuchen' ),
    			'all_items'         => __( 'Alle Mannschaften' ),
    			'parent_item'       => __( 'Parent Mannschaften' ),
    			'parent_item_colon' => __( 'übergeordnete Mannschaft:' ),
    			'edit_item'         => __( 'Mannschaft bearbeiten' ),
    			'update_item'       => __( 'Mannschaft updaten' ),
    			'add_new_item'      => __( 'Neue Mannschaft hinzufügen' ),
    			'new_item_name'     => __( 'Name der neuen Mannschaft' ),
    			'menu_name'         => __( 'Mannschaften' ),
    		);
    
    		$args = array(
    			'hierarchical'      => true,
    			'labels'            => $labels,
    			'public'			=> true,
    			'show_ui'           => true,
    			'show_admin_column' => true,
    			'query_var'         => true,
    			'rewrite'           => array( 'slug' => 'genre' ),
    		);
    
    		register_taxonomy( 'svo_teams', array( 'svo_players' ), $args );
    	}
    
    	add_action( 'init', 'create_playerTags', 0 );
    	function create_playerTags() {
    		$labels = array(
    			'name'              => _x( 'Position', 'taxonomy general name' ),
    			'singular_name'     => _x( 'Position', 'taxonomy singular name' ),
    			'search_items'      => __( 'Positionen durchsuchen' ),
    			'all_items'         => __( 'Alle Positionen' ),
    			'parent_item'       => __( 'Parent Positionen' ),
    			'parent_item_colon' => __( 'übergeordnete Positionen:' ),
    			'edit_item'         => __( 'Position bearbeiten' ),
    			'update_item'       => __( 'Position updaten' ),
    			'add_new_item'      => __( 'Neue Position hinzufügen' ),
    			'new_item_name'     => __( 'Name der neuen Position' ),
    			'menu_name'         => __( 'Positionen' ),
    		);
    
    		$args = array(
    			'hierarchical'      => false,
    			'labels'            => $labels,
    			'public'			=> true,
    			'show_ui'           => true,
    			'show_admin_column' => true,
    			'query_var'         => true,
    			'rewrite'           => array( 'slug' => 'position' ),
    			'publicly_queryable' => true
    		);
    
    		register_taxonomy( 'svo_playerTags', array( 'svo_players' ), $args );
    	}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘custom most used tags just showing 0’ is closed to new replies.