Tag Archives: wordpress

wordpress Appearance menus

一直在想给wordpress导航栏添加菜单, 原来从3.0以后, 有了个新功能叫menus, 很方便, 我介绍下 1.创建menus 如上图输入你的menu名, 然后点击create menu 2.添加item 可以看到 custom links, categories, pages, 选择好 add to menu 就可以, 然后save menu 3. 添加到导航栏 Theme locations 选择需要显示的menu, 然后save 4.二级菜单实现 拖动item缩进

Posted in php | Tagged , | Leave a comment

wordpress_Function Reference_get template part

在wordpress3.0以后的版本可以看到这样的代码 如果你不明白可以参考: http://codex.wordpress.org/Function_Reference/get_template_part 下面是我笨拙的翻译 描述: 加载一个制定的模板到另一个模板里面(不同于包含header,sidebar,footer). 使得一个主题使用子模板来实现代码段重用变得简单 用于在模板中包含指定的模板文件,只需用指定参数slug和name就可以包含文件{slug}-{name}.php,最重要的功能是如果没有这个文件就包含没有{slug}的.php文件文件 使用方法: 参数: $slug (必须) 通用的模板名 $name (可选) 指定的模板名 示例: 使用 loop.php 在子主题里面 假设主题文件夹wp-content/themes下父主题是twentyten子主题twentytenchild,那么下面的代码: php 的require()函数将按下面优先级包含文件 1. wp-content/themes/twentytenchild/loop-index.php 2. wp-content/themes/twentytenchild/loop.php 3. wp-content/themes/twentyten/loop-index.php 4. wp-content/themes/twentyten/loop.php 导航 使用通用的nav.php文件给主题添加导航条:

Posted in php | Tagged | Leave a comment

wordpress图片水印插件 Watermark RELOADED

wordpress 图片水印插件Watermark reloaded 可以设置在何种尺寸上添加水印,添加水印的位置,文字颜色字体尺寸都可以设置,相当不错 最近发现个漏洞,就是上传非图片文件时该插件也进行加水印处理

Posted in php | Tagged | Leave a comment