From 9c3305c7a96393aad9fb92322542c64c4b74e16c Mon Sep 17 00:00:00 2001 From: Holger Koenemann Date: Tue, 10 Mar 2015 09:04:07 +0100 Subject: [PATCH] Version 0.2.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding a new theme customizer option. It lets you add a code snippet right before the closing tag. For example for Google Analytics, Google Tag Mananger, Pingdom etc. Just copy and past your code to the input field and save the setting. So you don´t have to edit the theme source file´s directly and your theme stay´s updateable --- README.md | 5 +++++ header.php | 1 + inc/customizer.php | 15 +++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/README.md b/README.md index 9e482e16f..ee6423619 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ Live Demo: http://holgerkoenemann.de/understrap/ Changelog = + - **0.2.9 Mar. 10th 2015** + - Adding a new theme customizer option. It lets you add a code snippet right before the closing tag. + For example for Google Analytics, Google Tag Mananger, Pingdom etc. Just copy and past your code to the input field and save the setting. + So you don´t have to edit the theme source file´s directly and your theme stay´s updateable + - **0.2.8 Feb. 6th 2015** - Adding Grunt and Grunt SASS task diff --git a/header.php b/header.php index 2674fe097..e10672765 100644 --- a/header.php +++ b/header.php @@ -14,6 +14,7 @@ + > diff --git a/inc/customizer.php b/inc/customizer.php index 0da23548e..629bb77aa 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -60,6 +60,21 @@ function understrap_theme_customize_register( $wp_customize ) { ), 'settings' => 'understrap_theme_slider_loop_setting' ) ); + + $wp_customize->add_section( 'understrap_theme_script_options', array( + 'title' => __( 'Add scripts', 'understrap' ) + ) ); + + $wp_customize->add_setting( 'understrap_theme_script_code_setting', array( + 'default' => '' + ) ); + + $wp_customize->add_control( 'understrap_theme_script_code', array( + 'label' => __( 'Add custom JS code here', 'understrap' ), + 'section' => 'understrap_theme_script_options', + 'type' => 'textarea', + 'settings' => 'understrap_theme_script_code_setting' + ) ); } add_action( 'customize_register', 'understrap_theme_customize_register' );