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.

Seriously, why 'with_front' => false does not work as it should be? It is supposed to remove TAXONOMY BASE NAME and my question is why it does not work?

I just dont want the taxonamy base slug appear in my URL and codex says 'with_front' => false should help but it does not. Leaving the slug empty like 'slug'=> '' generates 404 error.

register_taxonomy("tax_categories", array("products"), array(
    "hierarchical" => true,
    "label" => "Categories",
    "singular_label" => "Category",
    "show_ui" => true,
    'update_count_callback' => '_update_post_term_count',
    "rewrite" => array(     
        'with_front' => false,      
        'hierarchical' => true      
        )
    ));

This issue supposed to be fixed http://core.trac.wordpress.org/ticket/16807

Please help to understand that. Thank you.

share|improve this question
1  
Try and Go to your settings-->permalinks and click save, or flush the rewrite rules. –  Wyck Sep 11 '11 at 2:27
2  
As Manny said, with_front does not remove the taxonomy base name. I assume you want to convert the link format from /tax-categories/banana/ to /banana/? There was a question about this (it's quite complicated), but I can't find it right now. –  Jan Fabry Sep 12 '11 at 5:59
    
thats is exactly what is needed. –  Alex Sep 12 '11 at 8:48
    
The problem is you sorta need the taxonomy name in there so that WordPress knows the next thing is the taxonomy term. The only way I know to do it is if you create a completely custom permalink. Do you know what you want your permalink to look like? –  Manny Fleurmond Sep 12 '11 at 12:14

4 Answers 4

Use the code below:

'rewrite' => array( 
    'slug'          => '.',
    'with_front'    => false 
),
share|improve this answer
    
Notice that when you rewrite the slug that the default page template is opened, when you go to the taxonomy page. –  user45446 Jan 21 at 10:13
2  
Please edit your answer to include what you posted as comment. That's why you can edit. –  t f Jan 21 at 10:31
    
In addition to what @tf said, also please explain why your code provides a solution. –  bungeshea Jan 21 at 11:43

Slight amendment on Nyxko's answer. This plugin seems to do the trick: http://wordpress.org/plugins/remove-slug-from-custom-post-type/

(Although this removes the slugs on the permalinks from all custom post types.)

share|improve this answer
    
This would probably be better placed as a comment on Nyxko's answer, rather than a new answer. –  Pat J Dec 24 '13 at 0:59

Using this plugin could help. I search it and not tested it, but a related 'Remove category base' worked just fine for me.

http://wordpress.org/plugins/remove-taxonomy-base-slug/

share|improve this answer

All with_front does is toggle whether or not a taxonomy link can have something else in front of it ie extra permalink stuff from the permalinks options page. For example with_front set to true makes this possible:

blah.com/2011/09/tax/term

with it set to false, all you can do is:

blah.com/tax/term
share|improve this answer
    
I see... does not help though. How to remove the /TAX/ part from taxonomy? –  Alex Sep 12 '11 at 8:50

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.