是否可以删除主页上的帖子缩略图?

问题描述 投票:-1回答:3

我知道您可能已经回答了许多问题,但就我而言,我无法使用您的建议。

我在博客上拥有Blu Chic的Adelle主题(现在,在将博客移到自己的主机上之前,我只是测试不同的功能并进行更改)。我对archive.php进行了相同的更改,以更改帖子在类别和存档中的显示方式。

   <div style="height:251px; display:block; margin:0 0 20px 0;"><h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php echo get_the_post_thumbnail( $post_id, array(174,251), array('class' => 'alignleft'), $attr ); ?> </a><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title();?> </a></h3>

   <?php the_excerpt(); ?></div>

我工作,但是…在编辑新帖子期间,我必须设置精选的/缩略图图像。这算不上问题。问题出现在第一页上,因为现在我有2张图像-一个小和一个大。是否可以删除主页上的帖子缩略图?

我将非常感谢您的帮助!

最佳,

Kasia

wordpress thumbnails
3个回答
0
投票

对于您的帖子,您需要使用两张图片,其中一张在存档页面的首页上,另一张在帖子详细信息页面上,您可以为此使用一个最好的插件

http://wordpress.org/plugins/multiple-post-thumbnails/

通过使用多个帖子缩略图插件,您可以看到帖子的两个特色图像,一个可以显示在主页上,另一个可以显示在帖子详细信息页面上或您要显示的任何部分。


0
投票

如果要删除缩略图,只需删除/注释显示缩略图的php代码,如下所示:

<div style="height:251px; display:block; margin:0 0 20px 0;">
  <h3>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
       <?php //echo get_the_post_thumbnail( $post_id, array(174,251), array('class' => 'alignleft'), $attr ); ?>   <!-- Notice the  //  just after the first <?php tag
    </a> 
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
        <?php the_title();?> 
    </a>
  </h3>
</div>

0
投票

您只需要在主页上找到属于那些缩略图的CSS类,并在Additional CSS中添加CSS属性:

display: none

对于屏幕截图,您可以查看此指南:https://www.helpmegeek.com/remove-featured-thumbnails-list-pages-wordpress/

© www.soinside.com 2019 - 2024. All rights reserved.