Created
August 4, 2023 20:01
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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