Skip to content

Commit

Permalink
Merge pull request #19 from UCF/footer-text
Browse files Browse the repository at this point in the history
Added a customizer function for the footer content
  • Loading branch information
jmbarne3 authored Sep 3, 2024
2 parents 2d67cc9 + 513ab52 commit 7e475ba
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
));
?>
</nav>
<p class="footer-cta">With more than 69,000 students and four campuses anchoring industry clusters, we fuel Orlando’s $194 billion economy and inspire impactful discoveries to better the world.<?php print get_cta_link(); ?></p>
<?php if ( $theme_content = get_theme_mod( 'footer_content' ) ) : ?>
<?php echo $theme_content; ?>
<?php endif; ?>
<p class="footer-logo">
<a target="_blank" href="https://www.ucf.edu/">Go to ucf.edu</a>
</p>
Expand Down
29 changes: 29 additions & 0 deletions functions/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );

0 comments on commit 7e475ba

Please sign in to comment.