WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


<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...') ?>'"/> 


<?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>
        <?php } ?>
        <div class="item-content">
           <!-- start:Post date -->
           <div class="post-date">
                 <li class="date">
                    <?php echo quins_display_date_link () ?>
                 <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>
           <!-- end:Post date -->
           <div class="post-title">
              <h2 class="title">
                 <a href="<?php the_permalink() ?>"><?php the_title() ?></a>
           <!-- end:Post Title -->
           <div class="post-meta">
                    <span> <?php _e('Posted by ', 'quins' ) ;  the_author_posts_link() ?></span>
                    <span><?php _e( 'In ', 'quins' ) ; the_category(', ') ?></span>
           <!-- end:Post Meta -->
           <div class="post-entry">
              <?php the_excerpt() ?>
                 <a href="<?php the_permalink() ?>" class="btn-border"><?php echo esc_html( $quins_opt['excerpt_more_link'] ) ?></a>
           <!-- end:Post Entry -->

                    <?php endwhile; ?>

                        <?php echo quins_pagination(); ?>

                    <?php else : ?>

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

                    <?php endif; ?>

               <!-- .col 9 -->

               <?php get_sidebar(); ?>
      <!-- #blog-wrapper -->
<?php get_footer(); ?>
share|improve this question
What Theme are you using? What Plugins are active? – Chip Bennett Feb 27 '14 at 18:45
Is a custom theme and I have deactivate the plugins – laura Feb 27 '14 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 '14 at 19:05
Something in your custom theme is wrong. Post the relevant code. – s_ha_dum Feb 28 '14 at 4:16

Your Answer


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

Browse other questions tagged or ask your own question.