Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
- <div class="content-block designer-alpha">
- <?php #the_content();
- $termchildren = get_term_children( 57, "wpsc_product_category" );
- $firstLetter = "-1";
- $desiredColumns = 0; //you can change this!
- echo "<table style='margin: 0 auto; width: 100%;'><tr><td>";
- foreach ($termchildren as $key => $child) {
- $term = get_term_by( 'id', $child, "wpsc_product_category" );
- #print_r($term);
- if ($term->name[0] !== $firstLetter) {
- if( $desiredColumns!=0 && $desiredColumns%5==0) echo "</td></tr><tr>";
- $firstLetter = $term->name[0];
- if( $desiredColumns!=0 && $desiredColumns%5 == 0 )
- echo "<td>";
- else if($key!=0)
- echo "</td><td>";
- echo "<h4>".strtoupper($firstLetter)."</h4>";
- $desiredColumns++;
- }
- echo '<a href="' . get_term_link( $term->slug, "wpsc_product_category" ) . '">' . $term->name . '</a><br />';
- }
- echo "</td><tr></table>";
- ?>
- <div class="content"> </div>
- <div class="clear"></div>
- </div>
- <?php endwhile; ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement