• manthono

    (@manthono)


    Hi all,

    I have a custom post called “education database”. Under this custom post I have two custom taxonomy called “country” and “type-of-course”.

    “Country” has three items: “country 1”, “country 1”, “country 3”;
    “Type of course” has three items : “type A”, “type B”, “type C”;

    Now, with an archive template for country 1 ( taxonomy-country1.php) I can list all the post under “country 1” using this method:

    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );

    But I am planning to separate the archive result by “type of course” taxonomy, so it looks like this:

    Country 1

    Type A

    • Item 1
    • Item 2
    • Item 3

    Type B

    • Item 1
    • Item 2
    • Item 3

    Type C

    • Item 1
    • Item 2
    • Item 3

    Question:
    How do I combine the get_term_by() above with wp_query() to specify what custom taxonomy to display on an archive page?

    Thank you very much

  • The topic ‘custom taxonomies archive ttemplate and wp_query’ is closed to new replies.