Last active
May 12, 2017 16:09
-
-
Save braginteractive/1f6c15e236fdaac1e3d90bb86db337f9 to your computer and use it in GitHub Desktop.
Hero Banner settings for WordPress Customizer
This file contains hidden or 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 | |
if ( class_exists( 'Kirki' ) ) { | |
/** | |
* Add the theme configuration | |
*/ | |
Kirki::add_config( 'strappress_theme', array( | |
'option_type' => 'theme_mod', | |
'capability' => 'edit_theme_options', | |
) ); | |
Kirki::add_panel( 'homepage', array( | |
'priority' => 10, | |
'title' => __( 'Homepage', 'strappress' ), | |
'description' => __( 'Homepage Panel', 'strappress' ), | |
) ); | |
/* Homepage Hero Section */ | |
Kirki::add_section( 'homepage_hero', array( | |
'title' => __( 'Homepage Hero' ), | |
'description' => __( 'Homepage Settings' ), | |
'panel' => 'homepage', // Not typically needed. | |
'priority' => 160, | |
'capability' => 'edit_theme_options', | |
'theme_supports' => '', // Rarely needed. | |
) ); | |
/* Homepage Hero Text */ | |
Kirki::add_field( 'strappress_theme', array( | |
'type' => 'text', | |
'settings' => 'hero_text', | |
'label' => __( 'Hero Text', 'strappress' ), | |
'section' => 'homepage_hero', | |
'default' => esc_attr__( 'This is a default value', 'strappress' ), | |
'priority' => 10, | |
) ); | |
/* Homepage Hero Image */ | |
Kirki::add_field( 'strappress_theme', array( | |
'type' => 'image', | |
'settings' => 'hero_image', | |
'label' => __( 'Hero Image', 'strappress' ), | |
'description' => __( 'This is the hero image upload', 'strappress' ), | |
'section' => 'homepage_hero', | |
'default' => '', | |
'priority' => 10, | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment