ds355020 2015-08-30 06:45
浏览 77

从Wordpress帖子中删除功能图像。 (动态新闻精简版)

I want my feature image to stop appearing on the post, I simply want to use it as thumbnail on recent post.

before asking here I tried a lots of different solutions. I look for the responsible code in single.php but it was not there, I try to hide my feature image with CSS, when I check my site with firebug I notice that my CSS got overwritten by the orginal CSS, which does not happen normally.

After going through my code, I found this in template-tags.php

// Display Custom Header
if ( ! function_exists( 'dynamicnews_display_custom_header' ) ):

function dynamicnews_display_custom_header() {

    // Check if page is displayed and featured header image is used
    if( is_page() && has_post_thumbnail() ) :
    ?>
        <div id="custom-header" class="featured-image-header">
            <?php the_post_thumbnail('custom_header_image'); ?>
        </div>
<?php
    // Check if there is a custom header image
    elseif( get_header_image() ) :
    ?>
        <div id="custom-header">
            <img src="<?php echo get_header_image(); ?>" />
        </div>
<?php
    endif;

}

endif;



 // Display Postmeta Data

if ( ! function_exists( 'dynamicnews_display_postmeta' ) ):

function dynamicnews_display_postmeta() {

    // Get Theme Options from Database
    $theme_options = dynamicnews_theme_options();

    // Display Date unless user has deactivated it via settings
    if ( isset($theme_options['meta_date']) and $theme_options['meta_date'] == true ) : ?>

        <span class="meta-date sep">
        <?php printf(__('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date published updated" datetime="%3$s">%4$s</time></a>', 'dynamicnewslite'),
                esc_url( get_permalink() ),
                esc_attr( get_the_time() ),
                esc_attr( get_the_date( 'c' ) ),
                esc_html( get_the_date() )
            );
        ?>
        </span>

    <?php endif;

I tried to remove some part of the code here, since I don't know anything about php, I get lots of error, I am hoping may be you guys can help me. I am using the theme dynamic news lite. here is the link to my site http://www.coolstuffgift.com/awesome-birthday-gifts-for-awesome-people/

Original code of Single.php

<?php get_header(); ?>



<div id="wrap" class="container clearfix">



    <section id="content" class="primary" role="main">



    <?php if (have_posts()) : while (have_posts()) : the_post();



        get_template_part( 'content', 'single' );



        endwhile;



    endif; ?>



    <?php comments_template(); ?>



    </section>



    <?php get_sidebar(); ?>

</div>

This is all I got in single.php I think the developer did some trick to hide the code.

  • 写回答

1条回答 默认 最新

  • duanpo1821 2015-08-30 08:01
    关注

    In your content.php OR content-single.php file.

    Just comment the_post_thumbnail() this type of function.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。