Sidebar With Fallback Message

Standard WordPress Sidebar function. Displays the sidebar if it has widgets assigned to it. If not, it displays a message.

Simple example of conditional logic applied to a WordPress sidebar. Add the following code snippet to your theme functions.php file

<?php if(dynamic_sidebar('footer_left' ): )?>
	<?php else: ?>
	<p>This message will display if there's no content in the sidebar.</p>
<?php endif; ?>

Hire a WordPress Expert

Get hourly and project based theme customization, theme tweaks, and development help from world-class WordPress developers at Codeable. If you’re in Kelowna and need a custom website for your business visit our Kelowna Web Design page now to get started.