Customise single.php

Hello there,

Is it possible to customise single.php or designate a posts output page from within the X settings?

The page outputs as:

http://bsuhrecr.nextmp.net/uncategorized/test-post/

But we would like to be able to present the page with a large header image like this:

http://bsuhrecr.nextmp.net/staff-benefits/what-we-offer/

Many thanks,

Spencer

Hi Spencer,

The links you have provided shows Maintenance Mode pages so I am not certain about the design you are aiming for.

If you use Cornerstone to build the posts pages, you will have control of the entire layout of the post content.

Hope this helps.

@Jade thanks for getting back to me.

Maintenance Mode is off now, but that’s great that I can control the posts from within Cornerstone.

Can do I use a Cornerstone built page as single.php? Where would this be in the documentation? I couldn’t find a way to assign a template to the single file.

Cheers!

Spencer

Hello Spencer,

Single.php is used to display single blog posts.

This url http://bsuhrecr.nextmp.net/uncategorized/test-post/ is a category archive and thus uses the index.php since we do not have any archive.php file in the theme.

What you have in mind can be achieve with some slight modifications. First, go to X > Global Blocks and design your desired large header image that you’d like to display. Once you are done creating the global block take note of the shortcode. And then since the child theme is set up, please add the following code in your child theme’s functions.php file

// For the header
function custom_blog_header() {
  if ( is_category() ) {
	echo do_shortcode('[cs_gb id=123]');
  }
}
add_action('x_before_view_integrity__landmark-header', 'custom_blog_header');

You must replace 123 with the correct ID of your global block which you have created.

We would loved to know if this has work for you. Thank you.

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