Version 0.2.9

Adding a new theme customizer option. It lets you add a code snippet
right before the closing </body> 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
This commit is contained in:
Holger Koenemann 2015-03-10 09:04:07 +01:00
parent f74ac9a879
commit 9c3305c7a9
3 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,11 @@ Live Demo: http://holgerkoenemann.de/understrap/
Changelog Changelog
= =
- **0.2.9 Mar. 10th 2015**
- Adding a new theme customizer option. It lets you add a code snippet right before the closing </body> 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** - **0.2.8 Feb. 6th 2015**
- Adding Grunt and Grunt SASS task - Adding Grunt and Grunt SASS task

View File

@ -14,6 +14,7 @@
<link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?> <?php wp_head(); ?>
<?php echo get_theme_mod( 'understrap_theme_script_code_setting' ); ?>
</head> </head>
<body <?php body_class(); ?>> <body <?php body_class(); ?>>

View File

@ -60,6 +60,21 @@ function understrap_theme_customize_register( $wp_customize ) {
), ),
'settings' => 'understrap_theme_slider_loop_setting' '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' ); add_action( 'customize_register', 'understrap_theme_customize_register' );