My single entry page URL structure is as follows:


I want to have previous and next links on each single entry that are NOT limited to the category that is currently in the URL...I just need it to work by date alone, but I do need to retain this url structure...so basically when someone opens this link:


and clicks the next button it should take him to:


only sorting by entry date and ignoring the category as a filter

is this possible with some good queries or do I need an addon for it?

1 Answer 1


The Next/Prev entry links will not glean any category information in the URL, so you don't have to worry there.

This should work pretty easily with the Query module:

{exp:channel:next_entry channel="channel_name"}
    {exp:query sql="SELECT c.cat_url_title FROM exp_category_posts cp LEFT JOIN exp_categories c ON c.cat_id = cp.cat_id WHERE cp.entry_id = {entry_id} LIMIT 1"}
        <p>Next entry: <a href="/channel_name/{cat_url_title}/{url_title}">{title}</a></p>

(Use the same code for the prev_entry tag.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.