Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was trying to remove portfolio-view from url and followed instructions to remove its name from highlighted section. This works but has left me with 'portfolio' now even though field is blank. What is wrong with this code or need changing in breadcrumbs please? It is now grabbing 'portfolio' from somewhere and i want this hidden in url.

I'm trying to get: http://www.sitename.com/post instead of http//www.sitename.com/portfolio/post.

/* Portfolio */

 function my_post_type_portfolio() {

 register_post_type( 'portfolio',

 array(

 'label' => __('Portfolio'),

 'singular_label' => __('Porfolio Item', 'theme'),

 '_builtin' => false,

 'public' => true,

 'show_ui' => true,

 'show_in_nav_menus' => true,

 'capability_type' => 'page',

 'menu_icon' => get_template_directory_uri() . '/includes/images/icon_portfolio.png',

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

 'supports' => array(

 'title',

 'editor',

 'thumbnail',

 'excerpt',

 'custom-fields',

 'comments')

 )
 );
 register_taxonomy('portfoliocat', 'portfolio', array('hierarchical' => true, 'label' => 'Portfolio Categories', 'singular_name' => 'Category', "rewrite" => true, "query_var" => true));
 }


add_action('init', 'my_post_type_portfolio'); 

Breadcrumb setting is: <a title="Go to %title%." href="%link%">%htitle%</a>

Permalinks: /%postname%/

share|improve this question
    
What plug-in are you using for your breadcrumbs? Breadcrumb NavXT? –  Joseph Aug 31 '12 at 12:24
    
Yes using Breadcrumb NavXT –  James Hughes Aug 31 '12 at 13:34
    
Just installed a plug-in 'remove custom post types' and that has solved the problem. don't know how it works, but it works. perfect url's now –  James Hughes Aug 31 '12 at 13:35
add comment

1 Answer 1

You could try this plugin I wrote: https://github.com/interconnectit/custom-post-type-permalinks

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.