WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Will This Break WordPress? (8 posts)

  1. andymike
    Member
    Posted 7 years ago #

    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

  2. Chris_K
    Member
    Posted 7 years ago #

    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...

  3. theiconoclast31
    Member
    Posted 7 years ago #

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

  4. andymike
    Member
    Posted 7 years ago #

    My permalink structure is :

    /%category%/%postname%/

    Is that why this works?

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

  5. theiconoclast31
    Member
    Posted 7 years ago #

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

  6. andymike
    Member
    Posted 7 years ago #

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

  7. andymike
    Member
    Posted 7 years ago #

    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?

  8. andymike
    Member
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic