Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 在搜索结果上显示全部内容-2014主题_Wordpress_Themes - Fatal编程技术网

Wordpress 在搜索结果上显示全部内容-2014主题

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

我用的是214主题。我想在搜索结果页面上显示文章的全部内容,而不仅仅是文章的摘录

请给我答案


谢谢。

在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">&rarr;</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">&rarr;</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">&rarr;</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; ?>