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 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题