Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #584063

    Hi,

    My portfolio page hasn’t the button to browse next product and pre product at the current category, the post pre and post next function is only show the products in accordance with the order of post. It would be weird when someone browsing the category A and then turn to category B by clicking the post pre or next button.
    Could you help me to set it not to across the categories? Looking forward to your reply,thanks.

    Regards,
    Enffie

    #584066

    Hey Enffie!

    Please add following code to Functions.php file in Appearance > Editor

    add_filter('avia_post_nav_categories', 'use_same_category_filter');
    function use_same_category_filter($same_category)
    {
    $same_category = true;
    return $same_category;
    }

    Best regards,
    Yigit

    #585143

    Hi,

    Thanks for your help. But it doesn’t work after adding the code, could you please help to check? Please find private content for the login info.

    #585830

    Hi,

    Thanks for the details but we will need a URL as well, could you post that as well please?

    Regards,
    Rikard

    #585887

    Hi,

    Sorry for my mistake! Please see in private content:

    #586700

    Hi,

    Sorry for my mistake! Please see in private content:

    #586704

    i got this code for it:

    it is only missing the [‘same_category’] rule

    so this might work:

    add_filter('avia_post_nav_categories', 'use_same_category_filter');
    function use_same_category_filter($same_category)
    {
    $same_category['same_category'] = true;
    return $same_category;
    }

    i suppose its because of filtername Yigit has forgotten it (to similar so he thought he has set it)

    • This reply was modified 8 years, 10 months ago by Guenni007.
    #587005

    Hi,

    Thanks for your suggestion, but it is not working after I add the code to Functions.php
    :(

    Enffie

    #587099

    but we are talking about child-theme functions.php ? this is correct ?

    #587616

    Hi,

    Yes, I have tried functions.php both enfold and child enfold, but it still doesn’t work.

    Enffie

    #587623

    are you using any caching plugin? (W3TC or WP Super Cache etc.)
    if – clear cache:

    i use this code for it:

    add_filter( 'avia_post_nav_settings', 'enfold_customization_same_cat' );
    function enfold_customization_same_cat( $s ) {
        $s['same_category'] = true;
      return $s;
    }

    but it is the same as above with different custom function names

    #588184

    Hi Enffie,

    Did you manage to get your problem solved? If not then please let us know and we’ll have a closer look.

    Thanks,
    Rikard

    #588252

    Hi Rikard,

    Not yet. I am still waiting for you to help. :)
    Please use the login ID I mentioned above.
    Thank you!

    Enffie

    #588279

    And please tell us what it was – the code above works on all my installations.

    #588292

    Hi

    #588844

    Hi!

    We modified the code a bit but I think it’s not going to work the way you expect because the portfolio items contain the same category (ex:”hot-sale-products”) aside from their main category. For example:

    http://www.trianglehomeware.com/wp-admin/post.php?post=10617&action=edit
    http://www.trianglehomeware.com/wp-admin/post.php?post=10281&action=edit

    These two items belong to different categories but since they share the same category (“hot-sale-products”), the navigation will still filter through these items because technically they belong to the same category (“hot-sale-products”).

    This is the modified code:

    add_filter('avia_post_nav_settings', 'avia_post_nav_settings_mod');
    function avia_post_nav_settings_mod($settings)
    {
      if(is_singular('portfolio')) {
           $settings['taxonomy'] = 'portfolio_entries';
      }
    	$settings['same_category'] = true;
    	return $settings;
    }

    Best regards,
    Ismael

    #588992

    aha – that was the gist of the matter

    #589553

    Hi,

    I see. If you could solve this problem that would be great. But anyway, besides the hot sale products, I have got the way what I expect.
    Thank you!

    Enffie

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Post pre & next arrow linking’ is closed to new replies.