Content missing in custom theme

Hi. I created a custom theme. But when I activate it the page’s content is missing.
What have I missed? I’m using the full.php template which pulls default.php.

This is default.php

`<?php
	defined('C5_EXECUTE') or die("Access Denied.");
	$this->inc('elements/header.php');
?>
<main>
<div class="cnt-wrapper">
		<div class="feature-cnt">		
		<!--content -->
	<?php
		$a = new Area('Main Content');
		$a->display($c);
	?>
	
		</div>
		<div class="info-wrapper">
		<div class="info-1">
		<h3 class="media">Sermons on Youtube</h3>
	<?php
		$a = new Area('YouTube Block');
		$a->display($c);
	?>
		</div>
		<div class="info-2">
		<h3 class="media">Facebook Live Streams</h3>
	<?php
		$a = new Area('Facebook Block');
		$a->display($c);
	?>
		</div>
		</div>	
	</div>

</main>
<?php
	$this->inc('elements/footer.php');
?>`

The strange thing is if I switch to elemental theme the content shows up. If I switch to my theme it goes missing.

I should also note that the elements theme has content blocks in use. When I switch to my theme the content block is missing. Does each theme have it’s own content blocks and content?

The standard name for the main area is ‘Main’ not ‘Main Content’ hence when switching to your custom theme, ‘Main’ is not rendered and is now a zombie. So in your code change ‘Main Content’ to just ‘Main’.

As a general rule, when developing a custom theme, always begin by using area names from the default theme, so ‘Main’ ‘Sidebar’ etc. That way you can swap between themes without content disappearing.

Then adopt non-standard area names only once you have gone beyond the default area names.

1 Like

Thank you my friend. That did the trick.