-
AuthorPosts
-
February 16, 2016 at 11:18 am #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,
EnffieFebruary 16, 2016 at 11:20 am #584066Hey 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,
YigitFebruary 18, 2016 at 5:30 am #585143Hi,
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.
February 19, 2016 at 5:08 am #585830Hi,
Thanks for the details but we will need a URL as well, could you post that as well please?
Regards,
RikardFebruary 19, 2016 at 7:44 am #585887Hi,
Sorry for my mistake! Please see in private content:
- This reply was modified 8 years, 9 months ago by trianglehomeware_.
February 21, 2016 at 5:32 pm #586700Hi,
Sorry for my mistake! Please see in private content:
February 21, 2016 at 6:25 pm #586704i 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, 9 months ago by Guenni007.
February 22, 2016 at 10:36 am #587005Hi,
Thanks for your suggestion, but it is not working after I add the code to Functions.php
:(Enffie
February 22, 2016 at 1:56 pm #587099but we are talking about child-theme functions.php ? this is correct ?
February 23, 2016 at 10:47 am #587616Hi,
Yes, I have tried functions.php both enfold and child enfold, but it still doesn’t work.
Enffie
February 23, 2016 at 11:43 am #587623are 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
February 24, 2016 at 7:31 am #588184Hi Enffie,
Did you manage to get your problem solved? If not then please let us know and we’ll have a closer look.
Thanks,
RikardFebruary 24, 2016 at 9:40 am #588252Hi Rikard,
Not yet. I am still waiting for you to help. :)
Please use the login ID I mentioned above.
Thank you!Enffie
February 24, 2016 at 10:45 am #588279And please tell us what it was – the code above works on all my installations.
February 24, 2016 at 11:31 am #588292February 25, 2016 at 10:06 am #588844Hi!
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=editThese 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,
IsmaelFebruary 25, 2016 at 12:33 pm #588992aha – that was the gist of the matter
February 26, 2016 at 4:18 am #589553Hi,
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
-
AuthorPosts
- The topic ‘Post pre & next arrow linking’ is closed to new replies.