• On my pages, the title is displayed AFTER the featured image and I would like it to display BEFORE the image. It is displayed this way on posts; how can I make it look the same on my pages?

    Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi @bdown111,

    Thanks for reaching out, and thank you for using Kale!

    There isn’t a setting for this, but you could disable featured images for pages, and just include your images in your page content instead:
    https://help.lyrathemes.com/article/243-page-options

    Alternatively, you could setup a child theme, and then modify the code in the child theme to suit.

    Hope this helps!

    Thread Starter bdown111

    (@bdown111)

    Thank you for the reply. I am already using a child theme. Can you please provide step by step instructions for modifying the code?

    Hi,

    I have modified the page template for you. Just visit this link here https://www.dropbox.com/s/wh20ibizth270v9/page.php?dl=0 and download the file “page.php”. Then just upload this file inside your child theme root folder and the page title should be visible before the Featured image on page templates.

    All the best. ??

    Thread Starter bdown111

    (@bdown111)

    Thank you for the reply but it isn’t working. The featured image is still above the page title. Any ideas?

    Hi @bdown111,

    Would you mind including a link to a page on your site with a featured image so we can take a quick look? Thanks!

    Thread Starter bdown111

    (@bdown111)

    Thanks @bdown111, that helps.

    You can replace this section of your child theme’s page.php:

            <!-- Page Content -->
            <div id="page-<?php the_ID(); ?>" <?php post_class('entry entry-page'); ?>>
    
                <?php if($kale_pages_featured_image_show == 'Default' && has_post_thumbnail() && $kale_pages_show_thumbnail) { ?>
                    <div class="entry-thumb"><?php the_post_thumbnail( 'full', array( 'alt' => get_the_title(), 'class'=>'img-responsive' ) ); ?></div>
                <?php } ?>
    
                <?php if($kale_pages_featured_image_show != 'Banner' || !$kale_pages_show_thumbnail) { ?>
                <?php $title = get_the_title(); ?>
                <?php if($title == '') { ?>
                <h1 class="entry-title"><?php esc_html_e('Page ID: ', 'kale'); the_ID(); ?></h1>
                <?php } else { ?>
                <h1 class="entry-title"><?php the_title(); ?></h1>
                <?php } ?>
                <?php } ?>
    
                <div class="page-content"><?php the_content(); ?></div>
    
            </div>
            <!-- /Page Content -->

    With this code:

            <!-- Page Content -->
            <div id="page-<?php the_ID(); ?>" <?php post_class('entry entry-page'); ?>>
    
                <?php if($kale_pages_featured_image_show != 'Banner' || !$kale_pages_show_thumbnail) { ?>
                <?php $title = get_the_title(); ?>
                <?php if($title == '') { ?>
                <h1 class="entry-title"><?php esc_html_e('Page ID: ', 'kale'); the_ID(); ?></h1>
                <?php } else { ?>
                <h1 class="entry-title"><?php the_title(); ?></h1>
                <?php } ?>
                <?php } ?>
    
                <?php if($kale_pages_featured_image_show == 'Default' && has_post_thumbnail() && $kale_pages_show_thumbnail) { ?>
                    <div class="entry-thumb"><?php the_post_thumbnail( 'full', array( 'alt' => get_the_title(), 'class'=>'img-responsive' ) ); ?></div>
                <?php } ?>
    
                <div class="page-content"><?php the_content(); ?></div>
    
            </div>
            <!-- /Page Content -->

    You’ll likely need to purge any caches from performance/optimization plugins before you’ll see the changes. Let us know if you have any further issues!

    Thread Starter bdown111

    (@bdown111)

    I replaced the content and purged the cache, but it’s still not working. Obviously, if you come across a solution, please let me know. In the meantime, I will have to move on to some other alternative. Thank you.

    Hi @bdown111,

    I’m sorry to hear this…it’s working well here. Are you sure you made the edit in the child theme, not in the parent theme?

    Thanks for your patience, and I’m sorry for the hassle.

    Thread Starter bdown111

    (@bdown111)

    Yes, I’m sure. Thanks anyway.

    Hi @bdown111,

    I’m really sorry. If you’d like us to, we’d be happy to login and make the change and ensure that it’s working on your site…no worries if you’d rather not though.

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Page title (H1) needs to go before featured image’ is closed to new replies.