How to create a post template

How to create a custom post template.

  1. Install Custom Post Plugin, Version: 1.5 by Author: Simon Wheatley
  2. Copy single.php from your parent theme to your child theme.
  3. Rename singe.php to your desired post template name (i.e. post_template.php)
  4. Replace the first line of codes of file post_template.php;
    From this:
<?php
/**
 * The template for displaying all single posts.
 *
 * @package Sydney
 */

To this:
<?php

/**
 * Template Name Posts: Post - no header
 *
 * @package Sydney
 */
  1. To make the page full width, delete these line of codes.
<div id="primary" class="content-area col-md-9 <?php echo $fullwidth; ?>">

</div><!-- #primary -->
  1. To remove the sidebar, delete this line of code
    get_sidebar();

  2. From your dashboard, Click on Appearance > Additional CSS and add the following CSS codes.

body.post-template-post_without_header header#masthead,
.header-image {
    display: none;
}
body.post-template-post_without_header .sydney-hero-area {
    display: none;
}
  1. Test your new post template by creating a post and then select Post Template = Post - No header.

Here is a sample page.

Some issues that I would like to be resolved.
• How do I remove the black are at the top where the menu is located?
• How to I remove the large space between the black area at the top and the post title?

I would love to find a solution to these issues.

Regards,
Carlou

Hi,

Just for an update with the issue on how to remove the black area at the top where the menu is located? The black area appears on a tablet or phone. On a PC it is a white area to the top of the page with text “Create your menu here”. I would like to remove the text including the space that is occupied. Basically I want to maximize the top most area of the page by pushing the image where I’ve placed the Post Title all the way up.

Thanks,
Carlou

Hello Carlou,

How do I remove the black are at the top where the menu is located?

Please try to use the following CSS code in order to hide (not remove) header in that particular post. You can add CSS code in Dashboard → Appearance → Customize → Additional CSS (WordPress 4.7 and up).

body.postid-179 header#masthead {
    display: none;
}
How to I remove the large space between the black area at the top and the post title?

Try to reduce top padding in Customize → General section.

Kind Regards, Roman.