WordPress.org

Ready to get started?Download WordPress

Forums

Calling 1000 archive and want pagination after 10 post (3 posts)

  1. singhabhishek251
    Member
    Posted 1 year ago #

    Hi everyone.
    I have a website and I am calling my 1000 post by using the code below in my page.php
    <?php wp_get_archives('type=postbypost&limit=1000'); ?>
    Everyting is working fine but:
    1.) I want to show 10 post at a time with Title and Excerpts.
    2.) After 10 post there should be pagination for Next...and Previous... so that people can access them as 1000 post on one page will be long.
    3.) This is not important but will be helpful- Post are showing only title one after one, I want to have them
    numberings like: 1.) ArchivePost1
    2.) Archivepost2,

    Preview of my archive post which I want on page should be like this:
    1.) Archive title
    archive description maybe 200 words
    2.) second post title in archive
    second post descrioption in archive...
    3.)...........
    <-Previous Next->

    Currently coming as
    title 1
    title 2
    title 3

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You cannot have any of the the features you want using wp_get_archives(). To do this, you would need to create a custom query. See:
    http://codex.wordpress.org/Function_Reference/query_posts
    http://codex.wordpress.org/Function_Reference/get_posts
    http://codex.wordpress.org/Function_Reference/WP_Query

  3. singhabhishek251
    Member
    Posted 1 year ago #

    Need more help, thanks for reply.
    I am a beginner and I am not able to figure it out. Can you help me solve this issue? This is my current code in page.php

    <?php
    get_header();
    if($page_id == 2) {
    echo do_shortcode('[smoothness-slider]');
    }
    
    if (!$kippis_is_smartphone) get_sidebar('left');
    ?>
    
          <div id="content">
            <?php
              the_post();
              get_template_part('content','page');
              if (comments_open()) comments_template('',true);
            ?>
    <?php if( is_page('5') ) { ?>
    <?php wp_get_archives('type=postbypost&limit=1000'); ?>
      <?php } ?>
          </div>
    
    <?php
    if ($kippis_is_smartphone) get_sidebar('left');
    get_sidebar('right');
    get_footer();

    [This is a volunteer-staffed free forum - not a chatl ine. No bumping. If it's that urgent, consider hiring someone.]

Topic Closed

This topic has been closed to new replies.

About this Topic