Skip Navigation

[Closed] Load the content template and nothing else

This support ticket is created 3 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 3 years, 7 months ago.

Author
Posts
#2098259

Hi

Is it possible to load a Toolset content template entirely clean?

So the site theme, header, footer, etc nothing else loads. The page is just the Toolset content template and thats it?

Thanks

#2098867

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

A Toolset Content Template just replaces what is output by the_content() function in your theme's PHP templates.

Your theme could have a landing page format that displays no header or footer and only the content.

Otherwise you would need to create a PHP template yourself that just outputs the content.

You'll need to investigate your theme's PHP templates.

Normally your simple template would still need to include the header.php and footer.php files, because the PHP templates are normally structured such that the header.php file sets up the HTML head section and the opening body tag, and the footer.php file adds the closing body tag amongst other things, so you won't be able to exclude those files.

I can't really specify what's involved absent details of the theme, but you are going to want to create a PHP tempalte something like...

<?php
/**
 */

get_header();
?>

<main id="site-content" role="main">

	<?php

	if ( have_posts() ) {

		while ( have_posts() ) {
			the_post();

			the_content();
		}
	}

	?>

</main><!-- #site-content -->

<?php get_footer(); ?>

Then the question is how and where this template is used. You didn't say what the Content Template would be assigned to. Is it for some post type, or an individual page?

Essentially you'd need to work with the template hierarchy (https://developer.wordpress.org/themes/basics/template-hierarchy/) so that this PHP template is used when required, and you would assign your Content Template as needed (e.g. to the post type, or to the individual page, etc.)

The topic ‘[Closed] Load the content template and nothing else’ is closed to new replies.