Tagged: avia post nav, next, prev
-
AuthorPosts
-
June 28, 2016 at 8:43 pm #654466
I have the following code in my theme functions:
add_filter(‘avia_post_nav_categories’, ‘use_same_category_filter’);
function use_same_category_filter($same_category)
{
$same_category = true;
return $same_category;
}But I still see the Avia Post NAV directing me to Blog Posts, Webinars, White Pages and Press Releases. I would like for each of the previously mentioned categories to only show the Avia post navs for each respective category. How would I go about fixing this? Thank you!
July 1, 2016 at 11:39 am #655670Hey pricest,
Sorry for the late reply, could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Thanks,
RikardSeptember 1, 2016 at 4:53 pm #680842Was there a solution to this?
September 1, 2016 at 4:59 pm #680846Hi!
Please try using following code
add_filter(‘avia_post_nav_settings’,’avia_same_category_filter’, 10, 1); function avia_same_category_filter($settings) { $settings[‘same_category’] = true; return $settings; }
Cheers!
YigitSeptember 1, 2016 at 5:02 pm #680851Would that be to the functions.php in my child theme folder? Because I tried that and it didn’t seem to do anything.
- This reply was modified 8 years, 2 months ago by hotspot01. Reason: added content
September 1, 2016 at 9:34 pm #680974I’ve tried adding this code in my functions.php in the Enfold parent folder and it didn’t work and I also tried it in my child theme folder and it didn’t work either. Someone please help.
Here is some login info just incase you need to have a look. (See private content)
And here is an example of a post. historical image has a category of PAST but when I use the next and prev tabs it goes to different categories.
September 2, 2016 at 7:26 pm #681446BUMP
September 6, 2016 at 5:54 am #682441Hi,
You didn’t update the code (avia_post_nav_settings) in the functions.php file. Please remove browser cache or hard refresh the page. http://revcor.ca/borden-park-pool-1932/
Best regards,
IsmaelSeptember 7, 2016 at 4:11 am #682914Thank you SO MUCH Ismael! Works great now.
September 8, 2016 at 6:12 am #683494Hi,
Great, glad you got it working :-)
Please let us know if you should need any further help on the topic.
Best regards,
RikardApril 26, 2018 at 10:48 am #947181Thanks for this post, I’ll implement –
I also have an issue where avia post nav is showing the “Next” item on left of screen and the “Previous” item on the right.
I would prefer the opposite. I cannot find solution to reverse in WP enfold settings.
Any help appreciated, thanks in advanceApril 26, 2018 at 11:35 am #947205can you try this in functions.php of your child-theme:
by the way if you are having child-theme every snippet offered here comes to child-theme functions.php – thats the trickadd_filter( 'avia_post_nav_entries', 'enfold_customization_postnav', 10, 2); function enfold_customization_postnav($entries, $settings) { $entries['prev'] = get_next_post($settings['same_category']); $entries['next'] = get_previous_post($settings['same_category']); return $entries; }
April 26, 2018 at 11:40 am #947208BRILLIANT! Fixed, many thanks
April 27, 2018 at 10:12 am #947778Hi barra12,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaNovember 25, 2020 at 10:26 am #1262958Is there a way to navigate only inside each child category? In case of posts with more than one category?
It would allow us make different and restricted groups of navigation with same the posts.
Thanks.
MarcosNovember 25, 2020 at 9:11 pm #1263079Hi marcosrogero,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaJanuary 13, 2022 at 5:00 pm #1335459Hi there.
I tried the code from Yigit. Is it up to date?
It caused some warnings and did not solve the problem. And, yes I made a hard-refresh.Warning: Use of undefined constant ‘avia_post_nav_settings’ – assumed ‘‘avia_post_nav_settings’’ (this will throw an Error in a future version of PHP) in /homepages/x/xxxxxxxxxxx/htdocs/xxxxxxxxxxxxx/wp-content/themes/xxxxxxxxxx/functions.php on line 16
Warning: Use of undefined constant ’avia_same_category_filter’ – assumed ‘’avia_same_category_filter’’ (this will throw an Error in a future version of PHP) in /homepages/x/xxxxxxxxxxx/htdocs/xxxxxxxxxxxxx/wp-content/themes/xxxxxxxxxx/functions.php on line 16
Warning: session_start(): Cannot start session when headers already sent in /homepages/homepages/x/xxxxxxxxxxx/htdocs/xxxxxxxxxxxxx/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries/masonry_entries.php on line 81
Does anyone have the same problem and hopefully a solution?
Thanks
January 14, 2022 at 1:06 pm #1335575Hi,
@baucks: You have to use the avf_post_nav_settings filter now.Example:
add_filter("avf_post_nav_settings", function($settings) { $settings['same_category'] = true; return $settings; }, 10, 1);
If you have more questions or if you need further assistance with this topic, please feel free to open another thread. We will close this one for now.
Best regards,
Ismael -
AuthorPosts
- The topic ‘How to display Avia Post NAV with same category only’ is closed to new replies.