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'm developing a a site using the wp e-commerce plugin, and it handles tags in pretty much the same way it would if I were using it for a blog instead of a store.

The issue is that I want to use the tags as a secondary kind of navigation menu so that customers can view all items made from a certain material no matter what product category the item is in.

My issue is that the theme-functions page within wp e-commerce is causing certain tags to be in huge fonts as these tags are related to more products. What I want to do is be able to display each of the tags as links within <ul> <li> with each tag using the same sized font.

I understand some basics of php, but not enough to fully decode the theme functions file and edit it. I have considered waiting until I've got all of the products into the system then handcoding the list of tags, but then if my client wants to add more tags in the future they obviously won't be included.

If anyone has any insights or ideas Id be very greatful. I would post the code in question here but its about 200 lines long - but if it's needed in order to find the solution pls tell me so that I can add it.

share|improve this question
    
get_the_term_list? –  t31os May 3 '11 at 23:24

2 Answers 2

up vote 1 down vote accepted

you can use wp_list_categories() to output an unordered list:

<?php
wp_list_categories( array('taxonomy' => 'product_tag') );
?>
share|improve this answer
    
Thank you Milo - do you know which file I should put this into? Should I just hardcode this into the sidebar? the product tag widget file is still somewhat baffling to my N00B brain –  Screaming Violet May 5 '11 at 2:53

I use this for tag display on an archive page. its a ul, with each tag in an li. You'll see that 21 in the code. That is for only displaying tags with more than 21 posts assigned. You can change that number as you like.... If you have a lot of tags, it helps keep the riff raff out

                <h6><?php _e( 'Popular Tags', 'voodoo_lion' ); ?></h6>
                <ul>
                    <?php
                    $tags = get_tags();
                    foreach ($tags as $tag){
                        if ($tag->count < 21) continue;
                        $tag_link = get_tag_link($tag->term_id);
                        $html .= "<li><a href='{$tag_link}/' title='{$tag->name} Tag' >{$tag->name}</a>($tag->count)</li>";
                    }
                    echo $html;
                    ?>
                </ul>
share|improve this answer
1  
@Rev. Voodoo - shouldn't it be foreach($tags as $tag){...? ;) –  kaiser May 3 '11 at 20:04
1  
know what? it probably should! I must have screwed that up ages ago! It works as is, but yeah, you are corret! –  Rev. Voodoo May 3 '11 at 20:16
    
I use essentially the same thing as the Right Rev. Voodoo. –  Chip Bennett May 3 '11 at 20:26
    
If Screaming Violet is referring to the tags assigned to products created with the wp e-commerce plugin, the taxonomy is 'product_tags', they're not the default WordPress tags. –  Milo May 3 '11 at 21:17
    
@Rev. Voodoo - Other sidenote: it's normally faster if you first save something into a variable and then compare it, instead of the accessing the index on comparisson. Ex.: $term_id = $tag->term_id; $tag_link = get_tag_link(... should be faster. Also '<li><a href="'.$tag_link... is much faster as you avoid asking what <li> is. –  kaiser May 3 '11 at 22:00

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.