Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #305459

    I found that the Next/Previous Post Navigation on the Right/Left edges of the content page are in reversed order. Is there a way I can change that?

    Thanks,
    – CJ

    #305530

    Hi bemofunny!

    Thank you for using Enfold.

    Please add this on functions.php to reverse the post navigation order:

    add_filter('avia_post_nav_entries', 'avia_apply_custom_sort_order_to_post_nav', 10, 2);
    function avia_apply_custom_sort_order_to_post_nav($entries, $settings)
    {
    	if(!empty($entries['prev'])) $temp = $entries['prev'];
    	if(!empty($entries['next'])) $entries['prev'] = $entries['next'];
    	if(!empty($temp)) $entries['next'] = $temp;
    	return $entries;
    } 
    

    Cheers!
    Ismael

    #305542

    Thank you Ismael for the fix. I applied it and it sorta work with the following issues:

    1. On the first Post of a Category, the Previous and Next Nav pointing to the same Post (2nd Post in the Category). Should it be either disabled or Previous Nav pointing to the last Post of the Category?
    2. The Next Nav also doesn’t seem to stay in the same Category. Since I got to a Page that only show a particular Post in a set of Category, it should only navigate with Posts in that category instead of all posts.

    Regards,
    – CJ

    • This reply was modified 10 years, 3 months ago by bemofunny.
    #305576

    Hi!

    Please try this code:

    
    add_filter('avia_post_nav_entries', 'avia_apply_custom_sort_order_to_post_nav', 10, 2);
    function avia_apply_custom_sort_order_to_post_nav($entries, $settings)
    {
        $temp_prev = $entries['prev'];
        $temp_next = $entries['next'];
        $entries['prev'] = $entries['next'] = "";
        if(!empty($temp_next)) $entries['prev'] = $temp_next;
        if(!empty($temp_prev)) $entries['next'] = $temp_prev;
        return $entries;
    }
    

    It should also work for the first/last post.

    Cheers!
    Peter

    #305585

    Ah thank you Peter, That works!
    Is there anyway to not include items that are not in the set category as part of the Quick Nav?

    Thanks,
    – CJ

    #305622

    Hi!

    Please refer to Peter’s post here – https://kriesi.at/support/topic/portfolio-link-arrows/#post-245040

    Cheers!
    Yigit

    #305867

    Hi Yigit,

    I applied the code from Peter’s but it’s not working. I am using WP 3.9.2 and the latest version of Enfold.

    Thanks,
    – CJ

    #306384

    Hey CJ!

    Do you mind creating a temporary admin login and posting it here privately?

    Best regards,
    Yigit

    #306646
    This reply has been marked as private.
    #307191

    Hey!

    Check it now, i adjusted the code to work in posts:

      function category_specific_post_nav($settings)
      {
          if($settings['taxonomy'] == 'category')  $settings['same_category'] = true;  
          return $settings;
      }
    
      add_filter('avia_post_nav_settings','category_specific_post_nav', 10);

    Cheers!
    Josue

    #307224

    Josue,

    It still include items that are not part of a particular category.

    – JN

    #307226

    Hi!

    Can you post a link to a post where that happens?

    Regards,
    Josue

    #307229

    From here http://tht.nguyenle.me/blog/khai-tam-radio/

    3rd item on first row is Tuoi Giap Ngo entry.
    4th item is Tuong Trang cua Chu Dai Bi
    now if you click on 3rd item Tuoi Giap Ngo to view the post. The Quick Nav to next post is not the 4th item.

    Thanks,
    – CJ

    #307492

    Hi CJ!

    That’s because those Posts share the “Blog” category (so they get connected), you’d need to fix that first.

    Cheers!
    Josue

    #307515

    Josue,
    This is getting very frustrating. Every Post is part of Blog. The Blog can have many subCateogory: Audio, Video, Topic 1, Topic 2, etc. If you look at my Menu, the dropdown are all subCategory of Blog. So if I am in SubCategory called Audio. My quick Nav should NOT take me anywhere outside of Audio SubCategory. It’s very logical from UX perspective. Am I missing something?
    – CJ

    #307530

    Hello CJ,

    The problem is that the code we’ve suggested is meant to work with categories, not subcategories. For example, you can see that it is working fine here (a Post with no Blog category): http://tht.nguyenle.me/2014/07/15/banh-cuon-tay-ho-2/

    Best regards,
    Josue

    #307563

    Hi Josue,

    I think I almost got what you said but I am not fully understood it yet. So I unchecked all my posts from Blogs. That seems to solve some categories but not all. For example, The Quick Nav work in this category Veggie Cooking http://tht.nguyenle.me/blog/veggie-cooking/
    But not working for this category Nhóm Trẻ Compass Youth http://tht.nguyenle.me/blog/nhom-tre-compass-youth/. In this category the Quick Nav bleed into Veggie Cooking but not via versa. They both shared that same category that they are also Video.

    My reason is that if the Index page able to display the correct set of posts. Then the Quick Nav should be able to target the right post only in that set . Quick Nav should work not only in Category but also Sub-Category and Sub-sub Category if needed. An item/post should be allowed to be in more than one category. I am arguing from an User Experience point of view. There should be a logical way (coding technique) to fix this.

    Thanks,
    – CJ

    #307573

    Hi CJ!

    I understand your argue but this is more of a WordPress limitation, the navlinks make use of this function to work, the code we suggest just enables the “in_same_term” parameter. I’d suggest discarding the shared Categories from posts and using Tags instead for that kind of categorization.

    Best regards,
    Josue

    #308323

    Hi Josue,

    Could you please elaborate on that a little? How do I fix this issue using tags? Currently I removed all posts from Blogs and it’s still not working. Are you suggesting that each Post should only belong to only one Category and then use tags instead? But not sure how would that solve my use case. For example, an user going into a Category A to find my posts. He may want to go to to Category B to view my posts also. And there is an entry that belongs to both Categories. So could you show me how to use tag to solve my use case?

    Thanks,
    – CJ

    #308585

    Hey!

    Like Josue said, this is a WP limitation and aside from the suggestions above, I don’t think we will be able to help you further. The customization you’re asking falls beyond the scope of support. Please visit Envato Studio or Werkpress for further customization. You can also vote or post the feature on our Feature Requests page.

    Thank you for understanding.

    Cheers!
    Ismael

    #545454

    With something like this it should be possible to get rid of the image???

    Can you help me with a short php snippet to remoe the image in the post nav?

    #545458

    Hey!


    @hunter74
    I have already replied you here – https://kriesi.at/support/topic/remove-thumbnail-in-avia-post-nav/#post-545450 and mentioned that it is not possible as there is no hook for it. Let us stick to your topic.

    Cheers!
    Yigit

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Next and Previous Post Navigation is in reversed order’ is closed to new replies.