Next / Previous pages

Post Reply
User avatar
bayerberg
Master Bludit
Posts: 118
Joined: Wed Jun 07, 2017 1:05 pm
Contact:

Sun Jan 12, 2020 9:48 pm

I'm doing next/ previous pages this way

Code: Select all

echo'<div class="row">';

	$previousPageKey = $page->previousKey();
	$previousPage = buildPage($previousPageKey);
	$nextPageKey = $page->nextKey();
	$nextPage = buildPage($nextPageKey);

	echo'<div class="six columns center-text">';
	echo '<p class="title">Next post: <br/>  ';
	if ($page->nextKey()) {
		echo'&#8729; <a href="'.$nextPage->permalink().'">'.$nextPage->title().'</a>';
		echo'<div class="hovering-button left"><a href="'.$nextPage->permalink().'" >&laquo;</a></div>';
	} else {
	echo 'Hold your horses, this is the latest post';
	}
	echo'</p>';
	echo'</div>';
	echo'<div class="six columns center-text">';
	echo '<p class="title">Previous post: <br/> &#8729; ';
	if ($page->previousKey()){
		echo'<a href="'.$previousPage->permalink().'">'.$previousPage->title().'</a>';
		echo'<div class="hovering-button right"><a href="'.$previousPage->permalink().'" >&raquo;</a></div>';
		} else {
		echo ' No more posts. You reached the end.';
	}
	echo'</p>';
	echo'</div>';
	
echo'</div>';
and sometimes I wont get either one. Whats the issue? Looks ok to me...
bludit plugins and themes - makeitblu | I do things, check them out on behance | check out startups undiluted - london's startup ecosystem
Post Reply