1
votes

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
It depends on what the theme developer has called their template files. As a starting point, is there a file entitled 'single.php' in your theme directory? Usually, in '/wp-content/themes/[theme-name]Craig

2 Answers

0
votes

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!

0
votes

Thanks for your comment. I assumed it would be similar to code you've written too, but the title and featured image are hidden in the "do_action( 'marketify_entry_before' );".

    get_header(); ?>

    <?php do_action( 'marketify_entry_before' ); ?>

    <div class="container">
    <div id="content" class="site-content row">

        <div role="main" id="primary" class="col-xs-12 col-md-8 <?php echo ! is_active_sidebar( 'sidebar-1' ) ? 'col-md-offset-2' : '' ?>">
            <main id="main" class="site-main" role="main">

            <?php if ( have_posts() ) : ?>

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

                    <?php get_template_part( 'content', 'single' ); ?>
                    <?php comments_template(); ?>

                <?php endwhile; ?>

None the less, for anyone else with the same problem; I figured out how to hide this section in css like so...

    .single .header-outer.has-image .page-header {
        display: none;
    }

And then could use the standard Wordpress functions to make the title and featured image appear where I wanted.

Thanks :)

Tom