So it appears I am missing a vital pice of information somehow to make my custom post type title tag behave. everything else works fine.
my current - simple - scenario is this : wordpress 3.8, twentytwelve theme, wpizza plugin (I'm the author of this , so that's what the questions relates to really), nothing else
I registered the wppizza custom post type and taxonomies like so:
/*******************************************************
[register custom post type]
******************************************************/
public function wppizza_register_custom_posttypes(){
$labels = array(
'name' => __( 'Menu Items', $this->pluginLocale),
'singular_name' => __( 'WPPizza Menu Item', $this->pluginLocale ),
'add_new' => __( 'Add New', $this->pluginLocale ),
'add_new_item' => __( 'Add New Menu Item',$this->pluginLocale ),
'edit' => __( 'Edit', $this->pluginLocale ),
'edit_item' => __( 'Edit Menu Item',$this->pluginLocale ),
'new_item' => __( 'New Menu Item',$this->pluginLocale ),
'all_items' => __( 'All Menu Items',$this->pluginLocale ),
'view' => __( 'View', $this->pluginLocale ),
'view_item' => __( 'View Menu Items',$this->pluginLocale ),
'search_items' => __( 'Search Menu Items',$this->pluginLocale ),
'not_found' => __( 'No items found',$this->pluginLocale ),
'not_found_in_trash' => __( 'No items found in the Trash',$this->pluginLocale ),
'parent_item_colon' => '',
'menu_name' => ''.$this->pluginName.''
);
/**add a filter to labels if you want to...**/
$labels = apply_filters('wppizza_cpt_lbls', $labels);
$args = array(
'labels' => $labels,
'description' => sprintf( __( 'Holds %1$s menu items data', $this->pluginLocale ), $this->pluginName ),
'show_ui' => true,
'public' => true,
'menu_position' => 100,
'menu_icon' => defined('WPPIZZA_MENU_ICON') ? WPPIZZA_MENU_ICON : plugins_url( 'img/pizza_16.png', $this->pluginPath ),
'has_archive' => false,
'hierarchical' => false,
'supports' => array( 'title', 'editor', 'author','thumbnail','page-attributes','comments'),
'taxonomies' => array('') /* 'post_tag' for example*/
);
/**add a filter to arguments if you want to**/
$args = apply_filters('wppizza_cpt_args', $args);
register_post_type( $this->pluginSlug, $args );
}
/*******************************************************
[register taxonomy + taxonomy related functions]
******************************************************/
public function wppizza_register_custom_taxonomies(){
$options = $this->pluginOptions;
/**********************
when using permalinks, we can either set the
parent to be a dedicated page (admin->settings)
.........
***********************/
$sel_category_parent=get_post($options['plugin_data']['category_parent_page'],ARRAY_A);
/**********************
........or use/set a default
(required as other pages wont work without it when permalinked
**********************/
if($sel_category_parent['post_name']==''){
$sel_category_parent['post_name']=$this->pluginSlugCategoryTaxonomy;
}
// Add new taxonomy, make it hierarchical (like categories)
$labels = array(
'name' => _x( 'WPPizza Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Categories' ),
'all_items' => __( 'All Categories' ),
'parent_item' => __( 'Parent Category' ),
'parent_item_colon' => __( 'Parent Category:' ),
'edit_item' => __( 'Edit Category' ),
'update_item' => __( 'Update Category' ),
'add_new_item' => __( 'Add New Category' ),
'new_item_name' => __( 'New Category Name' ),
'menu_name' => __( 'Categories' )
);
register_taxonomy($this->pluginSlugCategoryTaxonomy,array($this->pluginSlug), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => ''.$sel_category_parent['post_name'].'','hierarchical'=>true )
));
}
which all works fine and in turn prints "WPPizza Categories" in the admin as title when editing/adding categories related to the wppizza cpt. So far so good.
problem is as follows:
when i go to a "normal category" (i.e http://www.domain.com/category/uncategorized/) the title tag looks like this (which is fine)
<title>Uncategorized | sitetitle</title>
however, when i go to the custom post type/taxonomy like so http://www.domain.com/wppizza_menu/desserts/ (permalink) or just http://www.domain.com/?wppizza_menu=desserts , the title tag looks like this
<title>Desserts | WPPizza Categories | sitetitle</title>
when - what i would like it to read is
<title>Desserts | sitetitle</title>
in short, how do i get rid of "WPPizza Categories" in the title tag in the frontend ?
hope the above makes sense. happy to provide more code if required of course