In my site design I have eliminated the need for pages whatsoever, is it possible to re-write the main code somehow so that the "/category/" that we're talking about is not used? I have no pages whatsoever so there's nothing to get messed up?
In my site design I have eliminated the need for pages whatsoever, is it possible to re-write the main code somehow so that the "/category/" that we're talking about is not used? I have no pages whatsoever so there's nothing to get messed up?
I fixed this one by a one line 'hack' in wp-includes/template-functions-category.php
On line 35;
// revhack, 9-9-2006 0:34, remove /category
$catlink = preg_replace( '/\/category/', '', $catlink, 1);
Works like a charm as you can see on http://tekstack.remidain.com
it's late, should be tekstack.remidian.com
remivisser, or anybody else - does this solution cause a problem? I want to try and figure out a way around this without hacking the core, but I'm worried that other people in this thread seem to think this would break some functionality...? I don't know why you would need to have a prefix for categories - but maybe I'm craaazy!??! :)
I guess another solution would be to make Pages that emulate the category pages...
I fixed this one by a one line 'hack' in wp-includes/template-functions-category.php
On line 35;
Didn't work for me, am using 2.0.4 and what happens is that it isn't able to display page 2 (categoryname/page/2 vs category/categoryname/page/2). Sorry guys, I agree with the uselessness of the 'category' label, at least for my own purposes. I guess Pages can be distinguished by presentation/layout anyway. =(
trevorturk, pages emulating categories don't exactly cut it. you can change navigation links, but the category links in the posts will still point to /category/something/
No hacks are needed to do this. Just set your category base to ./
No hacks are needed to do this. Just set your category base to ./
This doesn't work for me. It makes the urls without "category" but hitting a link say blah.com/categoryname just gives me what blah.com would give me...all the categories.
This really should be treated. With so many requests and such a useful request, I can't believe it hasn't already.
Though I have to say for me, the word *category* actually saved my site from getting all messy and I was thankful I had it.
Reason being...
I am working on moving an "Awards" category to an "Awards" Set of pages.
so.. for example, now I have my links so the category is
http://www.aleeya.net/category/awards/award name
and the pages are going in
http://www.aleeya.net/awards/award name
so, if I did not have "category" in there, you can only imagine the problems I would have with 60+ pages getting mixed up with permalinks of posts if the word "category" was not in there.
I have a couple other "categories" that I am having to do this with too.. so that *Could* get messy.
Another reason that I am glad it distinguishes the two with the name *category*.. saves me from having a HUGE mess.
then again, I always have been an oddball..
No hacks are needed to do this. Just set your category base to ./
It works for the most part, but not for paged category archives. It returns a 404 error. Any other ideas? :D
This does not work for me at all. I put in ./ and it changes automatically to /.
One thing that works for me is this:
Leave the category base alone.
When you are linking to the category in your navigation just make the link:
mysite.com/mycategory
instead of
mysite.com/category/mycategory
The category still works fine and displays how you want it. The only problem would be if you had a page with the same name as your category. If not I can't find any conflicts.
Obviously doesn't work if you are using a template tag to display the links to your categories.
Let me know if you find any conflicts with this method.
It doesn't work for me :( I don't get the same results when I write
http://www.rodadas.net/blog/category/blog/citas/
than when I go
http://www.rodadas.net/blog/blog/citas/
Any other ideas?
I found this on 'a href="http://www.clausheinrich.com/seo/change-or-remove-the-category-from-your-permalinks-on-a-wordpress-blog-34.html"'Claus Heinrich Personal Weblog'/a'
'blockquote'Find the file wp-includes/classes.php and about halfway down you can change the settings.
To remove the category like above do this:
$this->category_structure = $this->front . ‘category/’;
change it into this:
$this->category_structure = $this->front;
'/blockquote'
But in order for it to work, you MUST have the Apache's mod_rewrite module on. To do this, just write 'blockquote'RewriteEngine on'/blockquote' on your .htcaccess file
Note that it will only work if you have the mod_rewrite module installed
Wow, ok, that worked for me. I read somewhere else about someone doing the exact same thing, and it broke their post permalinks. Maybe they didn't have mod_rewrite on.
Thanks for the solution!!
FYI, the line to edit is line 1091 of classes.php on a default install (ver 2.0.6).
I take it back. It was screwing up my permalinks to posts -- though only intermittently. I think maybe when the rewrite rules were cached with versions before I commented out that code.
Anyway, it doesn't work. I'm just going to create Pages that emulate category listings.
I noticed a duplicate content issue on my blog where domain.com/category/categoryname/ displays the same content as domain.com/categoryname/. In this particular case there are definite SEO implications as someone could simply link to both URLs enabling the engines to find them both.
This topic has been closed to new replies.