• Resolved ryanronning

    (@ryanronning)


    I have an issue where the search on our site is not working, It’s a child theme and returns no results.
    site is http://www.findgiftclubs.com

    Thank you for looking.

    Here’s the code for the files:
    Header.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    <title>
    <?php if($_REQUEST['ptype']=='post_listing'){ echo HEADER_ADD_PLACE_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_REQUEST['ptype']=='post_event'){ echo HEADER_ADD_EVENT_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_REQUEST['ptype']=='preview'){ echo HEADER_ADD_PREVIEW_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_REQUEST['ptype'] == 'register' || $_REQUEST['ptype'] == 'login'){ echo HEADER_LOGIN_REGISTRATION_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_GET['ptype'] == 'return' || $_GET['ptype'] == 'payment_success'){ echo HEADER_SUCCESS_PAGE_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if ( is_home() ) { ?><?php bloginfo('description'); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_search() ) { ?>Search Results | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_author() ) { ?>Author Archives | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_single() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name');?><?php } ?>
    <?php if ( is_page() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name');?><?php } ?>
    <?php if ( is_archive() ) { ?>
    <?php
    if(is_category())
    {
    	single_cat_title();
    }else
    {
    	global $wp_query, $post;
    	$current_term = $wp_query->get_queried_object();
    	echo $current_term->name;
    }
    ?>
     | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_month() ) { ?><?php the_time('F'); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php //single_tag_title("", true);
    } } ?>
    </title>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <?php if (is_home()) { ?>
    <?php if ( get_option('ptthemes_meta_description') <> "" ) { ?>
    <meta name="description" content="<?php echo stripslashes(get_option('ptthemes_meta_description')); ?>" />
    <?php } ?>
    <?php if ( get_option('ptthemes_meta_keywords') <> "" ) { ?>
    <meta name="keywords" content="<?php echo stripslashes(get_option('ptthemes_meta_keywords')); ?>" />
    <?php } ?>
    <?php if ( get_option('ptthemes_meta_author') <> "" ) { ?>
    <meta name="author" content="<?php echo stripslashes(get_option('ptthemes_meta_author')); ?>" />
    <?php } ?>
    <?php } ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" />
    <?php if ( get_option('ptthemes_favicon') <> "" ) { ?>
    <link rel="shortcut icon" type="image/png" href="<?php echo get_option('ptthemes_favicon'); ?>" />
    <?php } ?>
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php if ( get_option('ptthemes_feedburner_url') <> "" ) { echo get_option('ptthemes_feedburner_url'); } else { echo get_bloginfo_rss('rss2_url'); } ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php if ( get_option('ptthemes_scripts_header') <> "" ) { echo stripslashes(get_option('ptthemes_scripts_header')); } ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/library/css/print.css" media="print" />
    <link href="<?php echo bloginfo('template_url'); ?>/library/js/swfupload/default.css" rel="stylesheet" type="text/css" />
    <link href="<?php bloginfo('template_directory'); ?>/library/css/slimbox.css" rel="stylesheet" type="text/css" />
    <script src="<?php bloginfo('template_directory'); ?>/library/js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="<?php bloginfo('template_directory'); ?>/library/js/jquery.nivo.slider.pack.js" type="text/javascript"></script>
    
    <style type="text/css">
    <!--
    .win #categories_strip ul li a { padding: 8px 15px 7px 15px; display:block; }
    -->
    </style>
    <?php
    	if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );
    ?>
    <?php wp_head(); ?>
    
    <?php if ( get_option('ptthemes_customcss') ) { ?>
    <link href="<?php bloginfo('template_directory'); ?>/custom.css" rel="stylesheet" type="text/css">
    <?php } ?>
    <link href="<?php bloginfo('template_directory'); ?>/library/css/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css" />
    </head>
    <body <?php body_class(); ?>>
    <div id="page" class="<?php if ( is_home() ) {  echo "top_bg"; } else { echo "top_bg_in"; } ?>" >  
    
    <div id="header_outer">
    <div id="header" class="clearfix">
        <div class="header_left">
        <?php if ( get_option('ptthemes_show_blog_title') ) { ?>
           <div class="blog-title"><a>/"><?php bloginfo('name'); ?></a>
                 <p class="blog-description"><?php bloginfo('description'); ?></p>
           </div>
        <?php } else { ?>
        <div class="logo">
        <a>/">
        <img src="<?php if ( get_option('ptthemes_logo_url') <> "" ) { echo get_option('ptthemes_logo_url'); } else { echo get_bloginfo('template_directory').'/skins/'.str_replace('.css','',get_option('ptthemes_alt_stylesheet')).'/logo.png'; } ?>" alt="<?php bloginfo('name'); ?>"   /></a>
          <p class="blog-description"><?php bloginfo('description'); ?></p>
          </div>
        <?php } ?>
        </div> <!-- header left #end -->
        <div class="header_right">
         <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Top Navigation') ){}else{  ?>
    
    <ul>
             <li class="hometab <?php if ( is_home() && $_REQUEST['page']=='' ) { ?> current_page_item <?php } ?>"><a>/"><?php _e('Home'); ?></a>
             <?php wp_list_pages('title_li=&depth=0&exclude=' . get_inc_pages("pag_exclude_") .'&sort_column=menu_order');  ?>
             <?php
             global $current_user;
    		 if($current_user->data->ID) { ?>
             <li class="welcome"> <span><?php echo WELCOME_TEXT;?>, </span>  <a>data->ID);?>">  <?php printf('%s',$current_user->data->display_name);?></a>
             <li ><a>/?ptype=login&action=logout" class="signin"><?php echo LOGOUT_TEXT;?></a>
    		 <?php }else{ ?>
            <li class="welcome"><span><?php echo WELCOME_TEXT;?>, <strong><?php echo GUEST_TEXT;?></strong>   /</span> 
    
    <li><a>/?ptype=login&page1=sign_in" class="signin"><?php echo SIGN_IN_TEXT;?></a></li>
             <?php }?>
        </ul>
        <?php }?>
        <?php include(TEMPLATEPATH."/header_searchform.php");?>
        </div> <!-- header right #end -->
    </div> <!-- header #end -->
    
    <div id="categories_strip">
         <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Main Navigation') ){}else{  ?>
    
    <ul>
            <li class="<?php if ( is_home() ) { ?>current_page_item<?php } ?> home" ><a>/"><?php _e('Home');?></a>
             <?php  if(is_array(get_option('ptthemes_placecategory')))
    		  {
    			 $cat_arr = get_option('ptthemes_placecategory');
    			 if(is_array(get_option('ptthemes_placecategory')) && $cat_arr[0]!='')
    			 {
    				$blog_cat = implode(',',get_option('ptthemes_placecategory'));
    				$catlist =  wp_list_categories('title_li=&include=' . $blog_cat .'&echo=0');
    				if(!strstr($catlist,'No categories'))
    				{
    					echo $catlist;
    				}
    			 }
    		  }
            ?>
             <?php  if(is_array(get_option('ptthemes_eventcategory')))
    		  {
    			 $cat_arr = get_option('ptthemes_eventcategory');
    			 if(is_array(get_option('ptthemes_eventcategory')) && $cat_arr[0]!='')
    			 {
    				$event_cat = implode(',',get_option('ptthemes_eventcategory'));
    				$catlist =  wp_list_categories('title_li=&echo=0&include=' . $event_cat .'&taxonomy=eventcategory');
    				 if(!strstr($catlist,'No categories'))
    				{
    					echo $catlist;
    				}
    			 }
    		  }
            ?>  
    
          <?php
    	  $blog_cat = get_option('ptthemes_blogcategory');
          if(is_array(get_option('ptthemes_blogcategory')) && $blog_cat[0]!='')
          {
            $blog_cat = implode(',',get_option('ptthemes_blogcategory'));
    		$catlist_blog =  wp_list_categories('title_li=&include=' . $blog_cat .'&echo=0');
          }
        if(!strstr($catlist_blog,'No categories'))
    	 {
    		 echo $catlist_blog;
    	 }
         ?>
         <?php if(get_option('is_user_addevent')=='0'){}else{ ?>
         <li class="<?php if ( is_home() && $_REQUEST['ptype']=='post_listing' ) { ?>current_page_item<?php } ?>" ><a>/?ptype=post_listing"><?php _e('Add Listing');?></a>
         <?php }?>
         <?php if(get_option('is_user_eventlist')=='0'){}else{ ?>
         <li class="<?php if ( is_home() && $_REQUEST['ptype']=='post_event') { ?>current_page_item<?php } ?>" ><a>/?ptype=post_event"><?php _e('Add Event');?></a>
         <?php }?>
            </ul>
        <?php }?>
    
      	 <?php dynamic_sidebar('Header Navigation Right'); ?>
    
       </div>
       </div>  <!-- header outer#end -->
    
    <strong>header_searchform.php
    </strong>
    
    <blockquote><div class="searchform">
      <form method="get" id="searchform2" action="<?php bloginfo('home'); ?>/">
       <input type="hidden" name="t" value="1" />
        <span class="searchfor"><input type="text" value="<?php if($_REQUEST['s'] && $_REQUEST['s']!='cal_event'){echo $_REQUEST['s'];}else{echo get_option('ptthemes_search_name');}?>" name="s" id="sr" class="s" onfocus="if (this.value == '<?php echo get_option('ptthemes_search_name'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo get_option('ptthemes_search_name'); ?>';}" />
    <!--     <small class="text"><?php echo SEARCH_FOR_MSG;?> </small>  -->
         </span>
    
    <!-- REMOVE LOCATION SEARCH
      	 <span class="near"><input name="sn" id="sn" type="text" class="s" value="<?php if($_REQUEST['sn']){echo $_REQUEST['sn'];}else{echo NEAR_TEXT;}?>" onblur="if (this.value == '') {this.value = '<?php echo NEAR_TEXT;?>';}" onfocus="if (this.value == '<?php echo NEAR_TEXT;?>') {this.value = '';}"   />
          <small class="text"><?php echo SEARCH_NEAR_MSG;?></small>
         </span>
    -->
        <input type="image" class="search_btn" src="<?php bloginfo('template_url'); ?>/images/search_icon.png" alt="Submit button" onclick="set_srch();" />
      </form>
    </div>
    <script type="text/javascript">
    function set_srch()
    {
    	if(document.getElementById('sr').value=='<?php echo get_option('ptthemes_search_name'); ?>')
    	{
    		document.getElementById('sr').value = ' ';
    	}
    	if(document.getElementById('sn').value=='<?php echo NEAR_TEXT; ?>')
    	{
    		document.getElementById('sn').value = '';
    	}
    }
    </script>
    </blockquote>
    <strong>Search.php</strong>
    
    <blockquote><?php get_header(); ?>
     <div id="wrapper" class="clearfix">
             	<div id="inner_pages" class="clearfix" >
                  <?php if (is_paged()) $is_paged = true; ?>
                	 <?php if (is_search()) { ?>
                       <?php if($_REQUEST['s']=='cal_event'){
    					   global $wpdb,$wp_query;
    						$m = $wp_query->query_vars['m'];
    						$py = substr($m,0,4);
    						$pm = substr($m,4,2);
    						$pd = substr($m,6,2);
    						$the_req_date = "$py-$pm-$pd";
    					   ?>
                       <h1 class="cat_head" ><?php _e('Browsing Day');?> "<?php echo date('F jS, Y',strtotime($the_req_date)); ?>"</h1>
                       <?php }else{
    					   $srchparam[0] = $_REQUEST['s'];
    					   $srchparam[1] = $_REQUEST['sn'];
    					   $str = implode(' ',$srchparam);
    					   ?>
                        <h1 class="cat_head" ><?php _e('Search Result');?> "<?php printf(__('%s'), $str) ?>"</h1>
                        <?php }?>
                        <?php } ?>
    
                     <div class="breadcrumb clearfix"><?php if ( get_option( 'ptthemes_breadcrumbs' )) {  ?>
    
                    	<div class="breadcrumb_in"><?php
    					if($_REQUEST['s']=='cal_event'){
    						yoast_breadcrumb('',' » '.date('F jS, Y',strtotime($the_req_date)));
    					}else {
    					yoast_breadcrumb('',' '.$_REQUEST['sn']);
    					}
    					?></div>
    
                <?php } ?></div>
         		<div id="content" class="content_index full_page clearfix">
        		<ul class="category_list_view"  >
    			<?php if(have_posts()) : ?>
     			<?php while(have_posts()) : the_post() ?>
    
    <!-- REMOVE FEATURED & THUMBNAIL
                 <?php $post_images = bdw_get_images($post->ID,'large');?>
    
                    <li class="clearfix <?php if(get_post_meta($post->ID,'is_featured',true)){ echo 'featured';}?>" >
    
                       <?php if(get_post_meta($post->ID,'is_featured',true)) {?> <span class="<?php echo 'featured_img';?>">featured</span> <?php }?>
    
          <?php
                if(get_the_post_thumbnail( $post->ID, array())){?>
                 <a>">
                 <?php echo get_the_post_thumbnail( $post->ID, array(160,153),array('class'	=> "",));?>
                 </a>
                <?php }else if($post_images[0]){ global $thumb_url;
    
                    $thumb_url1 = $thumb_url.get_image_cutting_edge($args);
                ?>
                 <a>">
                 <img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo $post_images[0];?>&w=158&h=105&zc=1&q=80<?php echo $thumb_url1;?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>"  /> </a>
                <?php
                } else { ?>
                   <a>"> <span class="img_not_available"> <b> <?php _e('Image Not Available ');?></b> </span> </a>
                <?php }?>
    -->
    
             <div class="content">
             <h3 class="no_percentage">  <a>"><?php the_title(); ?></a>  </h3>
            <?php if($post->post_type=='event'){?>
             <p class="address no_percentage"> <span><?php _e('Location')?> :</span> <?php echo get_post_meta($post->ID,'address',true);?></p>
             <p class="timing no_percentage"> <span><?php _e('Date :');?></span> <?php echo get_formated_date(get_post_meta($post->ID,'st_date',true)).__(' to ').get_formated_date(get_post_meta($post->ID,'end_date',true));?>  <span><?php _e('Timing :');?></span> <?php echo get_formated_time(get_post_meta($post->ID,'st_time',true)) . __(' to ') .get_formated_time(get_post_meta($post->ID,'end_time',true));?> </p>
             <?php }else{?>
    <!--         <p class="address no_percentage"> <span><?php _e('Location')?> :</span> <?php echo get_post_meta($post->ID,'address',true);?></p>  -->
             <p class="no_percentage"><?php echo excerpt(50); ?> </p>
             <?php }?>
            <span class="readmore" >»<a>" ><?php _e('Read More');?></a></span>
    
    <hr>
            </div> 
    
          <?php endwhile; ?>
    
          <div class="pagination">
            <?php if (function_exists('wp_pagenavi')) { ?>
            <?php wp_pagenavi(); ?>
            <?php } ?>
          </div>
          <?php else: ?>
          <p class="notice_msg"><?php _e( 'Sorry, nothing matched your search criteria.'); ?></p>
          <?php endif; ?>
    
          </div> <!-- content #end -->
    
    <!--REMOVE SIDERBAR
    		 <?php // get_sidebar(); ?>
    
             <div id="sidebar">
    	<?php dynamic_sidebar(5);  ?>
    </div> <!-- sidebar right-->
    		 </div>
    <?php get_footer(); ?>

    [Moderator Note: Please post code or markup between backticks or use the code button. Or better still – use a pastebin. Your posted code may now have been permanently damaged by the forum’s parser.]

The topic ‘Child theme search not working…’ is closed to new replies.