How do I get next/prev post URL?


#1

Hi there,

I set 5 to posts per page in post widget in dashboard. This is OK for mobile view, however I want 1 post per page for desktop(non-mobile) view. So I added <b:if data:isFirstPost == “true”’> condition in <b:loop values=‘data:posts’ var=‘post’> loop. This works good except next/prev pager. Because newerPageURL/olderPageURL specifies the newer/older post by 5 from the current post. How do I get next/prev post URL from current post in chronological order?


#2

You can not control the display of widgets on Blogger Mobile view unless you create a custom Mobile stylesheet for your template, through which you can better control the look and appearnce of your layout structure in both Desktop and Mobile view using the CSS3 Media queries.

At present this is not possible if you have enabled the Default Blogger mobile view.


#3

Thank you for the reply Mohammand.

I’m using default Blogger mobile view and happy with it. What’s annoying me is desktop view pager, as next/prev link points to the post 5 posts apart as I skip following 4 posts in iteration loop.(I set 5 posts per page)

Pager widget gives newerPostURL/olderPostURL, but what I want is the URL for adjacent next/previous post.

Is there a way to get these URLs from current post-ID?