0
我有一個自定義content-searchresults.php頁面。然而,由於某種原因,它沒有顯示摘錄,但其他修改我使這個被拉過所以它使用這個模板。Wordpress自定義搜索結果頁面未顯示摘錄
以下是我的代碼。
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if (has_post_thumbnail() && ! post_password_required() && !is_single()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail('full', array('class' => 'img-responsive')); ?>
</a>
<?php endif; ?>
<div class="clearfix">
<header class="entry-header ">
<?php if (in_array('category', get_object_taxonomies(get_post_type())) && CrippsTheme_categorized_blog()) : ?>
<div class="entry-meta">
<span class="cat-links"><?php echo get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'CrippsTheme')); ?></span>
</div>
<?php
endif;
if (is_single()) :
the_title('<h1 class="entry-title">', '</h1>');
else :
the_title('<h1 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h1>');
endif;
?>
</header><!-- .entry-header -->
</div>
<div class="entry-summary clearfix">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<div class="clearfix">
<a class="read-more" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
Read more
</a>
</div>