Searching only posts and not pages!

  • Author
    Posts
  • #1979693

    kolisnyk
    Member

    I need help with my site:
    http://www.llamawiki.com/en

    The search box at the top is only searching posts and not pages.
    I want the search box to search for pages, for I don’t have nor will not be creating posts.

    I have no plugins.

    Here’s my search.php:

    <?php get_header(); ?>
    
    <div id="content" class="clearfix">
      <div id="main" class="col-sm-8 clearfix" role="main">
        <div id="home-main" class="home-main home">
          <header>
            <div class="page-catheader cat-catheader">
                <h4 class="cat-title">
    				<?php printf( __( 'Search : %s', 'redpro' ), '<span>' . get_search_query() . '</span>' ); ?>
                </h4>
             </div>
          </header>
          <?php if (function_exists('mywiki_custom_breadcrumbs')) mywiki_custom_breadcrumbs(); ?>
          <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
          <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
            <header>
                <div class="cat-hadding">
                     <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title();?></a>
                </div>
    
    <?php
    	$title 	= get_the_title();
    	$keys= explode(" ",$s);
    	$title 	= preg_replace('/('.implode('|', $keys) .')/iu',
    		'<strong class="search-excerpt"></strong>',
    		$title);
    ?>
    
                <p class="meta post-meta-entry"><?php mywiki_entry_meta(); ?></p>
                <p class="meta post-meta-entry"><?php the_tags(); ?></p>
    
            </header>
            <!-- end article header -->
    
            <section class="post_content">
              <?php the_post_thumbnail( 'wpbs-featured' ); ?>
              <?php the_excerpt(); ?>
            </section>
            <!-- end article section -->
    
          </article>
          <!-- end article -->
    
          <?php endwhile; ?>
    	  <?php endif; ?>
          <nav class="mywiki-nav">
                    <span class="mywiki-nav-previous"><?php previous_posts_link(); ?></span>
                    <span class="mywiki-nav-next"><?php next_posts_link(); ?></span>
    			</nav>
    
        </div>
      </div>
      <!-- end #main -->
    
      <?php get_sidebar(); ?>
    </div>
    <!-- end #content -->
    
    <?php get_footer(); ?>

    #1979756

    kokkieh
    Staff

    This support forum is for free wordpress.com blogs. You appear to have a self-hosted wordpress.ORG install. WordPress.com and wordpress.org are completely separate and different: http://en.support.wordpress.com/com-vs-org/

    Please visit the wordpress.org support forum for assistance as we won’t be able to help you here: http://wordpress.org/support/ If you don’t already have a username on that forum, click the register button in the upper right corner so you can post in that forum.

The topic ‘Searching only posts and not pages!’ is closed to new replies.