I'm moving my wordpress blog and I'm modifying one of the "URL generators". The blog is http://cruc.es and if you go to the bottom of the page you will see the numbers indicating pages. I got those to work by the next and the previous function are not working. I don't know enough about PHP to fix it. The code snippet is below and any help would be appreciated.
if ( $query->found_posts > $query->query_vars["posts_per_page"] ) {
echo '<ul class="paging">';
// Previous link?
if ( $page > 1 ) {
echo '<li class="previous"><a href="'.$baseURL.'/page/'.($page-1).'/'.$qs.'">previous</a></li>';
}
// Loop through pages
for ( $i=1; $i <= $query->max_num_pages; $i++ ) {
// Current page or linked page?
if ( $i == $page ) {
echo '<li class="active">'.$i.'</li>';
} else {
echo '<li><a href="'.$baseURL.'/?paged='.$i.'/'.$qs.'">'.$i.'</a></li>'; <<<-- I fixed this by making it paged=
}
}
// Next link?
if ( $page < $query->max_num_pages ) {
echo '<li><a href="'.$baseURL.'/page/'.($page+1).'/'.$qs.'">next</a></li>';
}
echo '</ul>';
}
I'm a complete n00b and I need some help
Moderator: General Moderators
Re: I'm a complete n00b and I need some help
You were able to alter the 1-X but not the Next and Previous links?
It's basically the same thing except you have a short expression instead of a variable.