Ask your WordPress questions! Pay money and get answers fast! (more info)

Display all blog-posts... WordPress

HI,

I have a wordpress blog that doesn´t display all blog-posts...
It´s only loading like 10 posts and then repeat the same posts over and over when scrolling down the page..

Url to page, http://elizeryd.com/blogg-3/

And the pagination only shows 3 pages..

How can I solve that and show all the blog-posts?

Answers (1)

2015-07-17

Darlene Grace Arcenal answers:

Go to Settings->Reading and replace 10 with -1 under Blog pages show at most section


johny comments:

HI Darlene, You can´t put negative value like -1 under blog pages


Darlene Grace Arcenal comments:

Hi Johny, -1 means display unlimited posts
https://wordpress.org/support/topic/set-unlimited-posts

replaced the value 10 on <strong>Blog pages show at most section</strong> with -1 or your posts_per_page=10 with posts_per_page=-1


johny comments:

I have this query on the blog-page,

<?php $paged = (get_query_var('page')) ? get_query_var('page') : 1 ?>

<?php query_posts('cat=2&paged='.$paged); if (have_posts()) : ?>

How can I modify that to -1 or your posts_per_page?


Darlene Grace Arcenal comments:

Try this
<?php query_posts('cat=2&posts_per_page=-1&paged='.$paged); if (have_posts()) : ?>


johny comments:

it works! :) but the "infinit scroll" disapears... I want the blogpage to load like the start-page...
http://elizeryd.com/


Darlene Grace Arcenal comments:

Can you paste your whole code please?


johny comments:

get_header(); ?>















<div id="container">


<div id="content" role="main">



<?php $paged = (get_query_var('page')) ? get_query_var('page') : 1 ?>



<?php query_posts('cat=2&posts_per_page=-1&paged='.$paged); if (have_posts()) : ?>


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


<div class="single_post">



<h2 class="blogg-title"><?php the_title(); ?></h2>




<!-- <span class="date"><?php the_time('F jS , Y '); ?><span class="comment-count"></span></span>-->




<span class="meta-category"><?php the_time('F jS , Y '); ?>

<span class="comment-count"><a href="#">6</a> Comments</span>





</span>




<div id="featuredImg1">



<?php if (has_post_thumbnail()){;?>



<?php the_post_thumbnail('blogg');?>




<?php }?>



</div>



<!--<div class="entry-meta">



<?php twentyten_posted_on(); ?>







</div><!-- .entry-meta -->




<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>



<div class="entry-summary">




<?php the_content(); ?>

</div><!-- .entry-summary -->

<div class="to-top">
<a href="#top">Top</a>

</div>



<div class="line"></div>


<?php else : ?>

<div class="entry-content">



<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>

<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>

</div><!-- .entry-content -->

<div class="line"></div>

<?php endif; ?>








Darlene Grace Arcenal comments:

Oh I see,

The query must be <?php query_posts('cat=2&posts_per_page=10&paged='.$paged); if (have_posts()) : ?>

Do you have an <?php endwhile; ?> ? You must put this before the pagination.


johny comments:

Hi, here is the code,

get_header(); ?>





<div id="container">

<div id="content" role="main">



<?php $paged = (get_query_var('page')) ? get_query_var('page') : 1 ?>


<?php query_posts('cat=2&posts_per_page=10&paged='.$paged); if (have_posts()) : ?>

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

<div class="single_post">

<h2 class="blogg-title"><?php the_title(); ?></h2>


<!-- <span class="date"><?php the_time('F jS , Y '); ?><span class="comment-count"></span></span>-->

<span class="meta-category"><?php the_time('F jS , Y '); ?>


<span class="comment-count"><a href="#">6</a> Comments</span>

</span>

<div id="featuredImg1">

<?php if (has_post_thumbnail()){;?>

<?php the_post_thumbnail('blogg');?>






<?php }?>


</div>


<!--<div class="entry-meta">

<?php twentyten_posted_on(); ?>



</div><!-- .entry-meta -->


<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?><div class="entry-summary">


<?php the_content(); ?>







</div><!-- .entry-summary -->











<div class="to-top">


<a href="#top">Top</a>







</div>







<div class="line"></div>

<?php else : ?>

<div class="entry-content">

<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>






<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>



</div><!-- .entry-content -->






<div class="line"></div>







<?php endif; ?>








</div>



<?php endwhile; ?>


<?php endif; ?>


<div class="pag-nav">


<?php if(function_exists('pagination')) {







pagination();

} ?>

</div>

</div><!-- #content -->


</div><!-- #container -->


<?php get_sidebar(); ?>


<?php get_footer(); ?>








johny comments:

Now it it just shows 10 blogposts and then repeat those...