Hi sigul77,
First give a template name to ‘full-width.php’ in starting of template. See Below:
<?php
/**
* Template Name: Home Page
*
*/
get_header();
?>
and after you need create a page in wordpress admin panel and assign this template to the newly created page.
yes I already done this.
the problem is with this line of code in the header
<div id="content" class="site-content">
that request to create a different header for full width page
I created another header called header-fullwidth.php and modified that line with
<div id="content" class="site-content fullwidth">
This code works, but I can’t load the new header in fullwidth.php with this call
<?php
/**
*
* Template Name: Full Width
*
* @package Graphy
*/
get_header( 'fullwidth' ); ?>
assign this name to new header file like this: “header-fullwidth.php”
I did. still nothing changed
can u plz send me a link if its live
plz Remove the class ‘site-content’ or change the width in style.css of ‘site-content’ class.
I am trying even another way: modify that line with an if statement
<?php if ( is_page('ebook') ) {
<div id="content" class="site-content fullwidth">;
} else {
<div id="content" class="site-content">;
}
?>
but I am getting error “unexpected <”
no need to write if condition. Simple Just create different template for ‘ebook’ and write your customs classes.
I need a Template for ebook and home, the only thing changing is the width of the site-content class. I created a fullwidth class to appen to class definition for content, but as you can see content is defined in the header.php so I need one of two 1) create two header and link the modified one to the full width template 2) use a if statement to define in header.php which page must be fullwidth and which not (by adding a custom class after site-content, and it works, I checked it in live preview editing CSS). Unfortunately not of these approach seems working and I can’t find the error 🙁
done!
the correct way to call a custom header is to rename the file header-fullwidth.php (with the hyphen) and the use get_header (‘fullwidth’)
yes check my 2nd reply
i am also suggest this to rename header like “header-fullwidth.php”