Last active
October 8, 2019 10:41
-
-
Save vyskoczilova/37ae79839120f17b3c7effd4da37a412 to your computer and use it in GitHub Desktop.
Sledovaccí kód do hlavičky
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 // smažte tento řádek | |
/** | |
* @snippet Vložení google analytics / hotjar sledovacího kódu přímo do hlavičky vaší šablony | |
* @source https://kybernaut.cz/?p=2804 | |
* @author Karolína Vyskočilová (https://kybernaut.cz) | |
* @testedwith WordPress 5.2 | |
*/ | |
// ------------------- | |
add_action('wp_head', 'mojesablona_sledovaci_kod'); | |
function mojesablona_sledovaci_kod() { | |
// Pokud uživatel není přihlášen, zobraz kód | |
if ( ! is_user_logged_in() ) : ?> | |
<!-- vložte kompletní sledovací kód včetně tagů <script> sem --> | |
<?php endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment