Taxonomy Term Page (6 posts)

  1. Sebastien Couture
    Posted 5 years ago #


    I'm discovering custom post types and taxonomies in WP 3.0.

    I've created a custom post type called products and a taxonomy called types containing different terms.

    Calling http://mydomain.com/types/golf/ shows me the products associated to that taxonomy. However what bothers me is that calling up http://mydomain.com/types/ returns a 404. I'd like to have a page that queries the different terms in so I can list the titles and descriptions of the different terms with links to the term pages.

    http://mydomain.com?taxonomy=types just shows me the home page but returns the query_string ?taxonomy=types however there seems to be no set request, matched_rule or matched_query variables set.

    Can anyone help me out. Maybe a hack or plugin ?


  2. chinmoy29
    Posted 5 years ago #

  3. Sebastien Couture
    Posted 5 years ago #


    Thanks for your reply.

    That's where the problem lies. The page doesn't seem to "call" the taxonomy since it shows me the home page.

    However like i said, caling http://mydomain.com?taxonomy=types does show interesting vars in the debug. For instance $wp_query->query->taxonomy == "types"

    It seems as though WP doesn't now how to handle taxonomy requests directly, only terms.

    Also, if I call up http://mydomain.com/types/ WP returns a 404. In this case $wp_query->query->category_name == "types" so it seems to think I'm calling a category. I find that strange since my category base is set to /blog/.

  4. chinmoy29
    Posted 5 years ago #

    call like this http://mydomain.com/taxonomy/types/ and create a page taxonomy.php and put the same code of category.php in this new file.

  5. Sebastien Couture
    Posted 5 years ago #

    I think I may have not been clear in my explanation. Here is the site in question :

    I created a taxonomy with product types.

    `Taxonomy : univers
    + chateaux
    + golf
    + restaurants`

    Calling up http://www.coffrets-luxe.com/univers/golf shows my taxonomy-univers.php template with the golf related products.

    I'd like it so that when I call up http://www.coffrets-luxe.com/univers/ I get a page with query that essentially contains the different terms (chateaux, golf, restaurants) so I can have a page with entrance points to the different product lists. Right now, calling up that URL gives me a 404 since WP thinks it's looking for the post category "univers" which does not exist.

    Here is what is displayed in my debug info


    + query_vars
    +-- category_name = univers

    + query_vars
    +-- category_name = univers
    + query_string = category_name=univers
    + request = univers
    + matched_rule = (.+?)/?$
    + matched_query = category_name=univers
    + did_permalink = TRUE


  6. Sebastien Couture
    Posted 5 years ago #

    Can an administrator move this thread to Hacks. I think it's more relevant there.

Topic Closed

This topic has been closed to new replies.

About this Topic