Use "Blank, No Container | Header Footer" Template For Posts

Hi,

Is it possible to the the “Blank, No Container | Header Footer” template for Posts? I use this template for all pages, but cannot seem to access the setting for posts. I am using the latest version of Pro and the Integrity stack.

The main reason is that ideally I would like some sections to be full screen width (image or color full-screen for a section) and without the vertical shadows either side of the post.

I have seen some support posts similar to my requirements, but not quite the same!

Thanks,
Christopher

Hello @cdnwhite,

Thanks for writing in!

Be advised that the “Blank, No Container | Header Footer” and other page templates were only available for the pages by default. There are no Post templates available in theme. If you want to apply it for a post, you will have to create your own custom Blank, No Container | Header Footer post template.

To resolve your issue, assuming taht you have your child theme active and ready, please follow these steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

// =============================================================================
// TEMPLATE NAME: Blank - No Container for Posts
// TEMPLATE POST TYPE: post
// -----------------------------------------------------------------------------
// A post template with no featured image, blank and no container.
// =============================================================================

get_header();

?>

  <div class="x-main full" role="main">
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
      <div class="entry-content">

        <?php while ( have_posts() ) : the_post(); ?>
          <?php the_content(); ?>
          <?php x_link_pages(); ?>
        <?php endwhile; ?>

      </div>
    </article>
  </div>

<?php get_footer(); ?>

3] Save the file named as post-template.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/

When you edit a post, you should be seeing a Post Template that is named as “Blank - No Container for Posts”.

We would love to know if this has worked for you. Thank you.

1 Like

Hi Rue Nel,

That is brilliant and does exactly what I was after! However, in doing so it loses a few important things for me:

  • Meta tags below the title

  • Post Tags below the post article

  • Comments

Would I be right in thinking these can be added into the code you sent me? If yes, how, please?!

The basic layout your code makes is such a good change from the default! Can I suggest having this template (with the above three missing items) added to a future release of Pro?

Many thanks,
Christopher

Hey Christopher,

Adding those items would require further custom coding and that is outside the scope of our support. We’re sorry if that wasn’t made clear. Please consult with a third-party developer to add those items for you.

We are planning to have a Layout Builder which will enable you to build your single post and archive page design. You can read more about our plans in our News Archive at https://theme.co/apex/forum/t/news-archive/24

Thank you for understanding.

Hi Christian,

I understand. When is the Layout Builder due for release in Pro? Has a release date been planned?

Thanks,
Christopher

Hi,

In case it is of any use to anyone else, I have modified Rue Nel’s great code and now have exactly what I am after. Below are the php and css I have used - following Rue Nel’s exact instructions in the initial reply to this query.

<?php

// =============================================================================
// TEMPLATE NAME: Blank - No Container for Posts
// TEMPLATE POST TYPE: post
// -----------------------------------------------------------------------------
// A post template with no featured image, blank and no container.
// Includes Post Meta, Category Tags, Comments.
// =============================================================================

get_header();

?>

  <div class="x-main full" role="main">
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
      <div class="entry-wrap">

        <?php while ( have_posts() ) : the_post(); ?>
		  <?php x_get_view( 'integrity', '_content', 'post-header' ); ?>    
  </div>
		
	  <div class="entry-content">
          <?php the_content(); ?>
          <?php x_link_pages(); ?>
	  </div>
		
	  <div class="entry-wrap">
		  <?php x_get_view( 'integrity', '_content', 'post-footer' ); ?>
		  <?php x_get_view( 'global', '_comments-template' ); ?>
        <?php endwhile; ?>

      </div>
    </article>
  </div>

<?php get_footer(); ?>

The CSS is:

/* Centre Post Titles and Meta */
.entry-header h1, .p-meta {
  text-align: center !important;
}

/* Remove Box Shadow Below Post Header */
.entry-wrap {
  box-shadow: none !important;
  padding-top: 80px !important;
  padding-bottom: 20px !important;
}

/* Less Margin Between Heading and Content */
.entry-content {
  margin-top: 30px !important;
}

Thanks for all your help,
Christopher

1 Like

Hey Christopher,

We don’t have an estimate as to when the Layout Builder will be released. We’re glad that you know how to code.

This is a really useful template - thanks!

What would need to be changed for this to work on a custom post type for something like “projects”?

Never mind, sorted it by putting the custom post type name after posts

<?php

// =============================================================================
// TEMPLATE NAME: Blank - No Container for Posts
// TEMPLATE POST TYPE: post, project
// -----------------------------------------------------------------------------
// A post template with no featured image, blank and no container.
// =============================================================================

Brilliant! Great that you’ve figured it out!. :slight_smile:

1 Like

Mainly thanks to @RueNel, who provided the basis. IT has made such a difference to the look of my websites’ posts, such as https://www.cotswoldwebsites.co.uk/10-different-strategies-to-create-a-great-website/
The look is now uniform across my pages and posts. I hope it works for you too!

Glad it’s working now, and thanks for sharing!

Is there a custom css to put in to remove header from posts in the customize part of pro. i just did one for the a navigation arrows and I believe you were the one that posted it.

Thank Jason

Hey Jason,

I’m sorry but I’m currently not sure about what you’re trying to achieve. Would you creating another thread and detail what you wish to achieve. There might be an option for it and might not need custom CSS.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.