Skip to content
Custom fields for WordPress that are quick to build and quick to load. Get Pro

Site-wide things

A site-wide announcement bar

A bar at the top of every page, switched on and off from the admin.

1 minute Works with the free plugin

The announcement bar above the header
The announcement bar above the header.

Fields. On Site options: announcement (Group): show (Yes / No), text (Text), link (Link).

PHP
<?php
$announcement = ugly_get( 'announcement', 'option' );

if ( $announcement && $announcement->get( 'show' ) ) :
	$link = $announcement->get( 'link' );
	?>
	<div class="announcement">
		<?php $announcement->show( 'text' ); ?>
		<?php if ( $link ) : ?>
			<a href="<?php echo esc_url( $link['url'] ); ?>"><?php echo esc_html( $link['title'] ); ?></a>
		<?php endif; ?>
	</div>
<?php endif; ?>

An editor turns the bar on and off from one screen, without touching the theme.