Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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
    Anna

    Telemar Spa

    #731763

    Hey 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,
    Basilis

    #731952

    Hi
    thank you for your help, but it doesn’t work: it appears an error.
    Are you sure it is written correct?

    #731953

    Sorry,
    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
    Anna

    #733044

    Hello, did you control the site?
    Do you have any idea?
    Thanks
    Anna

    #733432

    Hi,

    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,
    Ismael

    #733962

    Hello, 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 Anna

    #735825

    Hi,

    I’m not sure why it’s not working. The settings look correct. Did you duplicate those products?

    Best regards,
    Ismael

    #741100

    Hi, i imported the products with wp all import, they are not duplicated.. maybe this depends because one product has multiple categories?

    #743107

    Hi,

    If the product has multiple categories, the post navigation should return adjacent posts that belong to any of those categories. Please upgrade your WordPress installation to 4.7.2. I’m not sure if this is going to help but it’s worth a try.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.