• Just a simple little question:

    I have my wordpress currently set to display one entry per page on the index and the archives. Unfortunately, this results in one entry per page on the search results. How can I configure it so that the search results provide multiple entries per page?

    Thanks in advance. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m looking for the same thing. If anyone could help that would be wonderful.

    Would this require using multiple loops to achieve multiple posts on search/archive pages?

    Or would changing the Reading option under settings to a number then messing with the loop on the index page make it work better?

    CQS = custom query string plugin is the answer
    (go to my site to download)

    Arwennn –

    I think I figured it out. I don’t know what your structure is, but this should work… I hope. At least, it worked for my site.

    I have these pages set up to help:

    archives.php
    archive.php
    search.php
    post.php
    single.php

    My index is set up as:

    <div id="rap">
    <?php get_header(); ?>
    
    <div id="main">
    	<div id="content">
                    <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("showposts=1&paged=$page"); ?>
                    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                         <div class="post">
                         <?php require('post.php'); ?>
                         <?php comments_template(); // Get wp-comments.php template ?>
                         </div>
    
                     <?php endwhile; else: ?>
                     <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
                     <?php endif; ?>
    
                    <p>
    		<div class="alignleft"><?php next_posts_link('&laquo; Previous') ?></div>
                    <div class="alignright"><?php previous_posts_link('Current &raquo;') ?></div>
                    </p>
    	</div>
    
    	    <?php get_sidebar(); ?>		
    
    <?php get_footer(); ?>
    </div>
    </div>

    That makes the index/front page show only one post. It also prevents the previous/next post links continue to work.

    My post.php lets the title of the entry be linked and code for the actual entry, but nothing more.

    archive.php, archives.php, search.php all do multiple posts (on excerpt, of course) as long as Settings -> Reading has been set to more than 1. I’ve used 7 for testing purposes.

    I use single.php as a non-linked title post page.

    I really hope that helps.

    Oh, I forgot to mention…

    <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("showposts=1&paged=$page"); ?>

    I used query_post to get the single post to work. It has to go before the loop.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Single post on front page, multiple in search results?’ is closed to new replies.