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>