Dynamically restart div based on taxonomy
-
Hi all!
First of all, sorry for my confusing title (if it confused you) but the forum keeps cutting it in half.
Secondly, this is my first post (woot!).Alright, lets get back to business:
Unfortunately I have a hard time trying to define/explain what exactly I need help with, thus I will use images and descriptive text to explain what I am trying to do..I have set up several custom taxonomies to organize a resume.
This is the basis as of right now:Department (where on the resume?) --Experience --Education --Profile --Add extra Organization (what company / school?) --Organization 1 --Organization 2 --Add extra Time Period (How long?) --Add
This is what I am trying to create:
http://imageshack.us/photo/my-images/585/righty.jpg/
However it looks like this:
http://imageshack.us/photo/my-images/204/notright.jpg/I hope your seeing my problem / issue here..
Here is the current code:
http://pastebin.com/jQdfvgJ3As you see I currently have two loops, one for the education department and one for the experience department. And this solves the problem / achieve the results I want.. however if I would add another department I will have to add another loop..
What I am trying to do is create the same effect without adding extra loops, each time.Hopefully this makes sense.
Thanks in advanced,
RuudBtw, I did find a post that had a similar problem / solution but I can’t find it anymore.
EDIT01:
I found the post I talked about above:
http://wordpress.org/support/topic/dynamic-variable-for-custom-taxonomy-in-loop?replies=16However, this code (after adjusting to my taxonomies):
<!-- BEGIN CODE FOR PRODUCT AREA --> <?php $prod_cats = get_terms('product_cat'); foreach ($prod_cats as $prod_cat) { $cat_name = $prod_cat->name; ?> <div id="products"> <!-- post begin --> <?php $loop = new WP_Query( array( 'post_type' => 'product_listing', 'posts_per_page' => 4, 'product_cat' => $cat_name ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class="product-tease" id="post-<?php the_ID(); ?>"> <div class="upper"> <h3><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <p align="center"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo catch_that_image() ?>" /></a></p> <?php the_excerpt('Read the rest of this entry »'); ?> </div> <span class="btn-readon"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read On</a></span> </div> <?php endwhile; ?> <br clear="all" /> <!-- post end --> <br clear="all" /> <?php wp_reset_query(); ?> <?php rewind_posts(); ?> </div> <?php } // End foreach $prod_cats ?>
does not work, it only shows one department.
- The topic ‘Dynamically restart div based on taxonomy’ is closed to new replies.