L
L
ligisayan2016-02-08 17:08:59
WordPress
ligisayan, 2016-02-08 17:08:59

How to get the link of the woocommerce category page I'm on?

There is an online store on wordpress + woocommerce. Question: how to get a link to the product category page where I am. Yes, such a call will work directly, but I need to replace the specific id=3577 with a variable that will receive the id of a specific category. How to do it?
echo get_term_link( 3577 ,'product_cat');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
ligisayan, 2016-02-09
@ligisayan

$itemcat = get_query_var('term'); //Ярлык текущего элемента таксономии
    echo get_term_link( $itemcat ,'product_cat'); //ссылка на таксономию

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question