• Hello, I am trying to wrap my brain around a something I have been working on for some time.

    Basically I have a lets say 100 categories and subcategories total in different main categories like health and money. Each of these has a lot of subcategories. Well, for each of these types I have articles, videos, and images. Originally I had created the number of categories times 3 to create this structure. It ended up being horrible, however, to have that many categories and I had to change it. Well, I started learning about taxonomies and I created a Content type taxonomy with articles, videos, and images. Well, here is the problem, I need to be able to access an archive of every video in the health/dieting category and subcategory. Based on the way wordpress is out of the box this is impossible.

    I basically need to do this:
    archive link list: taxonomy-term-name/category/subcategory

    For the actual post I don’t really care because I only use the name of the post after the url. But, one of the most important things on my site is for me to be able to show all the videos or images in a certain category, and for me to also show all content in a certain category. If I can’t figure out how to combine a taxonomy and category in the same url to show an archive I am going to have to go back to duplicating all the categories. I sure hope there is a way to customize the permalinks so archive can use a combination of categories and taxonomies to show a list of content. Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • you’d do it via a search query rather than a permalink

    one i use for example:
    ?cat=174&location=vermont&orderby=rand

    if this isn’t vanilla functionality, the plugin that enables it is this: Taxonomy Picker

    if you can install it, you could just not use the widget and set your links to use it’s code.

    really though, i am pretty sure this is 3.2 native.

    also, the thing is your taxonomy is not a subcategory, it’s different.

    category is a taxonomy as well, so category and media type are two equal but different designators.

    Thread Starter jhansensd

    (@jhansensd)

    I never said the name of my taxonomy term was a subcategory. I simply want to combine taxonomies and category/subcategory names into an accessible archive list.

    Thread Starter jhansensd

    (@jhansensd)

    Also, I want to point out that I understand the query and how to build it just fine. What I need to do, however, is link the name typed on the URL with the query.

    yeah i read your permalink wrong, you were not calling it a subcat.

    from reading it seems you will have to bypass wordpress functions, as you said it’s impossible to get an archive list on multiple taxes.

    but here and here give examples of mysql statements that will help you start.

    Thread Starter jhansensd

    (@jhansensd)

    I have already implemented this functionality by modifying code inside wp-blog-head and it looks like this:

    // Check if the URL contains a taxonomy name, and if it does, pass in the taxonomy type as an extra variable
    // to wp(). Strip the taxonomy name from the url.
    if ( preg_match( ‘#^/(articles|reviews|videos|images|websites|audio|products)/#’, $_SERVER[‘REQUEST_URI’], $matches ) )
    {
    // Remove the taxonomy term name from the beginning of the url in the request uri.
    $_SERVER[ ‘REQUEST_URI’ ] = preg_replace( ‘#^/(articles|reviews|videos|images|websites|audio|products)(.*)$#’, ‘$2’, $_SERVER[‘REQUEST_URI’] );

    wp( “taxonomy=content&term=” . $matches[1] );
    }
    else
    {
    wp();
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Taxonomies & Categories in the URL’ is closed to new replies.