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

    #655670

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

    #680842

    Was there a solution to this?

    #680846

    Hi!

    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!
    Yigit

    #680851

    Would 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
    #680974

    I’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.

    http://revcor.ca/borden-park-pool-1932/

    #681446

    BUMP

    #682441

    Hi,

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

    #682914

    Thank you SO MUCH Ismael! Works great now.

    #683494

    Hi,

    Great, glad you got it working :-)

    Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

    #947181

    Thanks 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 advance

    #947205

    can 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 trick

    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']);
        $entries['next'] = get_previous_post($settings['same_category']);
        return $entries;
    }
    #947208

    BRILLIANT! Fixed, many thanks

    #947778

    Hi barra12,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1262958

    Is 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.
    Marcos

    #1263079

    Hi 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,
    Victoria

    #1335459

    Hi 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

    #1335575

    Hi,


    @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

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘How to display Avia Post NAV with same category only’ is closed to new replies.