wordpress
tthc333
这个作者很懒,什么都没留下…
展开
-
wordpress foreach用法
$formats = get_post_format_slugs(); foreach ( (array) $formats as $i => $format ) { $formats[$i] = 'post-format-' . $format;} $standard_posts = get_posts( array( 'tax_query' => array( array( 'taxonomy原创 2012-04-20 11:29:39 · 1134 阅读 · 0 评论 -
在wordpress the_category()函数生成的分类列表里移除指定分类名链接
将以下代码加入function.phpfunction the_category_filter($thelist,$separator=' ') { if(!defined('WP_ADMIN')) { //要移除的分类ID,这里是1和5 $exclude = array(1,5); $exclude2 = array(); foreach($exclude as $c) { $exclude2[原创 2012-04-20 11:33:03 · 799 阅读 · 1 评论 -
wordpress中文摘要
将以下两个函数写进主题所附带的functions.php文件中function Limit_Char($max_char = 200, $more_text = '...', $more_link_text = '', $limit_type = 'content') {if ($limit_type == 'title') { $limiter = get_the_title();原创 2012-04-20 11:35:49 · 453 阅读 · 0 评论