图片说明了一切。。。页面编辑:
搜索结果:
功能。php启用页面摘录
add_post_type_support( \'page\', \'excerpt\' );
搜索。用于显示摘录的php代码
<?php the_excerpt(); ?>
<!-- tried <?php echo get_the_excerpt();?> too -->
完全搜索。php代码
<?php
/**
* The template for displaying Search Results pages.
*
* @package Shape
* @since Shape 1.0
*/
get_header();
get_template_part(\'inc/header-image\');?>
<div class=\'wrapper\'>
<div class=\'container main\'>
<div class=\'post-area grid_9\'>
<div class=\'posts-container\'>
<header class="page-header">
<h1 class="page-title"><?php printf( __( \'Resultados da Busca\' ), \'<span>\' . get_search_query() . \'</span>\' ); ?></h1>
<input type="search" value="<?php printf( __( \'%s\' ), \'\' . get_search_query() . \'\' ); ?>"></input>
</header><!-- .page-header -->
<div class="linha-horizontal"></div>
<?php while (have_posts()) : the_post(); ?>
<div class="post-entry clearfix"> <!-- Main wrapper -->
<div class="post-entry-content"> <!-- Post-entry-content -->
<h2><a class="search-item-title" href="<?php the_permalink(\' \') ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(\' \') ?>" class="post-entry-read-more" title="<?php the_title(); ?>"><?php the_permalink(\' \') ?></a>
<div class="linha-horizontal search-divider"></div>
</div><!-- END of post-entry-content -->
</div><!--End of main wrapper -->
<?php endwhile; ?>
</div>
</div>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>