dongyi8383 2017-02-09 12:23
浏览 72
已采纳

如何在Marketify单一帖子中移动标题下方的特色图片

I'm trying to move the post's featured image below the post title in the Marketify theme, however I can't seem to find this hidden in the code.

Can anybody please help me find the code for the post's featured image? How do I move this below the post title?

  • 写回答

2条回答 默认 最新

  • doupuchao4256 2017-02-09 15:01
    关注

    Firstly, create a Child Theme for your WordPress Theme.

    Then look in '/wp-content/themes/[theme-name], where you should find a file entitled 'single.php'. Copy this into your child theme, taking care to ensure you replicate the same directory hierarchy. The 'single.php' is usually the name of your default Blog Post Template.

    Open up the 'single.php' file, which you have saved within your child theme, with a programme such as Notepad++ (Notepad will also do but is not as easy on the eye).

    You should see something like:

        <?php if ( has_post_thumbnail() ) {
            the_post_thumbnail();
        }?>
        <?php 
        if (have_posts()) : 
            while (have_posts()) : the_post(); ?>
    
                <h1><?php the_title(); ?></h1>  //This is the title of your Blog Post. 
    
                <div class="entry">
                <?php the_content(); ?> //This is the content of your Blog Post.
                </div>
    
            <?php endwhile; ?>  
        <?php endif; ?>
    

    There will be a slight variation in the coding but what you are looking to do is highlight:

    <?php if ( has_post_thumbnail() ) {
            the_post_thumbnail();
    }?>
    

    and then move this coding to beneath <h1><?php the_title(); ?></h1>. You will need to play around as to where exactly you will need it but I hope this helps get you started.

    The reason I have suggested that you do this within a Child Theme is that when the Theme Developer rolls out an update, it will delete any modifications you have made within the parent files.

    Good Luck!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?