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
<!-- Add before closing <body> tag --> | |
<script> | |
tarteaucitron.user.analyticsUa = 'UA-XXXXXXXX-XX'; | |
tarteaucitron.user.analyticsMore = function () { ga('set', 'anonymizeIp', true); ga('set', 'forceSSL', true); }; | |
(tarteaucitron.job = tarteaucitron.job || []).push('analytics'); | |
</script> |
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 | |
// Add inline javascript before </head> | |
add_action( 'wp_head', 'header_inline_script' ); | |
function header_inline_script() { | |
?> | |
<script> | |
</script> | |
<?php | |
} |
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
// Scroll to top | |
jQuery('html, body').animate({ scrollTop: 0 }, 1000); | |
// Scroll to element | |
jQuery('html, body').animate({ scrollTop: jQuery('#element').offset().top }, 1000); | |
// Scroll and center element on screen | |
jQuery('html, body').animate({ scrollTop: jQuery('#element').offset().top - jQuery(window).height()/2 - 100 }, 1000); |
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
/** | |
* Add Oxygen's global colors to Gutenberg's backend editor palette | |
*/ | |
function pavenum_gutenberg_oxygen_palette() { | |
$gutenberg_colors = []; | |
$oxy_colors = oxy_get_global_colors(); | |
foreach( $oxy_colors['colors'] as $oxy_color) { | |
$gutenberg_colors[] = [ 'name' => $oxy_color['name'], 'slug' => 'color-' . $oxy_color['id'], 'color' => $oxy_color['value'] ]; |
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
/** | |
* Oxy-Dummy activation (thank you Sridhar Katakam) | |
* Paste this code snippet in your Oxygen's customization plugin | |
* or copy the file to /wp-content/plugins/customization-plugin/ | |
*/ | |
remove_filter( 'template', 'ct_oxygen_template_name' ); | |
remove_filter( 'template_directory', 'ct_disable_theme_load', 1, 1 ); | |
remove_filter( 'stylesheet_directory', 'ct_disable_theme_load', 1, 1 ); |
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
body { | |
--base: 20; | |
--scale-headings: 1.44; | |
--scale-mobile: 0.7; | |
--scale-mobile-headings: 0.4; | |
--scale-icons: 1.4; | |
--min-viewport: 480; | |
--max-viewport: 1600; | |
--max-size: var(--base); | |
} |
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
add_action('wp_head','gtm_head', 20); | |
function gtm_head() { | |
?> | |
<!-- Google Tag Manager --> | |
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | |
})(window,document,'script','dataLayer','GTM-XXXXXX');</script> | |
<!-- End Google Tag Manager --> |
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 | |
$items = get_field('FIELD_NAME'); | |
if( $items ): ?> | |
<ul> | |
<?php foreach( $items as $item ): ?> | |
<li><?php echo $item; ?></li> | |
<?php endforeach; ?> | |
</ul> |
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
/* I'll put here different examples of dynamic query for Oxygen repeater : | |
* - Use one of the following repeater_dynamic_query definitions | |
* in code block just BEFORE the repeater | |
* - Set the repeater custom query settings : post type, number of posts, order... | |
* - Add the remove_action in a code block AFTER the repeater | |
*/ | |
/**************************************************************************************************** | |
* Display related posts for any CPT with taxonomy: |
OlderNewer