Viewing 11 replies - 1 through 11 (of 11 total)
  • 1. Do not use “category” in your permalink structure!
    2. You don’t have to do anything special – WP takes care of your sub/sub/sub structure 🙂
    3. Category templates work on the basis of category ID, so for your category 16 you’ll need a category-16.php template
    (Check out my Dev.blog for sub and sub-sub cats in permalinks)

    Thread Starter hampshire

    (@hampshire)

    Thanks but…

    1. If I remove “category” from my permalink then i just get http://domain.com/YEAR/PostID, is this not normal behaviour of WP? What I need is http://domain.com/category/sub/subsub/YEAR/PostID

    2 Where does WP take care of this, the only place it seems to show a sub/sub/sub structure is under categories in the side bar and then it actually puts the word /category/ in link in front of the sub/sub/sub

    3. I’ve got my category templates created already.

    I am afraid you cannot get what you want.
    WP shows categories (and subcats) in URI only when you browse the category archives. Which for me is logical…

    Maybe I misunderstood your question: the first three examples in your original post said you have to type “manually” those URIs to work. You don’t. You just have to click on the category list in the menu.

    Thread Starter hampshire

    (@hampshire)

    Nowhere on the site that I have found links to those pages I listed, it would link to http://domain.com/category/category/subcategory/subsubcategory witht he first category in the URI always just saying category.

    So there is no way at all to have permalinks be more detailed? The point of a permalink is for it to be permanent so wouldnt it make sence for users to have complete controle over it? The way it is now many users will not be able to keep their permalinks when moving from other systems to WP because of the lack of controle over them

    As I said the pages are all there if I type them in manually but there are no links to the pages and therefore wordpress falls back on a file structure I do not like, all I need to do is controle the links, the rest of the software works great.

    Thread Starter hampshire

    (@hampshire)

    Okay, well are there any variables that will work in links that I can plug in to make my own permalinks and take the WP method right out of the page all together? I found a page that listed things like %category%, %postid%, etc once but can not find it again.

    If you refer to the Using Permalinks documentation, you can indeed use a %category% variable in your permalink template.

    When composing posts, make sure that the post is assigned to only the sub-sub-category, and your permalinks will all “just work”.

    Note the caution in the link above regarding %category% on Apache 1.3x servers.

    Thread Starter hampshire

    (@hampshire)

    I was talking in my actual html template because I can not get the Permalink Options page to create permilinks like http://domain.com/category/sub/subsub/.

    Also what does a permalink that just works look like because mine by default are just domain.com/?p=post# or something like that. I was looking to just insert the permalinks myself using a %variables%, not the ones for permalink in the permalink section but the ones for regular HTML in the actual template, those are the variables I can not find. I thought I did before but am begining to think I may have been wrong.

    Also how do you get date out of the archive links for months, by default they look like http://domain.com/date/YEAR/MONTH/, and the same is true with category archives (http://domain.com/category/ActualCategory/SubCategory/SubSubCategory/). The category links are how I want my permalinks to look minus the word category and plus the post id.

    Thanks

    Did you read the Using Permalinks document? From your questions, it seems you did not.

    Please read Using Permalinks.

    If you set Options -> Permalinks to the following format:
    %category%/%post_id%/
    you will get links of this sort:
    http://example.com/category/subcategory/subsubcategory/15/

    In order to actually link items in your templates, you will use the get_permalink() template tag.

    Thread Starter hampshire

    (@hampshire)

    Yes, I figured that out after reading your last post, thank you very much by the way. I did not realize that clicking the box for the Category and Subcategory and SubSubCategory would screw up my permalinks. Thank you for pointing that out, it is greatly appreciated.

    Earlier I ment that I wanted to not use the get_permalink() tag and instead create my own permalinks without it and with other tags instead but I nolonger need to do this, at least for the permalink section.

    Does anyone know how to get the words date and category out of the archive links for by month and by category or are these things I am going to have to change myself in the template and then ad new categories and months by hand as I create them?

    Also is there a list anywhere of all the tags I can use because I do not want to display articles from all the different categories in each months section but rather have different sections from each monthly archive and to not display a list of all the categories/subcategories on each page but only the category for the article you are reading so I will need the tags for the templates so I can get it to show only articles from category 4 or only links from category 2 etc.

    Thread Starter hampshire

    (@hampshire)

    By the way why does everyone keep pointing me to the Using Permalinks article when I keep saying I do not want to use permilinks, I wanted/want to strip the whole permalinks section out of all my templates because it can not create Category/Sub/SubSub links when you have more than one category selected even though they are all underneath eachother. I wanted to creat my permalinks by myself, by putting the base URL into the page on its own and then adding tags to the html itself, not to the permalink page in the admin. I have read the permalinks section, its not what I need, thats why I asked the question. Guess I will start a new thread latter for my other questions because this one got kind of cluttered. Thanks for the help though.

    hampshire: it was not entirely clear to me that you wanted to manually construct your links. Doing so is certainly possible, but seems to me a fragile, and possibly complicated, endeavour.

    The reason I pointed you to the Using Permalinks article is because it is not sufficient to make HTML links to your posts. You need to tell WordPress how to interpret those links. For example, out of the box, all links to posts will be of the form
    http://example.com/?p=15
    If you manually tried to link to that post using something like
    http://example.com/category/subcategory/A-Post
    you would likely end up with a 404 error, because the webserver and WordPress don’t know that they’re together supposed to parse the request and find the specific item.

    In your template files, replace all instances of get_permalink() with whatever you want to use for your link structure. Be sure to set Options -> Permalinks to match that structure, and to update your .htaccess file as needed.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘category/subcategory/subsubcategory pages display, now what about links?’ is closed to new replies.