Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8176999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:23:46+00:00 2026-06-06T23:23:46+00:00

I have a Next/Previous button on my blog, which works great when you start

  • 0

I have a Next/Previous button on my blog, which works great when you start viewing from the homepage and going backwards (in order going back or forward through posts). I use this:

<div><h4><span><?php next_post('% &lsaquo;&lsaquo;&lsaquo;',  'Previous', 'no', 'no'); ?></span>
 <span> <div class="right"><?php previous_post('&rsaquo;&rsaquo;&rsaquo;  %', 'Next', 'no', 'no'); ?></span>
 </h4></div>

However, every post is split into categories and I have a menu for every category…this is when i run into problems. I use the above code in the single.php, but when you click on a post within its category and click next/previous…it goes to the next or previous post which was posted at the time of that particular post…not category.

Is it possible to do the following: if the user visits and continues browsing the ste normally (viewinng the posts in the order I posted them) then the next/previous buttons work as normal, but if user is browsing via a category, the next and previous buttons will know this and take the user through the rest of those post?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:23:49+00:00Added an answer on June 6, 2026 at 11:23 pm

    It might be possible that you just append a parameter to the URL if the user comes from the front page. So you had:

    http://path.to/blog/article/url/?fromhome=true

    and could check it when you call the previous_post method. If it is set, you can modify its parameters so it displays all posts, otherwise you would display only posts from the same category. (Don’t forget to pass the fromhome parameter to the next/previous post links!)

    Edit: You can use the post_link filter to modify the links in the permalink/next_post methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have got a little slideshow. It works fine with the previous and next
I am in great trouble....How can i set next and previous button/arrow at my
I have a simple slideShow with a next and previous button. Here are my
I have an .asp page (index.asp) with a previous and next button in the
I have 10 images on a page which has 2 buttons: next and previous.
Continuous JavaScript Scroller I have below script which is working on next and previous
I have created a bar over the keyboard for textfields with previous/next/done button selections.
I have an image gallery which works great. When the last slide is reached
Hi I have been trying to create a crossfade plugin with previous and next
I have next 2 blocks of code: def replace_re(text): start = time.time() new_text =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.