Skip to content

Commit

Permalink
✨ 增加文章正文底部二维码配置 #114
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Feb 4, 2022
1 parent 8d2aa11 commit 8d42d0f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 7 deletions.
6 changes: 3 additions & 3 deletions assets/dist/libs.min.css

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions assets/dist/libs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/dist/style.min.css

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions assets/style/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,25 @@ a:hover {
}

}

.post-foot-qrcode {
margin-top: 20px;
text-align: center;

.title {
display: inline-block;
padding: 6px 10px;
background: #0e0e0e;
color: #fff;
border-radius: 10px;
font-size: 10px;
}

img {
width: 180px;
border-radius: 10px;
}
}
}
}

Expand Down Expand Up @@ -1854,6 +1873,7 @@ a:hover {
#index-company #prod-items .prod-item .icon, #post-menus {
background-color: @colorModeDarkBoxBg;
box-shadow: none;

&#header {
background-color: rgb(34 34 34 / 15%);
}
Expand Down
23 changes: 23 additions & 0 deletions inc/setting/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,29 @@ function optionsframework_options()
'type' => 'upload'
);

$options[] = array(
'name' => '文章正文底部二维码',
'desc' => '开启',
'id' => 'post_foot_qrcode_open',
'std' => '0',
'type' => 'checkbox'
);

$options[] = array(
'name' => '文章正文底部二维码标题',
'id' => 'post_foot_qrcode_title',
'std' => '',
'type' => 'text'
);

$options[] = array(
'name' => '文章正文底部二维码',
'desc' => '请选择宽高比例为1:1的图片',
'id' => 'post_foot_qrcode_img',
'std' => '',
'type' => 'upload'
);

$options[] = array(
'name' => '文章转载说明(若为空会自动引用全局底部版权说明内容)',
'id' => 'post_reprint_note',
Expand Down
7 changes: 7 additions & 0 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ class="czs-web-edit-l mr-1"></i><?php _e('编辑', PUOCK) ?></div>
<div class="entry-content mt20">
<div class="content-main puock-text" id="post-main-content">
<?php the_content(); ?>
<?php if (pk_is_checked('post_foot_qrcode_open')): ?>
<div class="post-foot-qrcode">
<div class="title"><?php echo pk_get_option('post_foot_qrcode_title', '无说明') ?></div>
<img src="<?php echo pk_get_option('post_foot_qrcode_img', '') ?>"
alt="post-qrcode">
</div>
<?php endif; ?>
</div>
<?php
$link_pages = wp_link_pages(array(
Expand Down

0 comments on commit 8d42d0f

Please sign in to comment.