diff options
| author | moehm | 2014-08-24 20:16:57 +0200 |
|---|---|---|
| committer | moehm | 2014-08-24 20:16:57 +0200 |
| commit | 5ce187bf4580dc521b1778dc3e3ab76bf05ac77c (patch) | |
| tree | 1135817caae263290f6c8da0961916fd1807c00c /wordpress/functions.php | |
| parent | 67415c4d7612b2da0bb9e55bebb39db837a6ae33 (diff) | |
| parent | 2e42dd3c875bde5a464c4077e1ea5d424eca1a3f (diff) | |
| download | dotfiles-5ce187bf4580dc521b1778dc3e3ab76bf05ac77c.tar.gz | |
Merge branch 'master' of git.iamfabulous.de:dotfiles
Diffstat (limited to 'wordpress/functions.php')
| -rw-r--r-- | wordpress/functions.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/wordpress/functions.php b/wordpress/functions.php new file mode 100644 index 0000000..464d9a3 --- /dev/null +++ b/wordpress/functions.php @@ -0,0 +1,24 @@ +<?php + +// Replace jquery through the CDN version and move it to the footer +function movejquerytofooter(){ + if(!is_admin()){ + wp_deregister_script('jquery'); + wp_register_script('jquery', '//code.jquery.com/jquery-2.1.1.min.js', false, '1.3.2', true); + + wp_enqueue_script('jquery'); + } +} + +// Disable W3TC footer comment for everyone but Admins (single site & network mode) +if ( !current_user_can( 'activate_plugins' ) ) { + add_filter( 'w3tc_can_print_comment', function( $w3tc_setting ) { return false; }, 10, 1 ); +} + +// Add piwik tracking script without the plugin +function var_piwik() { + if (!is_admin()) { + wp_register_script( 'piwik', get_template_directory_uri() . '/js/piwik.js','',null,true); + wp_enqueue_script('piwik'); + } +} |
