Preview PHP HTML CSS JS
Click to copy

Add this to your functions.php file

/**
 * Announcement box, added to the top of the site.
 */
function custom_alert_box() { ?>
	<p class="alert-box">
		<span class="badge">New</span> My custom HTML with <a href="#link">link</a>.
	</p>
<?php }
add_action( 'md_hook_before_html', 'custom_alert_box' );
Click to copy
Click to copy
.alert-box {
	background-color: #fffbcc;
	color: #777;
	font-size: 14px;
	line-height: 23px;
	padding: 13px 16px;
	text-align: center;
}
Click to copy
Website announcement box
Labs

Get the latest MD sent straight to your inbox

There's always something new in the works in the MD Labs! Join the email list to get the newest content and releases sent straight to your inbox.*

Join the MD Newsletter

* I only email you when there's something new, or to share an exciting MD sneak peak.