Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Custom Taxonomies and Post Types

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29708

    I have 1 custom taxonomy assigned to 3 custom post types. Then I have 4 categories in my custom taxonomy. How can I make each category in my custom taxonomy a page on my website that displays the posts from each post type in that category of my custom taxonomy? I hope that makes sense.

    Thanks you.

    #80285
    jamygolden
    Member

    Click on ‘Appearance’ in the menu. A list of items should drop down such as "Themes", etc. One of these is named "Menu". Click on menu, and you should see your custom post type on the left somewhere. Click the "show all" tab and you should see your 4 categories. Tick them and click "Add to menu". Save the menu.

    (I’m assuming your theme supports the wordpress 3 menu)

    Is this what you meant?

    #80286

    No, I’m sorry for not being clear. I want to create a template php file that applies to all of my taxonomy categories. So my questions are:

    1. How can I create three loops that go through each post type?

    2. How do I assign that file to all of my categories in my taxanomy? (I would assume through funtions.php somehow???)

    3. I want to create it like so:

    taxanomy-name.php:

    if( taxonomy root – mydomain.com/custom-taxonomy/ ) {
    show category link buttons
    } elseif ( taxonomy category – mydomain.com/custom-taxonomy/tax-category-[01,02,03,04,05] ) {
    loop for first post type
    loop for second post type
    loop for third post type
    }

    Does that make sense?

    Thanks.

    #80295
    jamygolden
    Member

    I would explode() the forwardslashes, and get the last (or wherever the taxonomy name is in the url) array, create a variable and do something like:

    Code:
    if($exploded_tax == ‘tax’){
    // insert special single page code
    }
    else{
    // insert code for all single pages
    }

    (within the single.php)
    http://php.net/manual/en/function.explode.php
    http://php.net/manual/en/language.types.array.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.