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 | |
function dejavu_woocommerce_notice_shortcode($atts) { | |
ob_start(); | |
?> | |
<div id="ds-wc-notices"></div> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
var noticesContainer = $('.woocommerce-notices-wrapper'); | |
if (noticesContainer.length) { | |
$('#ds-wc-notices').append(noticesContainer); |
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 | |
// remove featured image from product gallery | |
add_filter('woocommerce_single_product_image_thumbnail_html', 'ds_remove_product_featured_image', 10, 2); | |
function ds_remove_product_featured_image($html, $attachment_id ) { | |
global $post, $product; | |
$featured_image = get_post_thumbnail_id( $post->ID ); | |
if ( $attachment_id == $featured_image ) | |
$html = ''; |
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 | |
// load inline SVG | |
function ds_load_inline_svg($filename, $class = 'ds-icon-svg') | |
{ | |
// Add the path to your SVG directory inside your theme. | |
$svg_path = '/assets/img/svg/'; | |
// Check the SVG file exists | |
if (file_exists(get_stylesheet_directory() . $svg_path . $filename)) { | |
$svg = ''; | |
$svg .= '<div class="ds-icon ' . $class . '">'; |
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 ($) { | |
$("a[href*=\\#]:not([href=\\#])").click(function () { | |
if ( | |
location.pathname.replace(/^\//, "") == | |
this.pathname.replace(/^\//, "") || | |
location.hostname == this.hostname | |
) { | |
var target = $(this.hash), | |
headerHeight = $("header#site-header").height() + 20; |
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 | |
if ( function_exists( 'register_block_style' ) ) { | |
register_block_style( | |
'core/list', | |
array( | |
'name' => 'ds-number', | |
'label' => __( 'Number List', 'dejavu' ), | |
'is_default' => false, | |
) | |
); |
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
<!-- add a HTML widget --> | |
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/[email protected]/slick/slick.css"/> | |
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/[email protected]/slick/slick-theme.css"/> | |
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js"></script> | |
<script> | |
jQuery(document).ready(function(){ | |
jQuery('.ds-slick-slide .elementor-loop-container').slick({ | |
centerMode: true, | |
centerPadding: '0', | |
slidesToShow: 3, |
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('blocksy:social-box:dynamic-social-networks', function ($networks) { | |
$networks[] = [ | |
'id' => 'facebook', | |
'name' => __('Facebook', 'blocksy'), | |
'icon' => '<svg | |
width="20px" | |
height="20px" | |
viewBox="0 0 20 20" | |
aria-hidden="true"> |
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 | |
// single product - add new tab | |
add_filter( 'woocommerce_product_tabs', 'dejavu_woo_new_tab' ); | |
function dejavu_woo_new_tab( $tabs ) { | |
// rename default product tabs | |
$tabs[ 'description' ][ 'title' ] = '內容簡介'; | |
$tabs[ 'additional_information' ][ 'title' ] = '其他資訊'; | |
// display only when ACF custom fields is presented |
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_action('wp_footer', 'ching_gf_fbq' ); | |
function ching_gf_fbq() { | |
// if show code on certain page | |
// if( ! is_page(123) ) | |
// return; | |
?> | |
<script> | |
jQuery(document).ready(function(){ | |
jQuery(document).on('gform_confirmation_loaded', function(event, formId) { |
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
<!-- Insert into your article (switch to HTML mode) --> | |
<section class="index-list"> | |
<h4>In This Article</h4> | |
<ul id="toc"></ul> | |
</section> | |
<!-- This script will load all H2 headings in your article --> | |
<h2>I am a title!</h2> |
NewerOlder