Skip to content

Commit 9350f94

Browse files
committed
more+ button
1 parent e86e43c commit 9350f94

File tree

7 files changed

+29
-13
lines changed

7 files changed

+29
-13
lines changed

css/nav.css

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/fav-content.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?php if ( ! defined( 'ABSPATH' ) ) { exit; }
22
function fav_con($mid) { ?>
3-
<h4 class="text-gray"><i class="icon-io-tag" style="margin-right: 27px;" id="<?php echo $mid->name; ?>"></i><?php echo $mid->name; ?></h4>
3+
<h4 class="text-gray" style="display: inline-block;"><i class="icon-io-tag" style="margin-right: 27px;" id="<?php echo $mid->name; ?>"></i><?php echo $mid->name; ?></h4>
4+
<?php
5+
$link = esc_url( get_term_link( $mid, 'res_category' ) );
6+
echo "<a class='btn-move' href='$link'>more+</a>";
7+
?>
48
<div class="row">
59
<?php
610
//定义$post为全局变量,这样之后的输出就不会是同一篇文章了
@@ -9,7 +13,7 @@ function fav_con($mid) { ?>
913
$args = array(
1014
'post_type' => 'sites', //自定义文章类型,这里为sites
1115
'ignore_sticky_posts' => 1, //忽略置顶文章
12-
'posts_per_page' => -1, //显示的文章数量
16+
'posts_per_page' => io_get_option('site_n'), //显示的文章数量
1317
'meta_key' => '_sites_order',
1418
'orderby' => 'meta_value_num',
1519
'tax_query' => array(

inc/frame/config/framework.config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@
124124
'white' => '亮色'
125125
),
126126
),
127+
array(
128+
'id' => 'site_n',
129+
'type' => 'number',
130+
'title' => '网址数量',
131+
'default' => '-1',
132+
'desc' => '首页分类下显示的网址数量',
133+
'after' => '<p>-1 为显示分类下所有网址</p>',
134+
),
127135
array(
128136
'id' => 'icp',
129137
'type' => 'text',

inc/meta-boxes.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ function new_meta_sites_boxes() {
8282
if (isset($meta_box['std']) && $meta_box['std'] == 'true') $checked = 'checked = "checked"';
8383
else $checked = '';
8484
echo '<br /><label><input type="checkbox" name="' . $meta_box['name'] . '" value="true" ' . $checked . ' />';
85-
echo '' . $meta_box['title'] . '</label><br />';
85+
echo '' . $meta_box['title'] . '</label><br /><br />';
8686
break;
8787
case 'upload':
8888
$button_text = (isset($meta_box['button_text'])) ? $meta_box['button_text'] : 'Upload';
8989
echo '<h4>' . $meta_box['title'] . '</h4>';
90-
echo '<input class="damiwp_url_input" style="width: 95%;margin-bottom: 10px;" type="text" id="'.$meta_box['name'].'_input" size="'.$meta_box['size'].'" value="'.$meta_box['std'].'" name="'.$meta_box['name'].'"/><a href="#" id="'.$meta_box['name'].'" class="dami_upload_button button">'.$button_text.'</a>';
91-
add_script_and_styles();
90+
echo '<input class="damiwp_url_input" style="width: 95%;margin-bottom: 10px;" type="text" id="'.$meta_box['name'].'_input" size="'.$meta_box['size'].'" value="'.$meta_box['std'].'" name="'.$meta_box['name'].'"/><br><a href="#" id="'.$meta_box['name'].'" class="dami_upload_button button">'.$button_text.'</a>';
91+
//add_script_and_styles();
9292
break;
9393
}
9494
}
9595
}
9696
function create_meta_sites_box() {
9797
global $theme_name;
9898
if (function_exists('add_meta_box')) {
99-
add_meta_box('new-meta-boxes', '添加链接', 'new_meta_sites_boxes', 'sites', 'normal', 'high');
99+
add_meta_box('new-meta-boxes', '网址链接属性', 'new_meta_sites_boxes', 'sites', 'normal', 'high');
100100
}
101101
}
102102
function save_sites_postdata($post_id) {
@@ -119,6 +119,7 @@ function save_sites_postdata($post_id) {
119119
add_action('admin_menu', 'create_meta_sites_box');
120120
add_action('save_post', 'save_sites_postdata');
121121

122+
add_action( 'admin_footer', 'add_script_and_styles' );
122123
function add_script_and_styles() {
123124
echo "<script>
124125
jQuery(document).ready(function(){

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626
?>
2727

28-
<?php if(!wp_is_mobile() && io_get_option('ad_home_s')) echo '<div class="ad ad-home">' . stripslashes( io_get_option('ad_home') ) . '</div>'; ?>
28+
<?php if(!wp_is_mobile() && io_get_option('ad_home_s')) echo '<div class="row"><div class="ad ad-home col-md-6">' . stripslashes( io_get_option('ad_home') ) . '</div><div class="ad ad-home col-md-6 visible-md-block visible-lg-block">' . stripslashes( io_get_option('ad_home') ) . '</div></div>'; ?>
2929

3030
<?php
3131
foreach($categories as $category) {

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Theme Name:WebStack
33
Theme URI:https://www.iowen.cn
44
Description:by 一为!官方网站:<a href="https://www.iowen.cn">一为忆</a>
5-
Version:1.1207
5+
Version:1.1208
66
Author:iowen
77
Author URI: https://www.iowen.cn/
88
*/

templates/header-banner.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
<i class="fa fa-bars"></i>
77
</a>
88
</li>
9+
<!-- 天气 -->
910
<li>
1011
<div id="he-plugin-simple"></div>
1112
<script>WIDGET = {CONFIG: {"modules": "12034","background": 5,"tmpColor": "aaa","tmpSize": 16,"cityColor": "aaa","citySize": 16,"aqiSize": 16,"weatherIconSize": 24,"alertIconSize": 18,"padding": "30px 10px 30px 10px","shadow": "1","language": "auto","borderRadius": 5,"fixed": "false","vertical": "middle","horizontal": "left","key": "a922adf8928b4ac1ae7a31ae7375e191"}}</script>
1213
<script src="https://widget.heweather.net/simple/static/js/he-simple-common.js?v=1.1"></script>
1314
</li>
15+
<!-- 天气 end -->
1416
</ul>
1517
</div>
1618
<a href="https://github.com/owen0o0/WebStack" target="_blank"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>

0 commit comments

Comments
 (0)