首页 > wordpress建站 > wordpress教程 > WordPress 4.1 新增函数
摘要:add_theme_support( 'title-tag' ) 在 wordpress 4.1 开始新增了一个名为 t...

add_theme_support( ‘title-tag’ )

在 wordpress 4.1 开始新增了一个名为 title-tag 的主题特性。
通过声明这个特性,主题就能知道自身并没有定义标题,wordpress 就可以安全的添加标题而无须担心会导致重复添加。

1
2
3
4
function theme_slug_setup() {
   add_theme_support( 'title-tag' );
}
add_action( 'after_setup_theme''theme_slug_setup' );

the_post_navigation() / get_the_post_navigation()

返回当前文章的前/后导航。

1
2
3
4
while ( have_posts() ) : the_post();
    get_template_part( 'content', get_post_format() );
    the_post_navigation();
endwhile// end of the loop.
分享到:
赞(1) 打赏

作者: 大挖酱

挖主题团队自2014年开始专注于WordPress企业主题设计开发,致力于为更多用户打造出更漂亮、更易用、更专业的网站。距今已累计开发近50款WP主题,付费客户超过5千人。挖主题,是您可以长期信赖的合作伙伴。

73 queries in 0.554 seconds

联系作者Q: 8413708 WX: zdmin7

支付宝扫一扫

微信扫一扫