Tagged: portfolio category
-
AuthorPosts
-
January 20, 2016 at 4:42 pm #568733
Hi guys
I have reordered my portfolio items so they are alphabetized in the side navigation (using post types order plugin – doesn’t seem to be the default in the theme?). I would like to be able to limit which items are visible there – is it possible to sort it / hide portfolio categories? I have items from 2015 that I don’t want in this year’s navigation, and the same will be the case in 2017.
thanks for your help
NancyJanuary 22, 2016 at 1:54 am #569658Hi Munford!
You can use this code to make it so the post nav show only posts within the same category:
add_filter('avia_post_nav_categories', 'use_same_category_filter'); function use_same_category_filter($same_category) { $same_category = true; return $same_category; }
Regards,
JosueJanuary 22, 2016 at 11:38 am #569919thanks – do I need to specify somewhere that I want only “2016” category?
January 22, 2016 at 4:31 pm #570197Hey!
To clarify, when you are on an item with “2016” category, post navigation will only go through the posts with the same category.
Regards,
YigitJanuary 22, 2016 at 5:03 pm #570216yes, that’s what I want.
January 22, 2016 at 5:04 pm #570217should that go in the functions.php?
January 22, 2016 at 5:28 pm #570228Hi!
Yes, please add the code Josue posted into functions.php file in Appearance > Editor
Best regards,
YigitJanuary 22, 2016 at 6:34 pm #570267thanks – I added that but am not seeing what I wanted.
the page linked below should be the last item in the category “2016” but the side nav continues to the next item which is in “2015”January 24, 2016 at 4:22 am #570680Hi,
Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueJanuary 24, 2016 at 10:53 am #570739sure thanks for taking a look
January 26, 2016 at 8:51 am #571952Hey!
We modified the code a bit. Please remove browser cache or hard refresh the page.
Cheers!
IsmaelJanuary 26, 2016 at 10:33 am #571997Thanks – seemed to work regarding the categories, but the order of the portfolio items is now reversed (Z – A instead of A – Z) – can that be fixed?
thanks!
January 27, 2016 at 10:01 am #572713Hey!
Alright. We modified the code again.
add_filter('avia_post_nav_settings','avia_same_category_filter', 10, 1); function avia_same_category_filter($settings) { $settings['same_category'] = true; return $settings; } add_filter( 'avia_post_nav_entries', 'enfold_customization_postnav', 10, 2); function enfold_customization_postnav($entries, $settings) { $entries['prev'] = get_next_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']); $entries['next'] = get_previous_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']); return $entries; }
Cheers!
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.