검색 양식이 비어 있으면 기본 검색 기능이 홈 페이지를 반환하고 "검색 결과가 반환되지 않았습니다"페이지를 반환하려고합니다.
그리고 이 티켓은 이 기능에 그런 식으로되어 있는지 알려줍니다! 누구나 .htaccess 리디렉션을 사용하는 것 외에 변경하는 방법을 알고 있습니까?
다음 search.php 파일을 사용하고 있습니다 :`
<div id="content" class="clearfix">
<div id="main" class="col700 left clearfix" role="main">
<h1 class="archive_title"><span>Search Results for:</span> <?php echo esc_attr(get_search_query()); ?></h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header>
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<p class="meta"><?php _e("Posted", "bonestheme"); ?> <time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time('F jS, Y'); ?></time> <?php _e("by", "bonestheme"); ?> <?php the_author_posts_link(); ?> <span class="amp">&</span> <?php _e("filed under", "bonestheme"); ?> <?php the_category(', '); ?>.</p>
</header> <!-- end article header -->
<section class="post_content">
<?php the_excerpt('<span class="read-more">Read more on "'.the_title('', '', false).'" »</span>'); ?>
</section> <!-- end article section -->
<footer>
</footer> <!-- end article footer -->
</article> <!-- end article -->
<?php endwhile; ?>
<?php if (function_exists('page_navi')) { // if expirimental feature is active ?>
<?php page_navi(); // use the page navi function ?>
<?php } else { // if it is disabled, display regular wp prev & next links ?>
<nav class="wp-prev-next">
<ul class="clearfix">
<li class="prev-link"><?php next_posts_link(_e('« Older Entries', "bonestheme")) ?></li>
<li class="next-link"><?php previous_posts_link(_e('Newer Entries »', "bonestheme")) ?></li>
</ul>
</nav>
<?php } ?>
<?php else : ?>
<!-- this area shows up if there are no results -->
<article id="post-not-found">
<header>
<h1>No Results Found</h1>
</header>
<section class="post_content">
<p>Sorry, but the requested resource was not found on this site.</p>
</section>
<footer>
</footer>
</article>
<?php endif; ?>
</div> <!-- end #main -->
<div id="sidebar1" class="sidebar right col220">
<?php get_search_form(); ?>
</div>
</div> <!-- end #content -->
`