Editing WordPress Page Template

[ad_1]

Two weeks ago my website was working fine. Each page has a cover image at the start with the page name on the cover image. Two weeks ago, that cover image spanned the width of the page and then the content below had padding on the left and right sides to leave white space.

Someone did an update. Not sure if this is a theme update or a plugin update or a WP update. Now the cover image does NOT span the page. The only way I can get it to span is to change the page template and when I do that, then all the content below spans the full width of the page too and I don’t want that. I just want the cover image to span the full width.

I’ve reached out to the theme developer, they say it’s not them but Gutentor. I look at their documentation and they say that the default page template is designed by the theme. I’ve tried using the customizer to write some CSS but I can’t figure that out. I’m now at the point of developing a child theme and adding a page.php file and editing that. But that’s where I’m stuck now – I don’t know what or how to modify this document in order to make the cover image span the page again.

Below is a screenshot showing that I want the cover image to go the full width of the page BUT i still want the content below that to have the white space on the left and right. (Again, it was like this for FIVE MONTHS before something updated two weeks ago and now it’s not like that).

Also below is the page.php file content from the theme. Can anyone tell me a) whether this is the right thing to modify to fix my problem, and b) what to modify within the text? -TIA

<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other ‘pages’ on your WordPress site may use a
* different template.
*
* @link
*
* @package OnePress
*/

get_header();

$layout = onepress_get_layout();

/**
* @since 2.0.0
* @see onepress_display_page_title
*/
do_action( ‘onepress_page_before_content’ );

?>
<div id=”content” class=”site-content”>
<?php onepress_breadcrumb(); ?>
<div id=”content-inside” class=”container <?php echo esc_attr( $layout ); ?>”>
<div id=”primary” class=”content-area”>
<main id=”main” class=”site-main” role=”main”>

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

<?php get_template_part( ‘template-parts/content’, ‘page’ ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // End of the loop. ?>

</main>
</div>

<?php if ( $layout != ‘no-sidebar’ ) { ?>
<?php get_sidebar(); ?>
<?php } ?>

</div>
</div>

<?php get_footer(); ?>

[ad_2]
3 Comments
  1. in my theme (neve) this is an option you pick (full width vs contained) per page, on a tab in the editor.

    suggests maybe it is for yours too. since this implies the default is from theme setting, maybe that was changed?

    assuming your theme is gutentor as you mentioned above?

  2. This is likely a CSS issue, rather than a template issue.

    BTW the code that contains the banner would generally be in header.php

  3. Literally just override the css to add to that imagine class. The property you want is: background-size: cover;

    If the div itself is constrained to a column of something you can apply a full width class to the div in header.php

    Use the inspector on it to find the class name if you don’t know.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer