Skip to content

Commit

Permalink
修复排序可能会随机乱跳
Browse files Browse the repository at this point in the history
  • Loading branch information
owen0o0 committed Jan 15, 2020
1 parent 3ff47f2 commit 52dc2c7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion inc/fav-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function fav_con($mid) { ?>
'ignore_sticky_posts' => 1, //忽略置顶文章
'posts_per_page' => $site_n, //显示的文章数量
'meta_key' => '_sites_order',
'orderby' => 'meta_value_num',
'orderby' => array( 'meta_value_num' => 'DESC', 'ID' => 'DESC' ),
'tax_query' => array(
array(
'taxonomy' => 'favorites', //分类法名称
Expand Down
7 changes: 4 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}
?>

<div class="sites-list" style="margin-bottom: 8.5rem;">
<?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
Expand All @@ -47,7 +48,7 @@
}
}
}
}


} ?>
</div>
<?php
get_footer();
2 changes: 1 addition & 1 deletion single-sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</div>

<h4 class="text-gray mt-4"><i class="icon-io-tag" style="margin-right: 27px;" id="相关导航"></i>相关导航</h4>
<div class="row mb-5">
<div class="row" style="margin-bottom: 8.5rem;">
<?php
$post_num = 6;
$i = 0;
Expand Down
2 changes: 1 addition & 1 deletion templates/site-card.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="xe-user-name overflowClip_1">
<strong><?php the_title() ?></strong>
</div>
<p class="overflowClip_2"><?php echo get_post_meta($post->ID, '_sites_sescribe', true) ?: get_the_excerpt($post->ID); ?></p>
<p class="overflowClip_2"><?php echo get_post_meta($post->ID, '_sites_sescribe', true) ?: preg_replace("/(\s|\&nbsp\;| |\xc2\xa0)/","",get_the_excerpt($post->ID)); ?></p>
</div>
</div>
</a>
Expand Down

0 comments on commit 52dc2c7

Please sign in to comment.