Skip to content

Commit

Permalink
Version 0.2.9
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Holger Koenemann committed Mar 10, 2015
1 parent f74ac9a commit 9c3305c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 </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**
- Adding Grunt and Grunt SASS task

Expand Down
1 change: 1 addition & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
<?php echo get_theme_mod( 'understrap_theme_script_code_setting' ); ?>
</head>

<body <?php body_class(); ?>>
Expand Down
15 changes: 15 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down

0 comments on commit 9c3305c

Please sign in to comment.