mirror of https://github.com/vtrois/kratos
feat: add article layout (#219)
parent
a09a3b7c12
commit
9a3d0191cd
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 283 B |
|
@ -24,6 +24,8 @@ function kratos_options()
|
||||||
{
|
{
|
||||||
$sitename = get_bloginfo('name');
|
$sitename = get_bloginfo('name');
|
||||||
|
|
||||||
|
$imagepath = get_template_directory_uri() . '/assets/img/options/';
|
||||||
|
|
||||||
$seorobots = '<a href="' . home_url() . '/robots.txt" target="_blank">robots.txt</a>';
|
$seorobots = '<a href="' . home_url() . '/robots.txt" target="_blank">robots.txt</a>';
|
||||||
$seoreading = '<a href="' . admin_url('options-reading.php') . '" target="_blank">' . __('设置-阅读-对搜索引擎的可见性', 'kratos') . '</a>';
|
$seoreading = '<a href="' . admin_url('options-reading.php') . '" target="_blank">' . __('设置-阅读-对搜索引擎的可见性', 'kratos') . '</a>';
|
||||||
|
|
||||||
|
@ -344,6 +346,17 @@ function kratos_options()
|
||||||
'type' => 'upload',
|
'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(
|
$options[] = array(
|
||||||
'name' => __('站长配置', 'kratos'),
|
'name' => __('站长配置', 'kratos'),
|
||||||
'type' => 'heading',
|
'type' => 'heading',
|
||||||
|
|
12
single.php
12
single.php
|
@ -6,11 +6,17 @@
|
||||||
* @version 2020.03.16
|
* @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')];
|
||||||
|
?>
|
||||||
<div class="k-main <?php echo kratos_option('top_select', 'banner'); ?>" style="background:<?php echo kratos_option('g_background', '#f5f5f5'); ?>">
|
<div class="k-main <?php echo kratos_option('top_select', 'banner'); ?>" style="background:<?php echo kratos_option('g_background', '#f5f5f5'); ?>">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 details">
|
<div class="<?php echo $select_col ?> details">
|
||||||
<?php if (have_posts()) : the_post(); update_post_caches($posts); ?>
|
<?php if (have_posts()) : the_post(); update_post_caches($posts); ?>
|
||||||
<div class="article">
|
<div class="article">
|
||||||
<div class="breadcrumb-box">
|
<div class="breadcrumb-box">
|
||||||
|
@ -128,9 +134,11 @@ get_header(); ?>
|
||||||
</nav>
|
</nav>
|
||||||
<?php comments_template(); ?>
|
<?php comments_template(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if (kratos_option('g_article_wodgets', 'two_side') == 'two_side'){ ?>
|
||||||
<div class="col-lg-4 sidebar d-none d-lg-block">
|
<div class="col-lg-4 sidebar d-none d-lg-block">
|
||||||
<?php dynamic_sidebar('sidebar_tool'); ?>
|
<?php dynamic_sidebar('sidebar_tool'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue