This file contains 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
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
// Click event listener for images with class 'shareLink' | |
const images = document.querySelectorAll('.shareLink'); | |
images.forEach(function(image) { | |
image.addEventListener('click', function() { | |
const link = document.URL; | |
// Check if Web Share API is supported | |
if (navigator.share) { |
This file contains 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
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
// Click event listener for images with class 'shareLink' | |
const images = document.querySelectorAll('.shareLink'); | |
images.forEach(function(image) { | |
image.addEventListener('click', function() { | |
const link = this.getAttribute('data-link'); | |
const postTitle = this.getAttribute('data-title'); // Assuming 'data-title' attribute contains the post title | |
// Check if Web Share API is supported |
This file contains 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 new query type controls to query options */ | |
add_filter( 'bricks/setup/control_options', 'bl_setup_query_controls'); | |
function bl_setup_query_controls( $control_options ) { | |
/* Adding new options in the dropdown */ | |
$control_options['queryTypes']['goodmonks_crp_query'] = esc_html__( 'GoodMonks: CRP' ); | |
return $control_options; |
This file contains 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_filter( 'comment_form_fields', 'c_customize_bricks_comment_form_fields' ); | |
function c_customize_bricks_comment_form_fields($fields) { | |
if(isset($fields['url'])){ | |
unset( $fields['url'] ); // remove Comment Author URL field | |
} | |
return $fields; | |
} |
This file contains 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 | |
//Your code wrapped inside this condition | |
if( !bricks_is_builder() && !current_user_can('administrator') ){ | |
//Your code here | |
} |
This file contains 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
<div class="toggle-switch"> | |
<label for="darkSwitch"> | |
<input type="checkbox" id="darkSwitch" /> | |
<span class="toggle-slider"></span> | |
</label> | |
</div> | |
<script> | |
function initTheme(){var e=null!==localStorage.getItem("darkSwitch")&&"dark"===localStorage.getItem("darkSwitch");darkSwitch.checked=e,e?document.body.setAttribute("data-theme","dark"):document.body.removeAttribute("data-theme")}function resetTheme(){darkSwitch.checked?(document.body.setAttribute("data-theme","dark"),localStorage.setItem("darkSwitch","dark")):(document.body.removeAttribute("data-theme"),localStorage.removeItem("darkSwitch"))}var darkSwitch=document.getElementById("darkSwitch");window.addEventListener("load",function(){darkSwitch&&(initTheme(),darkSwitch.addEventListener("change",function(){resetTheme()}))}); | |
</script> |
This file contains 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
(function($) { | |
var stickWidth = 768; | |
var win = $(window); | |
if (win.width() < stickWidth) { | |
$('#page-sidebar').insertAfter('#bottom-section'); | |
} | |
win.resize(function () { | |
if (win.width() < stickWidth) { |
This file contains 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_filter( 'add_to_cart_text', 'woo_custom_single_add_to_cart_text' ); // < 2.1 | |
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_single_add_to_cart_text' ); // 2.1 + | |
function woo_custom_single_add_to_cart_text() { | |
return __( 'My Button Text', 'woocommerce' ); | |
} |
This file contains 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
// Remove plugin update notifications | |
function remove_update_notifications( $value ) { | |
if ( isset( $value ) && is_object( $value ) ) { | |
unset( $value->response[ 'plugin-folder/plugin.php' ] ); | |
} | |
return $value; | |
} | |
add_filter( 'no_update_notifications', 'remove_update_notifications' ); |
This file contains 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
// Exclude Header Scripts Chat Form Different Pages | |
add_action('wp_head', 'joy_exclude_header'); | |
function joy_exclude_header(){ | |
if ( ! is_page( array(17896, 18006, 18040, 18749 ) ) ) { ?> | |
<script type="text/javascript"> | |
// DA SCRIPT | |
</script> |
NewerOlder