WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP e-commerce] Want category query to make specifically-styled subcats (1 post)

  1. tracyberna
    Member
    Posted 3 years ago #

    I'm using the category_query process to list my site's product categories on the home page within some styled boxes I have set up. I'd like to bring in the subcategories as well under each parent category and I can, except the query gives all the subcategories the same styling as the parents and that's not what want - I want to be able to implement separate styling for the subcats.

    Here's the code I'm using:

    <ul>
       <?php wpsc_start_category_query($category_settings); ?><?php wpsc_start_category_query(array('category_group'=>  get_option('wpsc_default_category'), 'show_thumbnails'=> 1)); ?>
    	<li class='latest_product'>
    	    <a href="<?php wpsc_print_category_url();?>" title='<?php wpsc_print_category_name();?>'>
    	      <?php wpsc_print_category_image(145, 105); ?></a>
    		   <div class="product_info">
    		      <a href="<?php wpsc_print_category_url();?>"><?php wpsc_print_category_name();?></a>
    		       <?php wpsc_print_subcategory("<ul>", "</ul>"); ?>
    		  </div>
      </li>
    	<?php wpsc_end_category_query(); ?>
    </ul>

    A quick illustration of the output I want would be this:

    <"latest_product" li>
          <parent category group thumbnail>
                <"product_info" div>
                     <parent category name with link>
                          <ul, perhaps with a class name so I can style it>
                               <li>any subcategories for this category</li>
                                <li>any more subcategories for this category</li>
                           </ul>
                  </end "product_info div>
     </end "latest_product" li>

    Anyone know how I can do this?

Topic Closed

This topic has been closed to new replies.

About this Topic