Support Forum

Content of the article

You need to log-in to create request (topic) to the support

init_only_on

This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see green button on the right side) and press Save button.
If you not got email within 24 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi,

I have the WOOF filter set up on my site and it is working well. I would like to limit the filter to only appear on certain category pages. I currently have a function that displays a header and calls the short code and hooks into the product category archive pages. I can limit the function to only appear on certain pages using "if (is_product_category ('heritage'))" but I would like to use the "Init plugin on the next site pages only" function to control this so my customer can easily change which pages it displays on. Can you suggest how I can pick up the init_only_on settings in my function to do this. The function is:

function display_city_filter() {
if ("some method to detect if the category is included in the setttings page") {
echo '<h3>Product Filters</h3>';
echo do_shortcode("[woof sid ='flat_grey woof_auto_3_columns']"); }
}
add_action('woocommerce_before_shop_loop', 'display_city_filter', 15);

 

Thanks

Hello

Try  to use:

function display_city_filter() {
if ( shortcode_exists( 'woof' )) {
echo '<h3>Product Filters</h3>';
echo do_shortcode("[woof sid ='flat_grey woof_auto_3_columns']"); }
}
add_action('woocommerce_before_shop_loop', 'display_city_filter', 15);

Thanks - that worked perfectly!

Hello

 

Welcome;)