Support » Fixing WordPress » Permalinks w/ parent category only

  • Is there a variable like %category& that gives just the parent category?

    I’m building a site for an art gallery and my category structure is something like:

    Artwork (parent)
    – Abstract (child)
    – Figurative (child)
    – Drawings (child)
    News (parent)

    I’ve set the custom permalink structure to:
    /%category%=%postname%

    which for a post in the Drawings category would deliver a url like:
    …/artwork/drawings=post-name

    But I really only want the parent category to be part of the url. Ideally I’d like them to be:
    …/artwork=post-name
    or
    …/news=post-name

    Of course it’s possible to set the permalink structure to:
    /artwork=%postname%

    which would be fine except that then posts in News would appear as
    …/artwork=post-name
    rather than
    …/news=post-name

    Any ideas?

Viewing 1 replies (of 1 total)
  • Is there a variable like %category& that gives just the parent category?

    I’m building a site for an art gallery and my category structure is something like:

    Artwork (parent)
    – Abstract (child)
    – Figurative (child)
    – Drawings (child)
    News (parent)

    I’ve set the custom permalink structure to:
    /%category%=%postname%

    which for a post in the Drawings category would deliver a url like:
    …/artwork/drawings=post-name

    But I really only want the parent category to be part of the url. Ideally I’d like them to be:
    …/artwork=post-name
    or
    …/news=post-name

    Of course it’s possible to set the permalink structure to:
    /artwork=%postname%

    which would be fine except that then posts in News would appear as
    …/artwork=post-name
    rather than
    …/news=post-name

    Any ideas?


    @ admin: I first tried to post this a few min. earlier in the same place (How To…) but with the title “Permalinks w/ parent %category% only” but the % sign made the post not accessible. Please delete that one and keep this one.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.