加载模板

加载指定模板,增强代码复用性

官方文档:

get_template_part

https://developer.wordpress.org/reference/functions/get_template_part/

加载相关的模板,可提高主题代码的复用性。

举例:

一、

get_template_part( 'template-parts/content', 'none' );

加载指定目录下的content-none.php 模板

二、

get_template_part( 'template-parts/content', get_post_type() );

不懂,望留言指教

get_post_type

https://developer.wordpress.org/reference/functions/get_post_type/

剑网三PC端滑动区块 - WordPress区块

2020-10-17 0:17:12

教程

怎么知道本地与网站的链接速度?来ping一下 - wordpress教程

2020-6-6 16:19:34

⚠️
Npcink上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。
无意侵害您的权益,请发送邮件至 1355471563#qq.com 或点击右侧 私信:Muze 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索