继续在帖子里面阅读wordpress

时间:2016-12-22 03:42:24

标签: jquery wordpress

如何插入像&#34这样的按钮;继续阅读"在帖子内,with this style in wordpress? or this 不使用bb代码,并在第二段之前。

1 个答案:

答案 0 :(得分:0)

步骤-1:转到设置 - >阅读并选择摘要并保存更改。

步骤-2:我们需要在每个摘录的末尾添加链接文字。为此,我们需要在一个名为functions.php的不同文件中工作。

找到它并在代码编辑器中打开它。

滚动到最底部并添加此PHP代码块:

/* Modify the read more link on the_excerpt() */

function et_excerpt_length($length) {
    return 220;
}
add_filter('excerpt_length', 'et_excerpt_length');

/* Add a link  to the end of our excerpt contained in a div for styling purposes and to break to a new line on the page.*/

function et_excerpt_more($more) {
    global $post;
    return '<div class="view-full-post"><a href="'. get_permalink($post->ID) . '" class="view-full-post-btn">View Full Post</a></div>;';
}
add_filter('excerpt_more', 'et_excerpt_more');

如需更多参考,请找到: https://www.elegantthemes.com/blog/tips-tricks/how-to-customize-the-wordpress-read-more-link-text

相关问题