Custom Post Type Taxonomy as Tabs w/ following div with id of taxonomy term.
-
I’m at the end of my rope. Here is what I am trying to do:
I’m using jQuery UI to have some tabs on my page.
The markup for the tabs needs to be
<ul> <li><a href="#tab-1">Taxonomy Term 1</a></li> <li><a href="#tab-2">Taxonomy Term 2</a></li> <li><a href="#tab-3">Taxonomy Term 3</a></li> </ul> <div id="tab-1> All posts that have been assigned Taxomnomy Term 1 </div> <div id="tab-2> All posts that have been assigned Taxomnomy Term 1 </div> <div id="tab-3> All posts that have been assigned Taxomnomy Term 1 </div>
The un-ordered list for the tabs is generated using this:
<!-- !Get the tabs --> <ul> <?php $args=array( 'orderby' => 'name', 'order' => 'ASC', 'taxonomy' => 'team' ); $categories=get_categories($args); foreach($categories as $category) { echo '<li><a href="#tab-' . $category->term_id . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> '; } ?> </ul>
I need to figure out how to roll out a loop that would have each div get assigned an id of the taxonomy term id and then display all the posts from that term. then repeat for all the different terms.
Does this make any sense?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom Post Type Taxonomy as Tabs w/ following div with id of taxonomy term.’ is closed to new replies.