Skip to content

Commit

Permalink
more+ button
Browse files Browse the repository at this point in the history
  • Loading branch information
owen0o0 committed Dec 7, 2019
1 parent e86e43c commit 9350f94
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 13 deletions.
11 changes: 6 additions & 5 deletions css/nav.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions inc/fav-content.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php if ( ! defined( 'ABSPATH' ) ) { exit; }
function fav_con($mid) { ?>
<h4 class="text-gray"><i class="icon-io-tag" style="margin-right: 27px;" id="<?php echo $mid->name; ?>"></i><?php echo $mid->name; ?></h4>
<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>
<?php
$link = esc_url( get_term_link( $mid, 'res_category' ) );
echo "<a class='btn-move' href='$link'>more+</a>";
?>
<div class="row">
<?php
//定义$post为全局变量,这样之后的输出就不会是同一篇文章了
Expand All @@ -9,7 +13,7 @@ function fav_con($mid) { ?>
$args = array(
'post_type' => 'sites', //自定义文章类型,这里为sites
'ignore_sticky_posts' => 1, //忽略置顶文章
'posts_per_page' => -1, //显示的文章数量
'posts_per_page' => io_get_option('site_n'), //显示的文章数量
'meta_key' => '_sites_order',
'orderby' => 'meta_value_num',
'tax_query' => array(
Expand Down
8 changes: 8 additions & 0 deletions inc/frame/config/framework.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@
'white' => '亮色'
),
),
array(
'id' => 'site_n',
'type' => 'number',
'title' => '网址数量',
'default' => '-1',
'desc' => '首页分类下显示的网址数量',
'after' => '<p>-1 为显示分类下所有网址</p>',
),
array(
'id' => 'icp',
'type' => 'text',
Expand Down
9 changes: 5 additions & 4 deletions inc/meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ function new_meta_sites_boxes() {
if (isset($meta_box['std']) && $meta_box['std'] == 'true') $checked = 'checked = "checked"';
else $checked = '';
echo '<br /><label><input type="checkbox" name="' . $meta_box['name'] . '" value="true" ' . $checked . ' />';
echo '' . $meta_box['title'] . '</label><br />';
echo '' . $meta_box['title'] . '</label><br /><br />';
break;
case 'upload':
$button_text = (isset($meta_box['button_text'])) ? $meta_box['button_text'] : 'Upload';
echo '<h4>' . $meta_box['title'] . '</h4>';
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>';
add_script_and_styles();
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>';
//add_script_and_styles();
break;
}
}
}
function create_meta_sites_box() {
global $theme_name;
if (function_exists('add_meta_box')) {
add_meta_box('new-meta-boxes', '添加链接', 'new_meta_sites_boxes', 'sites', 'normal', 'high');
add_meta_box('new-meta-boxes', '网址链接属性', 'new_meta_sites_boxes', 'sites', 'normal', 'high');
}
}
function save_sites_postdata($post_id) {
Expand All @@ -119,6 +119,7 @@ function save_sites_postdata($post_id) {
add_action('admin_menu', 'create_meta_sites_box');
add_action('save_post', 'save_sites_postdata');

add_action( 'admin_footer', 'add_script_and_styles' );
function add_script_and_styles() {
echo "<script>
jQuery(document).ready(function(){
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
?>

<?php if(!wp_is_mobile() && io_get_option('ad_home_s')) echo '<div class="ad ad-home">' . stripslashes( io_get_option('ad_home') ) . '</div>'; ?>
<?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>'; ?>

<?php
foreach($categories as $category) {
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Theme Name:WebStack
Theme URI:https://www.iowen.cn
Description:by 一为!官方网站:<a href="https://www.iowen.cn">一为忆</a>
Version:1.1207
Version:1.1208
Author:iowen
Author URI: https://www.iowen.cn/
*/
2 changes: 2 additions & 0 deletions templates/header-banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<i class="fa fa-bars"></i>
</a>
</li>
<!-- 天气 -->
<li>
<div id="he-plugin-simple"></div>
<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>
<script src="https://widget.heweather.net/simple/static/js/he-simple-common.js?v=1.1"></script>
</li>
<!-- 天气 end -->
</ul>
</div>
<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>
Expand Down

0 comments on commit 9350f94

Please sign in to comment.