2017-01-19 74 views
1

我想隱藏所有帖子中的精選圖像。我試過隱藏過分圖像插件。也有類似帖子的一些公式:將帖子中的精選圖像隱藏[Tesseract]

.blog .entry-thumbnail { display: none; } 

但它不起作用。

我的內容單一的文件是波紋管:

<?php 
/** 

* @package Tesseract 

*/ 
?> 

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 

<?php $featImg_pos = get_theme_mod('tesseract_blog_featimg_pos'); 
    if (has_post_thumbnail() && (!$featImg_pos || ($featImg_pos == 'above'))) 
     tesseract_output_featimg_blog(); ?> 
    <?php //if (my_theme_show_page_header()) : ?> 

     <header class="entry-header"> 

      <?php the_title('<div id="blogpost_title"><h1 class="entry-title">', '</h1></div>'); ?> 

      <?php 

      $postDate = get_theme_mod('tesseract_blog_date'); 

      if ($postDate == 'showdate') { ?> 

       <span><i class="fa fa-calendar" aria-hidden="true"></i><?php the_time('F j, Y'); ?></span> 

      <?php } ?> 

      <?php 

      $postAuthor = get_theme_mod('tesseract_blog_author'); 

      if ($postAuthor == 'showauthor') { ?> 

       <span><i class="fa fa-user" aria-hidden="true"></i><?php the_author(); ?></span> 

      <?php } ?> 

      <?php 

      $mypostComment = get_theme_mod('tesseract_blog_comments'); 

      if (($mypostComment == 'showcomment') && (comments_open())) { ?> 

       <span><i class="fa fa-comments-o" aria-hidden="true"></i><?php //comments_number('(No Comments)', '(1 Comment)', '(% Comments)');?><?php comments_popup_link(
    'No comments exist', '1 comment', '% comments'); ?></span> 

      <?php } 

      ?> 

     </header><!-- .entry-header --> 

    <?php //endif; ?> 

    <?php if (has_post_thumbnail() && ($featImg_pos == 'below')) 

     tesseract_output_featimg_blog(); ?> 

    <div class="entry-content"> 

     <div class="entry-meta"> 

      <?php tesseract_posted_on(); ?> 

     </div><!-- .entry-meta --> 

     <?php if (has_post_thumbnail() && ($featImg_pos == 'left')) { ?> 

     <div class="myleft"> 

     <?php tesseract_output_featimg_blog(); ?> 

     <?php the_content(); ?> 

     <?php the_tags()?> 

     </div> 

     <?php } elseif (has_post_thumbnail() && ($featImg_pos == 'right')){ ?> 

     <div class="myright"> 

     <?php tesseract_output_featimg_blog(); ?> 

     <?php the_content(); ?> 

     <?php the_tags()?> 

     </div> 

     <?php } else { ?> 

     <?php the_content(); ?> 

     <?php } ?> 

     <?php  
      wp_link_pages(array(

       'before' => '<div class="page-links">' . __('Pages:', 'tesseract'), 

       'after' => '</div>', 

      )); 

     ?> 

    </div><!-- .entry-content --> 
</article><!-- #post-## --> 

這是很複雜的,所以你們知道如何解決這個問題?

回答

0

嘗試註釋掉是說tesseract_output_featimg_blog();線,所以這一點:

<?php tesseract_output_featimg_blog(); ?> 

變成這樣:

<?php /* tesseract_output_featimg_blog(); */ ?> 

我看到4次出現,它看起來像他們涉及到不同特色圖片在主題中的位置。

作爲一個方面說明,不建議改變你的主題文件,除非你在一個兒童主題內進行。

+0

謝謝!它的工作:) – ppi0trek

+0

優秀!再次,小心修改這些主題文件,我強烈建議將它們複製到一個兒童主題。這樣,您可以在受控區域進行所需的所有修改。如果你不這樣做,當你的主題得到更新時,所有這些變化將會消失。 – Jonathan

0

有些主題讓用戶可以選擇是否真的想在他們的帖子中使用精選圖片。如果你剛開始使用你的博客/網站,我寧願建議搜索一個這樣的WordPress主題。

此外,與@Jonathan同意,我也建議不要玩你的主題文件。幾天前我嘗試更改主題文件,出於同樣的原因,最終結束了我的主題代碼。因此,我無法登錄到我的博客。所以,最好小心點。

+0

謝謝:)我有每個文件的備份,所以即使出現問題我可以撤消這一點。 – ppi0trek

相關問題