我正在使用 Twenty-Sixteen 主题作为子主题,我想删除粘性帖子下的"精选"文本行,并将其替换为同一位置的图像。
我试图通过删除内容中的文本块来编辑它'Featured'
.php但是当我预览页面时,一切都消失了。
你怎么看,我该怎么办?提前谢谢。
我想
我找到了解决方案。
这:
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
<span class="sticky-post"><a href="<?php _e( 'javascript:void(0)', 'twentysixteen' ); ?>" rel="home"><img src="/sticky_pin.png"> </a></span>
<?php endif; ?>
取而代之的是:
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
<span class="sticky-post"><?php _e( 'Featured', 'twentysixteen' );></span>
<?php endif; ?>
这
肯定会起作用!
$(document).ready(function(){
$('span.sticky-post').hide();
});
或
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?> <span class="sticky-post"><?php // _e( 'Featured', 'twentysixteen' ); ?></span> <?php endif; ?>
或
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?> <span class="sticky-post" style="display:none"><?php _e( 'Featured', 'twentysixteen' ); ?></span> <?php endif; ?>