From 513ab5254d1ea9f161546bf27034fa4a02f1c70d Mon Sep 17 00:00:00 2001 From: Jim Barnes Date: Tue, 3 Sep 2024 16:34:46 -0400 Subject: [PATCH] Added a customizer function for the footer content --- footer.php | 4 +++- functions/config.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/footer.php b/footer.php index 360e6cb..dc830c6 100644 --- a/footer.php +++ b/footer.php @@ -13,7 +13,9 @@ )); ?> - + + + diff --git a/functions/config.php b/functions/config.php index 2296f73..dcd4216 100644 --- a/functions/config.php +++ b/functions/config.php @@ -82,6 +82,7 @@ function sst_add_admin_scripts() { define('THEME_OPTIONS_GROUP', 'settings'); define('THEME_OPTIONS_NAME', 'theme'); define('THEME_OPTIONS_PAGE_TITLE', 'Theme Options'); +define('THEME_CUSTOMIZER_PREFIX', 'sst_theme_mods_'); $theme_options = get_option(THEME_OPTIONS_NAME); define('GA_ACCOUNT', isset( $theme_options['ga_account'] ) ? $theme_options['ga_account'] : null ); @@ -273,3 +274,31 @@ function jquery_in_header() { } add_action('wp_enqueue_scripts', 'jquery_in_header'); + +/** + * Customizer settings for the theme + */ +function sst_define_customizer_settings( $wp_customize ) { + $wp_customize->add_section( + THEME_CUSTOMIZER_PREFIX . 'footer', + array( + 'title' => 'Footer Settings' + ) + ); + + $wp_customize->add_setting( + 'footer_content' + ); + + $wp_customize->add_control( + 'footer_content', + array( + 'type' => 'textarea', + 'label' => 'Footer Content', + 'description' => 'The HTML content to be placed directory above the UCF logo in the footer.', + 'section' => THEME_CUSTOMIZER_PREFIX . 'footer' + ) + ); +} + +add_action( 'customize_register', 'sst_define_customizer_settings', 10, 1 );