• buditanrim

    (@buditanrim)


    Hi I’m working on my wordpress themes
    But I don’t know why the pagination doesn’t work in blog template
    I want to show just 2 posts in page and then pagination.

    my site: https://duokter.dotatime.com/
    blog page : https://duokter.dotatime.com/?page_id=245

    The problem is in the blog page
    It is show the “older posts” in the bottom of page, but when I click it. Its going to the same page, not the previous post.

    this is the code inside my blog-template.php for the pagination

    <div class="pagination">
    			<p class="prev">
    				<?php next_posts_link('Older posts'); ?>
    			</p>
    			<p class="next">
    				<?php previous_posts_link('Newer posts'); ?>
    			</p>
    		</div>

    my post are:
    1 Lorem Ipsum
    2 Overlock Motherboard PCP+ Griffonomex III (with featured img)
    3 zzzzzzzzzzzzzzzz
    4 aaaaaa
    5 Welcome to

Viewing 2 replies - 1 through 2 (of 2 total)
  • vtxyzzy

    (@vtxyzzy)

    In order for pagination to work, you must include the ‘paged’ argument to your query. It usually looks something like this:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("posts_per_page=2&paged=$paged"); ?>
    Thread Starter buditanrim

    (@buditanrim)

    Hi thanks to fast respond !!
    I will try

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘help me, the pagination doesn't work’ is closed to new replies.