Create the new .php file with the template name and copy/paste the following into the file.

<?php
/**
Template Name: Page with Background Color
*/
?>
<html>
<head>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<style type="text/css">
body { background-color: #cccccc;); }
#page-content { width: 800px; margin: 20px auto; }
</style>
<title><?php wp_title( '|', true, 'right' ); bloginfo('url'); ?></title>
<?php wp_head(); ?>
</head>

<body>
<?php while (have_posts()) : the_post(); ?>
<div id="page-content">
<?php the_content(); endwhile; ?>
</div>
upload this file into the folder of the current theme that you are using.
Which for you would be /wp-content/themes/demo-child-theme/
after complete above step just go to your WordPress installation and create a new page. On the right side select the template name that you have created  'Page with background color' option from the dropdown list.
Note: If you want to give custom style to this page just add the style in header section that will affect only this template.

0 comments:

Post a Comment

 
Top