站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
Theme Development
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
===插件API Hooks=== When developing Themes, it's good to keep in mind that your Theme should be set up so that it can work well with any WordPress plugins you (or another Theme user) might decide to install. Plugins add functionality to WordPress via "Action Hooks" (see [[WordPress:Plugin API]] for more information). Most Action Hooks are within the core PHP code of WordPress, so your Theme does not have to have any special tags for them to work. But a few Action Hooks do need to be present in your Theme, in order for Plugins to display information directly in your header, footer, sidebar, or in the page body. Here is a list of the special Action Hook Template Tags you need to include: 发展主题的时候,最好牢记你的主题得到了设置,这样它就能够很好地配合你(或者其它的主题用户)可能决定安装的WordPress插件。插件通过"Action Hooks"来给WordPress添加功能(请看看[[WordPress:Plugin API|插件API]]得到更多的信息)。大多数Action Hooks是在WordPress核心PHP代码内部,因此你的主题不要为它们的运行准备任何特别标签。但是有几个Action Hooks的确需要呈现在你的主题上,为了使插件能够直接地在你的页眉,页脚,工具条,或者在网页上显示信息。下面是你需要的特别Action Hook模板标签列表: ; wp_head ; wp_head : Goes in the [[WordPress:Glossary#HTML|HTML]] <tt><head></tt> element of a theme; <tt>header.php</tt> template. Example plugin use: add javascript code. : 进入 [[WordPress:Glossary#HTML|HTML]] <tt><head></tt> 主题元素; <tt>header.php</tt> 模板。例子插件使用: 添加 javascript 代码。 : Usage: <tt><nowiki><?php do_action('wp_head'); ?></nowiki></tt> :''-or-'' <tt><nowiki><?php wp_head(); ?></nowiki></tt> : 用法: <tt><nowiki><?php do_action('wp_head'); ?></nowiki></tt> :''-or-'' <tt><nowiki><?php wp_head(); ?></nowiki></tt> ; wp_footer ; wp_footer : Goes in the "footer" of a theme; <tt>footer.php</tt> template. Example plugin use: insert PHP code that needs to run after everything else, at the bottom of the footer. : 进入主题的"页脚"中; <tt>footer.php</tt> 模板。例子插件使用: 在页脚的底部,嵌入需要在所有内容运行之后运行的PHP代码。 : Usage: <tt><nowiki><?php do_action('wp_footer'); ?></nowiki></tt> :''-or-'' <tt><nowiki><?php wp_footer(); ?></nowiki></tt> : 用法: <tt><nowiki><?php do_action('wp_footer'); ?></nowiki></tt> :''-or-'' <tt><nowiki><?php wp_footer(); ?></nowiki></tt> ; wp_meta ; wp_meta : Typically goes in the <tt><nowiki><li>Meta</li></nowiki></tt> section of a theme's menu or sidebar; <tt>sidebar.php</tt> template. Example plugin use: include a rotating advertisement or a tag cloud. : 通常进入主题的菜单或者工具条的<tt><nowiki><li>Meta</li></nowiki></tt>部分; <tt>sidebar.php</tt> 模板。 例子插件使用: 包括旋转的广告或者标签cloud。 : Usage: <tt><nowiki><?php do_action('wp_meta'); ?></nowiki></tt> :''-or-'' <tt><nowiki><?php wp_meta(); ?></nowiki></tt> : 用法: <tt><nowiki><?php do_action('wp_meta'); ?></nowiki></tt> :''-or-'' <tt><nowiki><?php wp_meta(); ?></nowiki></tt> ; comment_form ; comment_form : Goes in <tt>comments.php</tt> and <tt>comments-popup.php</tt>, directly before the comment form's closing tag (<code><nowiki></form></nowiki></code>). Example plugin use: display a comment preview. : 进入 <tt>comments.php</tt> 和<tt>comments-popup.php</tt>中, 直接在评论形式的关闭标签 (<code><nowiki></form></nowiki></code>)前面。 例子插件使用: 显示一个评论预览。 : Usage: <tt><nowiki><?php do_action('comment_form', $post->ID); ?></nowiki></tt> : 用法: <tt><nowiki><?php do_action('comment_form', $post->ID); ?></nowiki></tt> For a real world usage example, you'll find these plugin hooks included in the default theme's templates. 对于真实的世界用法的例子,你将会发现这些插件hooks包含在默认主题的模板中。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)