• I’m trying to create a page to display the results of a page but not is working.
    Im already try to use default search.php from default theme of wordpress (tweenty eleven).
    And the results are not shown like i want.

    What should I do? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Are you following the Codex guidelines for search results pages?
    http://codex.wordpress.org/Creating_a_Search_Page

    Thread Starter LucasMorato

    (@lucasmorato)

    Now i guess the page search.php is working, but the posts not is showing… Only appears: Search Results for: “search”…

    Is there anything wrong with my code?

    <?php
    /*
    Template Name: Search Page
    */
    ?>
    
    <?php get_header(); ?>
    
    		<?php if ( have_posts() ) : ?>
    
    				<h3 class="page-title"><?php printf( __( 'Search Results for: %s', 'mytheme' ), '<span>' . get_search_query() . '</span>' ); ?></h3>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php get_template_part( 'content', get_post_format() ); ?>
    
    			<?php endwhile; ?>
    
    		<?php else : ?>
    
    			<div class="container">
    			<div class="row-fluid">
    			<div class="span8">
    			<article id="post-0" class="post no-results not-found">
    				<header class="entry-header">
    					<h1 class="entry-title"><?php _e( 'No results found', 'mytheme' ); ?></h1>
    				</header>
    
    				<div class="entry-content">
    					<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'mytheme' ); ?></p>
    
    					</div>
    				</div><!-- .entry-content -->
    			</article><!-- #post-0 -->
    
    			<div class="span4 pull-right">
    				<?php get_sidebar(); ?>
    			</div>
    
    		<?php endif; ?>
    
    		</div>
    		</div>
    
    <?php get_footer(); ?>
    Thread Starter LucasMorato

    (@lucasmorato)

    ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search page not working’ is closed to new replies.