Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I created a custom post called projects and a taxonomy called tagportfolio , in the admin panel i created 3 tags under this taxonomy to filter my projects

portfolio page

the three tags is

  1. Urban planning and upgrading
  2. Urban Design and Landscape
  3. Architecture and Interior Design

under each tag there is a posts , now i need to know how i can display the posts that under each tag for example: posts under tag Architecture and Interior Design in a page template

Thanks

N.B this is the custom post and taxonomy functions git://gist.github.com/3066834.git gist-3066834

this is how the child tax should be displayed {like the main tax} git://gist.github.com/3061479.git gist-3061479

share|improve this question
    
Please add the code you used to create both (taxonomy and custom post type) to your question. –  toscho Jul 7 '12 at 0:28
    
@ Toscho , i added in the question now –  Rasha Nour Eldin Jul 7 '12 at 15:17
add comment

1 Answer

up vote 0 down vote accepted

You're looking for WP_Query

echo '<ul>';

//The Arguments
$args = array(
    'post_type' => 'project',
    'tagportfolio' => 'urban-design-and-landscape' //should use the slug name not the full name
);

// The Query
$the_query = new WP_Query( $args );


// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
    echo '<li>';
    the_title();
    echo '</li>';
endwhile;

echo '</ul>';
share|improve this answer
    
not working thiago , i tried it :( –  Rasha Nour Eldin Jul 7 '12 at 17:51
    
there was an spell error on my post_type argument. I have looked into your code and youre already using WP_Query, so you should do in the same way but adding your tagportifolio filter. codex.wordpress.org/Class_Reference/… –  Thiago F Macedo Jul 10 '12 at 11:26
    
Also, if you havent yet, consider looking into Child Themes topic, especially using thematic. –  Thiago F Macedo Jul 10 '12 at 11:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.