How do I auctomatically set new posts to go to another page?

Discussion in 'HTML & Website Design' started by Nokiasony.com, Jul 19, 2009.

  1. #1
    Hi

    I use wordpress for my website design and I was wondering how I could automatically set wordpress to allow a maximum of 10 posts on a page and put the 11th post in another page.

    Many Thanks ;)
     
    Nokiasony.com, Jul 19, 2009 IP
  2. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #2
    It does that by default :confused:
     
    qazu, Jul 20, 2009 IP
  3. Nokiasony.com

    Nokiasony.com Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #3
    I thought it would, but the Previous and Next page buttons do not appear at the bottom of the page for some reason. Could there be a missing code somewhere?
     
    Nokiasony.com, Jul 21, 2009 IP
  4. vahsi000

    vahsi000 Well-Known Member

    Messages:
    706
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Look under Settings->Reading once you've logged in as Admin.
     
    vahsi000, Jul 21, 2009 IP
  5. Nokiasony.com

    Nokiasony.com Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #5
    There doesn't seem to be anything wrong in the 'Reading' section:

    Blog pages show at most = 10 posts
    Syndication feeds show the most recent = 10 posts
     
    Nokiasony.com, Jul 21, 2009 IP
  6. vahsi000

    vahsi000 Well-Known Member

    Messages:
    706
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    140
    #6
    try reducing it to 9?
     
    vahsi000, Jul 21, 2009 IP
  7. Nokiasony.com

    Nokiasony.com Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #7
    No unfortunately reducing it to 9 posts did not solve the problem.
     
    Nokiasony.com, Jul 21, 2009 IP
  8. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #8
    Yes, it's probably a line missing in the index.php file. That was the case on one of the templates I used. Which template are you using?
     
    qazu, Jul 26, 2009 IP
  9. Nokiasony.com

    Nokiasony.com Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #9
    I am using 'mts gossip' theme. What code do I need to add to the index.php file and where will I need to add the code?

    Thanks
     
    Nokiasony.com, Jul 26, 2009 IP
  10. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #10
    I couldn't find a 'mts gossip' theme but I've found a 'mts gossip rag' theme. Hopefully it's the same one. The 'mts gossip rag' theme doesn't have the next/previous links. You need to add this code to the index.php page:
    
    <div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?>  </div>
    <div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?>    </div>
    
    Code (markup):
    Add it between line 42 (after the endif) and Line 43 (before the sidebar). Like this:
    
    <?php get_header(); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post();  
          $loopcounter++; ?>          
    <?php if ($loopcounter  == 1) { ?>
    <?php include (TEMPLATEPATH . '/ads-content.php'); ?>         
    <div class="entry">
      <div class="firstpost"><h2>
          <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
            <?php the_title(); ?></a>
          <a name="a" id="a" class="invisible"  title="Artikel"></a> </h2>
        <p class="postmeta">     
          <?php printf(__('%1$s %2$s', 'mtsgossip'), $time_since, get_the_time(__('l, F jS, Y', 'mtsgossip')), get_the_time()); ?>, 
          <?php _e('by','mtsgossip');?> 
          <?php the_author() ?>,
          <?php the_tags( '', ', ', ', '); ?> 
          <?php the_category(', ') ?>,
          <?php comments_popup_link(__('No Comments','mtsgossip'), __('1 Comment','mtsgossip'), __('% Comments','mtsgossip'), '', __('Comments off','mtsgossip')); ?>
          <?php edit_post_link(__('Edit','mtsgossip'), '[ ', ' ]'); ?>
        </p>
        <?php the_content("&raquo;&raquo; " . the_title('', '', false)); ?>
        <?php wp_link_pages(array('before' => '<p class="navigate">' . __('Pages') . ' ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
      </div>
    </div>
    <?php } else { ?>
    <?php include (TEMPLATEPATH . '/ads-content.php'); ?>         
    <div class="entry"><h2>
        <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
          <?php the_title(); ?></a>
        <?php edit_post_link(__('Edit','mtsgossip'), '[ ', ' ]'); ?></h2>
      <p class="postmeta">     
        <?php printf(__('%1$s %2$s', 'mtsgossip'), $time_since, get_the_time(__('l, F jS, Y', 'mtsgossip')), get_the_time()); ?>, 
        <?php _e('by','mtsgossip');?> 
        <?php the_author() ?>, 
        <?php the_tags( '', ', ', ', '); ?> 
        <?php the_category(', ') ?>,
        <?php comments_popup_link(__('No Comments','mtsgossip'), __('1 Comment','mtsgossip'), __('% Comments','mtsgossip'), '', __('Comments off','mtsgossip')); ?>
        <?php edit_post_link(__('Edit','mtsgossip'), '[ ', ' ]'); ?>
      </p>
      <?php the_content("&raquo;&raquo; " . the_title('', '', false)); ?>
      <?php wp_link_pages(array('before' => '<p class="navigate">' . __('Pages') . ' ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    </div>
    <? }  endwhile; endif; ?>
    [B]<div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?>  </div>
    <div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?>    </div>[/B]
    <?php get_sidebar(); ?>	    
    <?php get_footer(); ?> 
    Code (markup):
    That should do the trick
     
    qazu, Jul 27, 2009 IP
  11. Nokiasony.com

    Nokiasony.com Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #11
    Thanks very much for your reply. Will try it out.
     
    Nokiasony.com, Jul 27, 2009 IP