-
AuthorPosts
-
January 10, 2017 at 6:54 pm #731679
Hello
in my single product page i would like to move with next prev arrows to see the other products of the same category but i saw it isn’t so..
So i tried to put the function in my child-theme functions.php :add_filter(‘avia_post_nav_settings’,’avia_same_category_filter’, 10, 1);
function avia_same_category_filter($settings) {
$settings[‘same_category’] = true;
return $settings;
}But making this the arrows disappear!! so which could be the problem?
I have some subcategories, maybe is for that reason??I give you the link of my website, could you please check it?
Thank you very much
AnnaTelemar Spa
January 10, 2017 at 11:07 pm #731763Hey telemarwa!
Please try the function as following
add_filter('avia_post_nav_settings','avia_same_category_filter', 10, 1); function avia_same_category_filter($settings) { $settings['same_category'] = true; return $settings; }
let us know if it works!
Regards,
BasilisJanuary 11, 2017 at 9:46 am #731952Hi
thank you for your help, but it doesn’t work: it appears an error.
Are you sure it is written correct?January 11, 2017 at 9:52 am #731953Sorry,
the string is correct but it doesn’t work: when i added it the prev next arrows disappear..
can you take a look at the site?
i give you the credentials
Thanks
AnnaJanuary 13, 2017 at 9:43 am #733044Hello, did you control the site?
Do you have any idea?
Thanks
AnnaJanuary 14, 2017 at 4:08 am #733432Hi,
Please replace the code with the following.
add_filter('avia_post_nav_settings', 'avia_post_nav_settings_mod'); function avia_post_nav_settings_mod($settings) { if(is_singular('product')) { $settings['taxonomy'] = 'product_cat'; $settings['is_fullwidth'] = false; } $settings['same_category'] = true; return $settings; }
Best regards,
IsmaelJanuary 16, 2017 at 9:49 am #733962Hello, thank you for your answer, butit works only with the first level of sub-category.. with sub-sub-category doesn’t work, see the link attached..
is there a solution?
thanks AnnaJanuary 19, 2017 at 1:11 pm #735825Hi,
I’m not sure why it’s not working. The settings look correct. Did you duplicate those products?
Best regards,
IsmaelFebruary 1, 2017 at 9:45 am #741100Hi, i imported the products with wp all import, they are not duplicated.. maybe this depends because one product has multiple categories?
February 6, 2017 at 3:29 am #743107 -
AuthorPosts
- You must be logged in to reply to this topic.