So…I’m back with more tips for WP Ecommerce, and this one is regarding the category description.
By default the category description shows in a default font and will not wrap to the next line on your page very well. So it ends up looking really bad. To solve this issue, login to your server and open up “products_page.php” in your wp-shopping-cart directory. Then on line 113, you’ll see this line:
1 | echo "< pre>".$category_data[0]['description']."< /pre>"; |
Change that line to look like this:
1 | echo " |
“.$category_data[0][‘description’].”
“;
That’s it!
So….until next time…
Adrienne says
Hi Shayne… this is such a wonderful fix, thanks so much for detailing the code changes here. I'm wondering if you could outline another tweak to give the category description some padding? Otherwise it's butting up against the category image. I really appreciate your efforts here to help us out with the webstore code.
Lheyanne says
Hi. I checked the products_page.php both in my wp-shopping-cart directory and the shop's theme. Both have have the already but the category title and description are still beside the image not on the next line.
Thanks. Happy New Year btw.
shayne says
Lheyanne, I'm not sure that is what this fix was supposed to do…if you'll use the contact form and send me login info, I'll take a look at it for you.
Gavin says
Hi Shayne,
I was wondering if anyone knew of any plans to develop the WP Ecommerce category description retrieval functions to incorporate an equivalent of get_the_excerpt() concatenation of the description, for use in templates?
Currently I am having to output buffer the description and use a manual function to limit the amount of words and append an ellipsis. This is a very poor solution as output buffering in PHP is notoriously slow and inefficient.
Thanks.
shayne says
Gavin,
Not that I know of…
Lesley Furber says
Hi Shayne, I’ve just found this – my category descriptions look terrible so I thought this could be the fix. However, I can’t find the ‘category data’ lines in my products_page.php – is it something different now? Thanks if you can help. Regards, Lesley