Support » Fixing WordPress » Will This Break WordPress?

  • Resolved andymike

    (@andymike)


    I have noticed that when linking to a category from my own static navigation menu I can use:

    mysite.com/mycategory

    instead of:

    mysite.com/category/mycategory

    WordPress still pulls up the correct category template and displays everything OK when I use the first method. Is it OK to do this or will it create some kind of conflict?

    I realize I can’t go and name a Page the same name as my category . But does it cause any other conflicts?

    Just let me know if this causes any problems with WP.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m envious – I sure can’t replicate that trick on my 2.0.5 install.

    What version of WP are you running?

    I don’t think it’ll cause any problems whatsoever, but I dunno that I’d count on it…

    Have you specified a special category permalink structure under Options > Permalinks? That might be it.

    My permalink structure is :

    /%category%/%postname%/

    Is that why this works?

    I just don’t want to worry about it getting screwed up later.

    No, I’m referring to your *category* base, which is under “Optional” in the Permalink options screen.

    No I haven’t changed that, and I am running 2.0.5

    Can anyone tell me if this will have implications, like possibly breaking WP in the future?

    You can see a live demo of this by going here:

    http://www.freelovemd.com/section/ask-lovemd/

    and

    http://www.freelovemd.com/ask-lovemd/

    both work fine. So I would like to change it permanently to the second one, but I am worried it will cause problems in the future.

    Anyone?

    Figured out a solution:

    If you are going to use it as a CMS with a couple categories, like the example I am giving just create Page Templates that query the posts from the specific category:

    <?php query_posts(‘cat=2’); ?>

    put that before the loop, and then use all the same template tags you would use if you were creating a custom category page. Then you can use links to these Pages without the /category/ because they will be Pages.

    This is only useful if you are linking to your categories from a “static” navigation menu. If you are linking to the categories dynamically with a Template Tag WP will use the /category/ in the link.

    Hope this helps someone.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Will This Break WordPress?’ is closed to new replies.