NativePaul
Member
Posted 2 years ago #
I've been struggling with what I imagine is a very simple thing to do.
I'm editing my theme files and want to display the Product Category alongside the Product Name.
What is the php function to call the Category Name and URL to that category?
I was able to get the name using wpsc_category_name();
Although this doesn't retrieve anything on the products page. I want the category to be listed there too.
How can I retrieve the url to display all products in that category?
jimmyink
Member
Posted 2 years ago #
I'm also experiencing the same issue. I can retrieve the category name on the single product page but now when it's listed.
Keen to find out!
<?php /** show current category */ ?>
<?php $output .= "<div>" .wpsc_category_name(). "</div>"; ?>
yankeerudy
Member
Posted 2 years ago #
Was looking for this answer today and found it:
get_category_link($cat)
Use it within a page to get the category URL, while
single_cat_title()
will get you the category name.
yankeerudy
Member
Posted 2 years ago #
woops, spoke too soon -- that only worked on a category page, not on a single post page.
any updates on this. I am looking for something similar.
scarydakis
Member
Posted 1 year ago #
Ooops, wrong thread. Soz.