Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Next/previous page link style wordpress

I'm creating this Wordpress-theme and everythings going smooth, except for one thing. I would like to style my next/previous page links so that the next page-link is on the right side, and the previous page-link is on the left side. This is the auto-generated links that wordpress adds to the bottom of the page whenever the number of posts reaches it's maximum. I use the posts_nav_link() function, and my html code looks like this:

<p><?php posts_nav_link(' | ','<-- Previous page', 'Next page -->'); ?></p>

Sure, I can add float to the style of the <p> tag, but then both of the links will float either right or left. I want them to be on both left and right, and I really don't want a previous link on the first page (there's of course no content previous to the first page) or a next link on the last page.

Is there an easy way to do this? I'm new to this, so bear with me

like image 836
Håvard Brynjulfsen Avatar asked Dec 02 '25 04:12

Håvard Brynjulfsen


1 Answers

Use next_posts_link and previous_posts_link instead, then you can output them separately and style them individually.

like image 161
CBroe Avatar answered Dec 04 '25 18:12

CBroe