Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When make a search the path is www.xxxx.com?s=xxxx. This retrieve an error: Notice: Trying to get property of non-object in /home/codetoco/public_html/wp-includes/post-template.php on line 29.

If I change "s" by "search" it don`t retrieve an error, but it show a previous version of the template.

In the seach form I use name="s". Nobody knows what happens?

Searchform.php

<form action="<?php echo home_url(); ?>/" class="searchform" method="get">
    <input type="text" name="s" class="search form-control" value="<?php _e('Search...') ?>" onfocus="if(this.value=='<?php _e('Search...') ?>') this.value=''" onblur="if(this.value=='') this.value='<?php _e('Search...') ?>'"/> 
</form>

Search.php

<?php get_header(); ?>

<div class="blog-wrap">
         <div class="container-full">
            <div class="row">
               <div class="col-sm-9">
                  <div class="blog-content">

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

                  <h2 class="subtitle"><?php printf( __( 'Search Results for: %s', 'pukka' ), '<span>' . get_search_query() . '</span>' ) ?></h2>

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

                        <article id="post-<?php the_ID(); ?>" <?php post_class('blog-item') ?>>
        <?php if (has_post_thumbnail()) { ?>
        <div class="post-media">
            <a href="<?php the_permalink() ?>"><?php the_post_thumbnail('quins-1000', array( 'class' => "img-responsive" ) ) ?></a>
        </div>
        <?php } ?>
        <div class="item-content">
           <!-- start:Post date -->
           <div class="post-date">
              <ul>
                 <li class="date">
                    <?php echo quins_display_date_link () ?>
                 </li>
                 <li class="comments">
                    <a href="<?php comments_link(); ?>"><?php comments_number( esc_html__('0 comments', 'quins' ), esc_html__( '1 comment', 'quins' ), esc_html__('% comments', 'quins') ); ?></a>
                 </li>
              </ul>
           </div>
           <!-- end:Post date -->
           <div class="post-title">
              <h2 class="title">
                 <a href="<?php the_permalink() ?>"><?php the_title() ?></a>
              </h2>
           </div>
           <!-- end:Post Title -->
           <div class="post-meta">
              <ul>
                 <li>
                    <span> <?php _e('Posted by ', 'quins' ) ;  the_author_posts_link() ?></span>
                 </li>
                 <li>
                    <span><?php _e( 'In ', 'quins' ) ; the_category(', ') ?></span>
                 </li>
              </ul>
           </div>
           <!-- end:Post Meta -->
           <div class="post-entry">
              <?php the_excerpt() ?>
              <p>
                 <a href="<?php the_permalink() ?>" class="btn-border"><?php echo esc_html( $quins_opt['excerpt_more_link'] ) ?></a>
              </p>
           </div>
           <!-- end:Post Entry -->
        </div>
    </article>

                    <?php endwhile; ?>

                        <?php echo quins_pagination(); ?>

                    <?php else : ?>

                        <?php get_template_part('content', 'none'); ?>

                    <?php endif; ?>

                  </div>
               </div>
               <!-- .col 9 -->

               <?php get_sidebar(); ?>
            </div>
         </div>
      </div>
      <!-- #blog-wrapper -->
<?php get_footer(); ?>
share|improve this question
    
What Theme are you using? What Plugins are active? –  Chip Bennett Feb 27 at 18:45
    
Is a custom theme and I have deactivate the plugins –  laura Feb 27 at 18:48
    
I think that is a problem of database.. I have installed on other blog after the same wordpress multisite and its works! But what can i do to fix this? –  laura Feb 27 at 19:05
    
Something in your custom theme is wrong. Post the relevant code. –  s_ha_dum Feb 28 at 4:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.