Following on from our tutorial on Adding Custom WP_Query Loops in Bricks, in this pro tutorial we'll walk through the process of using those same Bricks' filters to allow us to build custom adjacent posts ( or prev/next posts ) for use on a single post template.
We can then set up this query on the container element, meaning we can then build the layout how we like by placing elements inside and using any dynamic data from those posts. This gives us much more flexibility than using the native 'post navigation' element.
Adding the Adjacent Post Query
This code would need to be added outside of the builder, either inside your child theme’s functions.php file or a code snippet manager such as WPCodeBox.
This is a BricksLabs Pro tutorial.
For full access login below or create your BricksLabs Pro account
Like the other users, I’m also looking to sort the previous and next posts based on a custom numeric field, created using MetaBox. Would you be able to provide some guidance on how to achieve this? Thank you in advance! 🙂
This needs custom coding. I am working on this. Will post a new tutorial once I have it working.
Is there a possibility to sort the Adjacent Post Query by an ACF field (meta_key), so that it matches the overview page?
Better late than never.
Thanks for the tutorial.
I have the post archive sorted by a ACF number value. Is it possible to align the sorting of the prev/next button to the same ACF number value?
If I implement the code as is, the sorting of the archive and the prev/next buttons does not line up, as they seem to be sorted by a different value.
Sadly there is no answer for over 1 month…. Hello????