• daniel0001

    (@daniel0001)


    Hi all,

    I’m not using a standard wordpress setup where the blog part is usually on the front page – instead the index template is pretty much just static html for the most part. I do use the blog feature, but instead of putting wordpress in a separate directory I just made a custom page template that acts as if it were the front page on a regular WP blog. (e.g. lists the latest posts)

    It works fine except one thing, the pagination doesn’t work. When you click on the older/newer posts link WordPress doesn’t recognize it and returns a 404 error.

    This is the site structure:
    domain.com (Main Index Template)
    domain.com/blog (blog listing – a page using a custom page template)
    domain.com/blog/page/2 (this *should* return the second page of blog posts, but it doesn’t)

    So far I’ve gotten the blog page to generate previous posts URL with the correct url like domain.com/blog/page/2 (by default it would make the links domain.com/page/2). I’ve also gotten pagination to work by using a URL parameter (e.g. domain.com/blog?page=2), but now I just need it to map domain.com/blog/page/* to domain.com/blog?page=*

    Any tips?

Viewing 1 replies (of 1 total)
  • I had almost the same problem.. and my solution was:

    <?php
    		if (is_page('6')){
    			echo "<a href='/category/something/2/'>&laquo; Older tips</a>";
    		} else {
    			echo "<a href='/category/something/page/2/'>&laquo; Older news</a>";
    		}
    		?>
Viewing 1 replies (of 1 total)
  • The topic ‘Pagination on custom page templates’ is closed to new replies.