-
AuthorPosts
-
August 17, 2014 at 7:09 pm #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,
– CJAugust 18, 2014 at 4:03 am #305530Hi 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!
IsmaelAugust 18, 2014 at 4:46 am #305542Thank you Ismael for the fix. I applied it and it sorta work with the following issues:
- 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?
- 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.
August 18, 2014 at 6:31 am #305576Hi!
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!
PeterAugust 18, 2014 at 7:13 am #305585Ah 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,
– CJAugust 18, 2014 at 11:13 am #305622Hi!
Please refer to Peter’s post here – https://kriesi.at/support/topic/portfolio-link-arrows/#post-245040
Cheers!
YigitAugust 18, 2014 at 5:26 pm #305867Hi 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,
– CJAugust 19, 2014 at 3:56 pm #306384Hey CJ!
Do you mind creating a temporary admin login and posting it here privately?
Best regards,
YigitAugust 20, 2014 at 8:34 am #306646This reply has been marked as private.August 21, 2014 at 7:23 am #307191Hey!
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!
JosueAugust 21, 2014 at 9:18 am #307224Josue,
It still include items that are not part of a particular category.
– JN
August 21, 2014 at 9:26 am #307226Hi!
Can you post a link to a post where that happens?
Regards,
JosueAugust 21, 2014 at 9:32 am #307229From 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,
– CJAugust 21, 2014 at 6:57 pm #307492Hi CJ!
That’s because those Posts share the “Blog” category (so they get connected), you’d need to fix that first.
Cheers!
JosueAugust 21, 2014 at 8:10 pm #307515Josue,
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?
– CJAugust 21, 2014 at 9:16 pm #307530Hello 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,
JosueAugust 21, 2014 at 10:58 pm #307563Hi 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,
– CJAugust 22, 2014 at 12:15 am #307573Hi 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,
JosueAugust 23, 2014 at 10:55 pm #308323Hi 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,
– CJAugust 25, 2014 at 4:54 am #308585Hey!
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!
IsmaelDecember 1, 2015 at 6:29 pm #545454With 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?
December 1, 2015 at 6:32 pm #545458Hey!
@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 -
AuthorPosts
- The topic ‘Next and Previous Post Navigation is in reversed order’ is closed to new replies.