diff --git a/assets/img/options/col-12.png b/assets/img/options/col-12.png new file mode 100644 index 0000000..9ad2bdc Binary files /dev/null and b/assets/img/options/col-12.png differ diff --git a/assets/img/options/col-8.png b/assets/img/options/col-8.png new file mode 100644 index 0000000..7226c6d Binary files /dev/null and b/assets/img/options/col-8.png differ diff --git a/inc/theme-options.php b/inc/theme-options.php index d505fcf..0e3b849 100644 --- a/inc/theme-options.php +++ b/inc/theme-options.php @@ -24,6 +24,8 @@ function kratos_options() { $sitename = get_bloginfo('name'); + $imagepath = get_template_directory_uri() . '/assets/img/options/'; + $seorobots = 'robots.txt'; $seoreading = '' . __('设置-阅读-对搜索引擎的可见性', 'kratos') . ''; @@ -344,6 +346,17 @@ function kratos_options() 'type' => 'upload', ); + $options[] = array( + 'name' => __('页面布局', 'kratos'), + 'desc' => __('是否显示侧边栏小工具(默认显示侧边栏),仅在文章页面生效', 'kratos'), + 'id' => "g_article_wodgets", + 'std' => "two_side", + 'type' => "images", + 'options' => array( + 'one_side' => $imagepath . 'col-12.png', + 'two_side' => $imagepath . 'col-8.png') + ); + $options[] = array( 'name' => __('站长配置', 'kratos'), 'type' => 'heading', diff --git a/single.php b/single.php index 73690d4..c69036c 100644 --- a/single.php +++ b/single.php @@ -6,11 +6,17 @@ * @version 2020.03.16 */ -get_header(); ?> +get_header(); +$col_array = array( + 'one_side' => 'col-lg-12', + 'two_side' => 'col-lg-8' +); +$select_col = $col_array[kratos_option('g_article_wodgets', 'two_side')]; +?>
-
+
+ +