Wordpress 在搜索结果上显示全部内容-2014主题
我用的是214主题。我想在搜索结果页面上显示文章的全部内容,而不仅仅是文章的摘录 请给我答案Wordpress 在搜索结果上显示全部内容-2014主题,wordpress,themes,Wordpress,Themes,我用的是214主题。我想在搜索结果页面上显示文章的全部内容,而不仅仅是文章的摘录 请给我答案 谢谢。在content.php文件中,您将看到以下代码: <?php if ( is_search() ) : ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <di
谢谢。在content.php文件中,您将看到以下代码:
<?php if ( is_search() ) : ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
?>
</div><!-- .entry-content -->
<?php endif; ?>
谢谢你的回答。如果我想把这个函数放到插件中,我该如何编写代码?谢谢Shello Nick,我已经测试了你的代码,它成功了。有可能为此编写插件吗?对于这种事情,子主题比插件更合适。
<?php if ( is_search() ) : ?>
<div class="entry-content">
<?php the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) ); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
?>
</div><!-- .entry-content -->
<?php endif; ?>