ITeye博客

wordpress

共 9 篇文章

[WORDPRESS系列]在主题的 function.php 中给 WordPress 编辑器添加自定义按钮(Quicktags)

参考资料: http://www.ssdn2007.com/wordpress-add-quicktags-button-in-function-php.html http://codex.wordpress.org.cn/Quicktags_API http://yusi123.com/460.html functions.php 代码 <?php // 给editor添加更多默认按纽 function enable_more_buttons($buttons) { $buttons[] = 'hr'; $buttons[] = 'fontselect'; $buttons[] = 'su…

2015-04-20 15:09 · wordpress · WordPress

[WORDPRESS系列]子主题

参考来源: https://codex.wordpress.org/zh-cn:%E5%AD%90%E4%B8%BB%E9%A2%98 http://blog.wpjam.com/article/child-themes/

2015-04-20 14:40 · wordpress

[WORDPRESS系列]插件API之常用过滤器(filter)

参考来源:http://www.wordpress.la/codex-%E6%8F%92%E4%BB%B6API%E4%B9%8B%E5%B8%B8%E7%94%A8%E8%BF%87%E6%BB%A4%E5%99%A8(filter).html http://www.ssdn2007.com/wordpress-filter-reference.html 本文列出了WordPress 2.1及以上版本中,可用于插件开发的过滤器钩子(hook)。 想了解过滤器钩子和动作钩子的定义和作用?请看插件API。 想了解插件的基本编写过程?请看插件开发。 想查看动作钩子函数列表?请看插件API/常用动…

2015-04-20 14:22 · wordpress · WordPress

[WORDPRESS系列]插件API之常用动作(action)

参考来源: http://www.wordpress.la/codex-%E6%8F%92%E4%BB%B6API%E4%B9%8B%E5%B8%B8%E7%94%A8%E5%8A%A8%E4%BD%9C%28action%29.html 本文列出了WordPress 2.1及以上版本中可用于插件开发的动作钩子(hook)。 想了解过滤器钩子和动作钩子的定义和作用?请看插件API。 想了解插件的基本编写过程?请看插件开发。 想查看过滤器钩子函数列表?请看插件API之常用过滤器。 想查找WordPress 2.1之前版本的过滤器钩子和动作钩子?请看Plugin API/Hooks 2.0.x。…

2015-04-20 14:07 · wordpress · WordPress

[WORDPRESS系列]WordPress 模板层次详细介绍

参考来源:http://blog.wpjam.com/article/wordpress-template-hierarchy/ WordPress模板的定义非常方便,但是在定制模板之前,我们有必要知道WordPress的模板层次,了解WordPress是如何加载模板文件的,这将有利于开发模板时合理利用资源及提高工作效率。 万能的index.php 我们知道一个最简单的WordPress主题只需要 style.css 和 index.php 文件即可。这代表着 index.php 可以是任何一个页面的模板,无论是首页,还是文章页,或是分类页,再或者是搜索结果页面,它都能完美胜任。 也就是说,…

2015-04-20 10:51 · wordpress · WordPress

[WORDPRESS系列]dashboard 外观添加小工具

参考 http://codex.wordpress.org/zh-cn:%E4%BB%A4%E4%B8%BB%E9%A2%98%E6%94%AF%E6%8C%81%E5%B0%8F%E5%B7%A5%E5%85%B7 在functions.php 添加 <?php if ( function_exists('register_sidebar') ) register_sidebar(); ?>

2015-04-17 17:49 · wordpress · WordPress

[WORDPRESS系列] : endif;endwhile;流程控制的替代语法

参考:http://php.net/manual/zh/control-structures.alternative-syntax.php

2015-04-17 14:56 · wordpress · WordPress

[WORDPRESS系列]常用函数

[b]wpautop[/b] 简介 将文本中的两个换行符转换成 HTML 段落 ( ... ),其余的换行转换成 WordPress 使用这个函数对日志内容和摘要进行格式化处理。 用法 [code="java"][/code] 参考:http://blog.wpjam.com/function_reference/wpautop/ post相关函数 [b]the_category()[/b] the_category() 是用来调用日志的在的所有类别的 PHP 函数 [b]_e();[/b] Displays the returned translated text from transla…

2015-04-17 14:47 · wordpress · WordPress

[WORDPRESS系列]WordPress的have_posts()和the_post()用法解析

在WordPress的index.php文章循环输出中,通常会有下面一段代码: <?phpif(have_posts()) : ?> <?phpwhile(have_posts()) : the_post(); ?> <!–PHP代码 –> <?php endwhile; ?> <?php endif; ?> 这里有两个函数,have_posts()和the_post()。 have_posts()解析:WordPress的have_posts() 默认是一个全局函数。 have_posts函数被调用时实际上是调用全局变量$wp_query->have_posts()成员函数,来简单检查一个…

2015-04-17 14:28 · wordpress · WordPress