WordPress Theme

评论

评论表单 comment_form()

$args = array(
    'fields'=>array(
        'author'=>'<div class="commenter-inputs"><label for="author"><span class="label">Name*</span><input type="text" name="author" value="' . $comment_author . '" placeholder="' . __('Nickname', 'mytheme') . ($req ? '*' : '') . '" /></label>',
        'email'=>'<label for="email"><span class="label">Email*</span><input type="email" name="email" value="' . $comment_author_email . '" placeholder="Email' . ($req ? "*" : "") . '" /></label></div>',
    ),
    'comment_field'=>'<textarea name="comment" id="comment" tabindex="4" placeholder="' . __('Your comment here.Say some useful.', 'mytheme') . '"></textarea>',
    'comment_notes_before' =>'',
    'comment_notes_after' => '',
);
comment_form($args);

参见:codex.wordpress.org

目录

获取目录 get_categories()

默认参数(Default Usage)

$categories = get_categories(array(
array(
'type'=>'post',
'child_of'=>0,
'parent'=>'',
'orderby'=>'name',
'order'=>'ASC',
'hide_empty'=>1,
'hierarchical'=>1,
'exclude'=>'',
'include'=>'',
'number'=>'',
'taxonomy'=>'category',
'pad_counts'=>false);?>
));

所有 $categories 内容

$category->term_id
$category->name
$category->slug
$category->term_group
$category->term_taxonomy_id
$category->taxonomy
$category->description
$category->parent
$category->count
$category->cat_ID
$category->category_count
$category->category_description
$category->cat_name
$category->category_nicename
$category->category_parent

参见:codex.wordpress.org.cn

特定功能

添加特色图像支持

Featured Image 可提供文章内和首页图片的现实及首页幻灯片的实现

if ( function_exists('add_theme_support') ) {
    add_theme_support('post-thumbnails');
}

参见:www.solagirl.net