0
votes

I'm working on a custom post type, but I'm facing the problem that it takes the usual post taxanomies. Got a rewrite now on it but can't get the taxonomy stucture the right way.

The breadcrumbs just shows:

Home > News > ITEM instead of Home > Page 1 > Archive > ITEM.

I tried this:

'taxonomies' => array( 'Page 1', 'Archive' ),

But nothing happened.

2
did you try to re-save your permalinks settings in the backend? - Kortschot
or check: generatewp.com might help. If you show some more info people can give better advice. - Kortschot
@Kortschot This has nothing to do with core permalinks. It's a custom permalink. - Pim Peters
Can we see the taxonomy function? for registering the taxonomy... - designtocode
I tried this plugin for a similar issue, maybe it could work for you or someone in a similar pickle: link - amandathewebdev

2 Answers

0
votes

Not sure if this is what you need or mean but it works good here:

<?php
/*
Plugin Name: Page 1 Post Type
Plugin URI: 
Author: 
Author URI: 
Version: 0.1
Description: 
License: GPL2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

function codex_custom_init() {
  $labels = array(
    'name' => 'Page 1s',
    'singular_name' => 'Page 1',
    'add_new' => 'Add New',
    'add_new_item' => 'Add New Page 1',
    'edit_item' => 'Edit Page 1',
    'new_item' => 'New Page 1',
    'all_items' => 'All Page 1s',
    'view_item' => 'View Page 1',
    'search_items' => 'Search Page 1s',
    'not_found' =>  'No Page 1s found',
    'not_found_in_trash' => 'No Page 1s found in Trash', 
    'parent_item_colon' => '',
    'menu_name' => 'Page 1s'
  );

  $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true, 
    'show_in_menu' => true, 
    'query_var' => true,
    'rewrite' => array( 'slug' => 'Page1' ),
    'capability_type' => 'post',
    'has_archive' => true, 
    'hierarchical' => true,
    'menu_position' => null,
    'supports' => array('title', 'editor', 'revisions', 'page-attributes' )
  ); 

  register_post_type( 'Page 1', $args );
}
add_action( 'init', 'codex_custom_init' );

?>
0
votes

In order to remove the 'News' item in the breadcrumb trail, you'll need to remove this from the rewrite in your custom post type. Try this =

'rewrite' => array('slug' => 'Page1', 'with_front' => false),

As it's name suggests, each time you create a new custom post type, it creates it as a post, and by default all posts within your WordPress site are listed under the blog/news page, hence why they appear as such in your breadcrumbs.

This may not completely resolve your issue as I think you'll need to do some formatting of the breadcrumbs too - this is a good plugin for breadcrumb management and provides lots of customisable settings too! = http://wordpress.org/plugins/breadcrumb-navxt/