Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1443453

    Hi There,

    If you go into a post there is a previous arrow on the left. I would prefer a next arrow on the right so instead of going backwards, you are going forwards.

    Please can you assist? Let me know if you need more information.

    Here is an example – https://constantiaglen.com/31st-may-2024-steak-and-three/

    Kind regards,
    Camilla

    #1443546

    Hey engage24,

    Thank you for the inquiry.

    You can reverse the post navigation using the following filter. The arrows will stay in the same position, but the sorting of the posts will be reversed.

    add_filter( 'avf_post_nav_entries', 'avf_post_nav_entries_mod_reverse', 10, 3);
    
    function avf_post_nav_entries_mod_reverse($entries, $settings, $queried_entries)
    {
    
        $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;
    }
    

    Best regards,
    Ismael

    #1444075

    Hi Ismael,

    Great thanks – That worked well.

    If I keep clicking then I can see other posts in other categories. Is there a way to only show the specific category on those posts? If I keep clicking the arrow then I only want to see the posts in the winter winemakers dinner category not any other posts.

    Kind regards,
    Camilla

    #1444441

    Hi,
    Try this filter instead

    add_filter( 'avf_post_nav_entries', 'avf_post_nav_entries_mod_reverse', 10, 3);
    function avf_post_nav_entries_mod_reverse($entries, $settings, $queried_entries)
    {
        $settings['same_category'] = true;
        $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;
    }

    Best regards,
    Mike

    #1444976

    Hi Mike,

    Thanks so much, that worked perfectly.

    Kind regards,
    Camilla

    #1444992

    Hi,

    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.