Skip to content

Instantly share code, notes, and snippets.

@colorful-tones
Created August 4, 2023 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colorful-tones/2af53c483eb0a7835d48ffe38f64f3ee to your computer and use it in GitHub Desktop.
Save colorful-tones/2af53c483eb0a7835d48ffe38f64f3ee to your computer and use it in GitHub Desktop.
Child theme for Options Page UI demo (https://www.youtube.com/watch?v=0As393DZyZs)
<?php
/**
* This file adds functions to the child WordPress theme.
*/
/**
* Check for Notification Bar, and display it.
*/
function demo_acf_output_notification() {
$has_notice = get_field( 'notification_bar', 'options' );
if ( ! $has_notice || ! $has_notice['notification_onoff'] ) {
return;
}
?>
<div class="notification-bar">
<div class="notification-bar__inner">
<p>
<?php echo wp_kses_post( $has_notice['notification_message'] ); ?>
</p>
</div>
</div>
<?php
}
// Notification to be placed after opening body tag.
add_action( 'wp_body_open', 'demo_acf_output_notification' );
/*
Theme Name: ACF Child
Description: A WordPress Child Theme
Author: ACF
Template: frost
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment