您可以将主题和插件添加到WordPress wp content文件夹。
您还可以在主题中使用特定于主题的默认函数和after\\u switch\\u theme,以便它们在激活时自动设置。这些函数更新主题设置和插件设置,例如,您可以设置滑块设置。
示例:
add_action( \'after_switch_theme\', \'your_theme_setting_defaults\' );
function your_theme_setting_defaults() {
if( function_exists( \'your_themes_update_settings\' ) ) {
your_themes_update_settings( array(
\'blog_cat_num\' => 5,
\'content_archive\' => \'full\',
\'content_archive_limit\' => 0,
\'content_archive_thumbnail\' => 0,
\'image_alignment\' => \'alignleft\',
\'posts_nav\' => \'numeric\',
\'site_layout\' => \'content-sidebar\',
) );
}
}
您还需要将函数编码到主题中。
设置插件默认值示例代码:
add_filter( \'your_themes_slider_settings_defaults\', \'your_slider_defaults\' );
function your_slider_defaults( $defaults ) {
$args = array(
\'location_horizontal\' => \'left\',
\'location_vertical\' => \'top\',
\'posts_num\' => \'3\',
\'slideshow_excerpt_content_limit\' => \'100\',
\'slideshow_excerpt_content\' => \'full\',
\'slideshow_excerpt_width\' => \'30\',
\'slideshow_height\' => \'445\',
\'slideshow_more_text\' => __( \'Continue Reading…\', \'executive\' ),
\'slideshow_title_show\' => 1,
\'slideshow_width\' => \'1140\',
);
$args = wp_parse_args( $args, $defaults );
return $args;
}