go41

Won’t display posts on page 2

von Joern am 13. Jun. 2010 | Keine Kommentare

Hi all
I have this template page that I’ve setup, which shows a list of posts from a certain category. At the bottom of the page, I have a "next" link, which should show more posts. However, when you click on the "next" it only displays my header and footer, and no content. any advice?! here is my code:
Code:

<?php /*

Template Name: news

*/

?>
<?php get_header(); ?>
<!-- Featured news story area !-->
   <?php if(!is_paged()) { ?>
      <div id="content">

             <div class="post" id="post-<?php the_ID(); ?>">

            <h1>News</h1>       
         <div id="newsline">

           <?php query_posts("showposts=1&category_name=Latestnews"); ?>

         <?php while (have_posts()) : the_post(); ?>   
              <div class="title">" rel="bookmark" class="title"><?php the_title(); ?></div>
         <div class="meta">[<?php the_time('j M Y') ?> | <?php the_author() ?> | <?php comments_popup_link('No Comment', '1 Comment', '% Comments');?>]</div>   
         <?php $values = get_post_custom_values("Latestnews");?>
         <?php $values = get_post_custom_values("Image");

         if (isset($values[0])) { ?>

            " rel="bookmark" title="Permanent Link to <?php the_title(); ?>">

         <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php

         $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=620&h=340&zc=1&q=587"

         alt="<?php the_title(); ?>"   width="620px" height="360px" />

            <?php } ?>

          <div class="info"><?php the_excerpt_reloaded(100, '', 'none', TRUE, 'Read more >>', FALSE, 2); ?>

         <?php endwhile; ?>

          </div>

          </div>

          </div>

 <!-- End of Featured news story area !-->
 <!-- Start list of other news items !-->     
        <div id="front-list">
       <h2>Other news</h2>

      <?php

        $page = (get_query_var('paged')) ? get_query_var('paged') : 1;

         query_posts("cat=3&paged=$page&posts_per_page=5"); ?>
      <?php while (have_posts()) : the_post(); ?>      
      <div class="clearfloat">
      <h3 class=cat_title><?php the_category(', '); ?> &raquo</h3>

      <div class="title">" rel="bookmark"><?php the_title(); ?></div>

      <div class="meta">[<?php the_time('j M Y') ?> | <?php the_author() ?> | <?php comments_popup_link('No Comment', '1 Comment', '% Comments');?>]</div>   
<!-- generates thumbnail image -->
      <div class="spoiler">

      <?php   $values = get_post_custom_values("Image");

      if (isset($values[0])) { ?>

        " rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php

$values = get_post_custom_values("Image"); echo $values[0]; ?>&w=80&h=80&zc=1&q=100"

alt="<?php the_title(); ?>" class="left" width="80px" height="80px"  />

      <?php } ?>
      <div class="info"><?php the_excerpt_reloaded(50, '', 'none', TRUE, 'Read more >>', FALSE, 2); ?></div>

      </div>
      </div>
         <?php endwhile; ?>
      <div class="navigation">

      <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }

         else { ?>
         <div class="right"><?php next_posts_link('Next Page »') ?></div>

         <div class="left"><?php previous_posts_link('« Previous Page') ?></div>

         <?php } ?>
   </div>
      </div>
        </div>
        <div id="toppage-right">

<h2>Latest blogs</h2>
         <?php query_posts("showposts=4&category_name=Sales-rep"); $i = 1; ?>

         <?php while (have_posts()) : the_post(); ?>

             <div class="clearfix">

            <div class="post">

                                  <div class="h2">" rel="bookmark" class="title"><?php the_title(); ?></div>

                     <div class="meta">[<?php the_time('j M Y') ?> | <?php the_author_firstname(); ?> <?php the_author_lastname(); ?>]</div>   
             <?php $values = get_post_custom_values("Image");

                if (isset($values[0])) { ?>

                " rel="bookmark" title="Permanent Link to <?php the_title(); ?>">

                <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php

                $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=120&h=120&zc=1&q=120"

                 alt="<?php the_title(); ?>" width="120px" height="100px" />

                 <?php } ?>
         <p><?php the_excerpt_reloaded(18, '', 'none', TRUE, 'Read more >>', FALSE, 2); ?></p>

            </div>

         <?php endwhile; ?>

         </div>
       </div>

        </div>

        </div>

      </div>

       

        <?php get_sidebar(); ?>
      <?php } ?>
<?php get_footer(); ?>

Thanks in advance

(von: adamwork)

Hier noch 1 weitere Ergebnisse dieses Threads:

Re: Won’t display posts on page 2 :: Reply by master

13. Jun. 2010 (von: master)

on top of your template you haveCode:<?php get_header(); ?><!-- Featured news story area !--><?php if(!is_paged()) { ?>......means after the header is displayed only stuff will show if it's NOT paged "if(!is_paged()"The end of this "if(!is_paged()" condition is after here just…

Autor:

Du findest mich auch auf Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

weitere forum Beiträge: