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 WordPress Experts at Codeable.

The only WordPress exclusive freelancer platform that connects thousands of customers with the top WordPress freelance experts to work on projects of any size. 

Free estimate • No obligation to hire • 100% risk-free