• Resolved mcnaden

    (@mcnaden)


    Hi, I am tyring to sort out a puzzle. I have just enabled Search on my site. It is working fine except that the results are limited to 3 results. I see the rest of the results flash on the screen briefly before they are trunkated down to 3.

    One hint; I think it has something to do with how I originaly had my home page set up to only show the 3 latest posts. I don’t want to change this.

    https://bearleaderchronicle.com/site/
    The search term “bear” is what I have been using to test this.

    I am not sure what code to post to trouble shoot this, but to start, here is the search results php file.

    If you can help me, please let me know what other code I need to post to figure this out.

    Thanks!

    <?php
    /**
     * The template for displaying Search Results pages.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    get_header();
    ?>
    
    <section id="primary">
        <div id="content" class="site-content facetwp-template" role="main">
    
            <?php if (have_posts()) : ?>
    
                <header class="page-header">
                    <h1 class="page-title"><?php printf(__('Search Results for: %s', 'twentyeleven'), '<span>' . get_search_query() . '</span>'); ?></h1>
                </header>
    
                <?php twentyeleven_content_nav('nav-above'); ?>
    
                <?php /* Start the Loop */ ?>
                <?php while (have_posts()) : the_post(); ?>
    
                    <?php
                    /* Include the Post-Format-specific template for the content.
                     * If you want to overload this in a child theme then include a file
                     * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                     */
                    get_template_part('content', get_post_format());
                    ?>
    
                <?php endwhile; ?>
    
                <?php twentyeleven_content_nav('nav-below'); ?>
    
            <?php else : ?>
    
                <article id="post-0" class="post no-results not-found">
                    <header class="entry-header">
                        <h1 class="entry-title"><?php _e('Nothing Found', 'twentyeleven'); ?></h1>
                    </header><!-- .entry-header -->
    
                    <div class="entry-content">
                        <p><?php _e('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyeleven'); ?></p>
                        <?php get_search_form(); ?>
                    </div><!-- .entry-content -->
                </article><!-- #post-0 -->
    
            <?php endif; ?>
    
        </div><!-- #content -->
    </section><!-- #primary -->
    
    <?php get_sidebar( 'search' ); ?>
    <div class="clear"></div>
    <?php get_footer(); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mcnaden

    (@mcnaden)

    ALSO …

    selecting the “Older posts” link briefly displays the whole list of results again, and then the resuslts snaps back to 3 again.

    Thanks

    Thread Starter mcnaden

    (@mcnaden)

    With further research … I found that the number of posts displayed is defauting to the site settings in “Reading/ Blog pages show at most”. So the solution I guess is to change the code so the number can be set manualy for Search Results only.

    Can someone please give me some instructions on how to set this up correctly?

    Thanks

    Thread Starter mcnaden

    (@mcnaden)

    I found this code that enables me to set the number or results desired in the template file.

    <?php query_posts($query_string . '&showposts=10'); ?>

    Unfortunatly, using this solution prevents the FacetWP plugin from manipulatin the results so that is not workable for us.

    I did a workaround by fixing our front page post number limit in its template file and then making the system limit 99.

    So it is working but I would still like to be able to control the Search Results seperatly.

    Would love some input on this if anyone has an idea.

    Thanks!

    Try using WordPress ? Custom Post Limits ? WordPress Plugins

    You can set post limits for search results, categories, etc, and paged pages without having to edit theme files. The only time I’ve seen this plugin not work perfectly is with a Genesis theme and the grid loop layout.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Search results are limited to 3’ is closed to new replies.