Forums › Forums › Search & Filter Pro › Custom template escapes slashes?
Tagged: Custom template escapes slashes
- This topic has 3 replies, 2 voices, and was last updated 11 years, 8 months ago by
Ross.
-
Anonymous(Private) July 5, 2014 at 4:37 am #2173
I’m trying to use the template override when searching my woocommerce products.
The woocommerce templates are usually stored in ‘theme/woocommerce/archive-product.php’, but when entering ‘woocommerce/archive-product.php’ as custom template in the search form config, the slash is stripped so it becomes ‘woocommercearchive-product.php’.
Moving archive-product.php to the themes root folder seems to work, but then I have 2 template files serving the same prupose… Any other options?
Ross Moderator(Private) July 5, 2014 at 11:34 am #2175Hey Mike
I didn’t notice this! Unfortunately you’ll have to go with this for now, I’ll try to update the plugin so your slashes don’t get stripped and the correct path is resolved.
Thanks
Anonymous(Private) July 5, 2014 at 12:02 pm #2178Thanks for the help!
My fix for the time being is to simply create a new archive-product.php in the theme root with this:
<?php add_filter('body_class','my_class_names'); function my_class_names($classes) { // add 'class-name' to the $classes array $classes[] = 'woocommerce'; // return the $classes array return $classes; } include 'woocommerce/archive-product.php'; ?>i should note that my_class_names() is an unrelated fix 😉
Ross Moderator(Private) July 7, 2014 at 1:38 pm #2210Great thanks for the update, would be useful to other Woocommerce users too 🙂 Hope to get that problem solved in a forthcoming update.
Thanks
-
AuthorPosts