Forums

Blog Search/Archives not working (8 posts)

  1. hollywood_lt
    Member
    Posted 4 months ago #

    I'm sure this has been covered but I can't seem to find the answer.

    On this site: http://www.successjustclicks.com/ the blog search is not working and neither are the Archives.

    Anyone have a suggestion as to why that may be? I do query posts throughout the site. Could that be the issue? Thanks.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Can you replicate the problem using Twenty Eleven with all plugins deactivated?

  3. hollywood_lt
    Member
    Posted 4 months ago #

    No. Its just that custom template. Twenty Eleven works properly. Thanks!

  4. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    You could either try contacting the theme's developer or consider using another theme.

  5. hollywood_lt
    Member
    Posted 4 months ago #

    I'm the developer and created it from scratch. Everything else works fine. Just the blog is acting screwy.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Then you'll need to start working through all of your theme files - especially index.php, search.php, archive.php and functions.php.

  7. hollywood_lt
    Member
    Posted 4 months ago #

    Hmmm.... Ok I'll take a look at those and see what's going on. Thanks! :-)

  8. hollywood_lt
    Member
    Posted 4 months ago #

    I got my search to work thankfully but I'm still working out the archive issue and a few minor things with the search page. Below is the code I used to solve the problem I was having:

    <?php /** * The template for displaying Search Results pages. * * @package WordPress * @subpackage Starkers * @since Starkers 3.0 */

    get_header(); ?>

    <div id="search-wrap"> <img src="http://grafxcreative.com/successjustclicks/wp-content/themes/sjc/images/blog.jpg"> <div id="search-wrap2" align="left">

    <?php if ( have_posts() ) : ?>

    <?php $searchquery = trim( get_search_query() ); if ( !empty($searchquery) ) { printf( __( '<h1>Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span></h1>' ); } else
    { echo "<h2>Oops - you didn't specify a search term</h2>";

    $searchquery = trim( get_search_query() ); echo "<p>Please try searching again by entering one or two words on the subject that you are trying to find more information on.</p>";

    } ?>

    <?php if( function_exists('search_results_title') ): ?> <h3 class="section-title"><?php search_results_title(); ?></h3> <?php else: ?> <?php endif; ?>

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

    <?php /* Start the Loop */ ?>

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

    <?php $searchquery = trim( get_search_query() ); if ( !empty($searchquery) ) { ?> <div class="search-result"> <span class="search-header"><a class="two" href="<?php the_permalink();
    ?>"><?php the_title(); ?>
    </span>
    <p2><?php the_excerpt(); ?></p2>

    </div> <?php } ?>

    <?php endwhile; ?>

    <?php $searchquery = trim( get_search_query() ); if ( !empty($searchquery) ) { wp_pagenavi(); } ?>

    <?php else : ?>

    <h2>Nothing Found</h2>

    <p>Sorry, but nothing matched your search criteria. Please try again with some different keywords.</p>

    </div></div>

    <?php endif; ?>

Reply

You must log in to post.

About this Topic