WordPress.org

Forums

[Plugin: Wp-e-commerce] Get category name & url (7 posts)

  1. NativePaul
    Member
    Posted 5 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?

  2. jimmyink
    Member
    Posted 5 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!

  3. gaf
    Member
    Posted 5 years ago #

    <?php /** show current category */   ?>
    	<?php $output .= "<div>" .wpsc_category_name(). "</div>";  ?>
  4. yankeerudy
    Member
    Posted 5 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.

  5. yankeerudy
    Member
    Posted 5 years ago #

    woops, spoke too soon -- that only worked on a category page, not on a single post page.

  6. amogle
    Member
    Posted 4 years ago #

    any updates on this. I am looking for something similar.

  7. Steph
    Member
    Posted 4 years ago #

    Ooops, wrong thread. Soz.

Topic Closed

This topic has been closed to new replies.

About this Topic