Skip to content

Commit

Permalink
修复详情页不显示自定义图标的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
owen0o0 committed Dec 8, 2019
1 parent 9350f94 commit d9b7d97
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions css/nav.css

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

12 changes: 9 additions & 3 deletions inc/fav-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
function fav_con($mid) { ?>
<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>";
$site_n = io_get_option('site_n');
$category_count = $mid->category_count;
$count = $site_n;
if($site_n == 0) $count = min(get_option('posts_per_page'),$category_count);
if($site_n >= 0 && $count < $category_count){
$link = esc_url( get_term_link( $mid, 'res_category' ) );
echo "<a class='btn-move' href='$link'>more+</a>";
}
?>
<div class="row">
<?php
Expand All @@ -13,7 +19,7 @@ function fav_con($mid) { ?>
$args = array(
'post_type' => 'sites', //自定义文章类型,这里为sites
'ignore_sticky_posts' => 1, //忽略置顶文章
'posts_per_page' => io_get_option('site_n'), //显示的文章数量
'posts_per_page' => $site_n, //显示的文章数量
'meta_key' => '_sites_order',
'orderby' => 'meta_value_num',
'tax_query' => array(
Expand Down
7 changes: 4 additions & 3 deletions single-sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
<div class="row">
<div class="col-12 col-sm-4 col-lg-3">
<?php
$m_link_url = get_post_meta($post->ID, '_sites_link', true);
if($m_link_url == '')
$m_link_url = get_post_meta($post->ID, '_sites_link', true);
$m_thumbnail = get_post_meta(get_the_ID(), '_thumbnail', true);
if($m_thumbnail == '' && $m_link_url == '')
$imgurl = get_template_directory_uri() .'/images/favicon.png';
else
$imgurl = get_post_meta(get_the_ID(), '_thumbnail', true)? get_post_meta(get_the_ID(), '_thumbnail', true): (io_get_option('ico_url') .format_url($m_link_url) . io_get_option('ico_png'));
$imgurl = $m_thumbnail? $m_thumbnail : (io_get_option('ico_url') .format_url($m_link_url) . io_get_option('ico_png'));
$sitetitle = get_the_title();
?>
<div class="siteico">
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.1208
Version:1.1208.1
Author:iowen
Author URI: https://www.iowen.cn/
*/

0 comments on commit d9b7d97

Please sign in to comment.