• I want to have category hierarchy in the parmalink of a post when i use the_permalink (url like this: archive/category1/subcategory/post-name).
    Any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can try
    /archives/%category%/%postname%
    Be aware on certain Apache versions it will not work. See more > Using_Permalinks

    Thread Starter lizhard

    (@lizhard)

    Thanks for reply, Moshu…
    I’ve already tried with /archives/%category%/%postname% but only the first cat is showed in the permalink. I want to display subcategory also. If i write manually /archives/category/subcategory/postname it works but when i click on permalink the url is: /archives/category/postname… I need to display ALWAYS the category tree in the URL

    Strange. It works for me: it displays the whole “category tree” when clicking on the title > going to single post view.

    Thread Starter lizhard

    (@lizhard)

    Not works for me… i’ve tried also in the navigation links nothing else…
    Please post your code for a comparision.. thanks
    here is mine:
    <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4>

    <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>

    Thread Starter lizhard

    (@lizhard)

    I don’t see differences…
    From the codex:
    Note on using %category% with multiple categories on a post
    Where you assign multiple categories to a post, only 1 can show up in the permalink. This will be the lowest numbered category (see Manage Categories). The post will still be accessible through all the categories as normal.

    This is my case

    A post having multiple categories or being assigned to a sub-sub-sub category – those are two completely different cases.
    /categiry/its-subcategory/its-sub-subcategory works; which measn I have a cat which has a child and a grandchild cat. A post published in the grandchild cat and having the permalink structure I suggested above – works like a charm.

    Probably non-hierarchical categories don’t work – as the Codex said. Never tried.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Multiple category in the permalink’ is closed to new replies.