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
JQuery.type(object); |
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
^/lt/blog/(?!some-slug-one|some-slug-two)(.*) |
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 | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change the canonical link for the shop page | |
* Credit: Scott Weiss of somethumb.com | |
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1 | |
*/ | |
function yoast_seo_canonical_change_woocom_shop( $canonical ) { | |
if ( !is_shop() ) { |
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
# BEGIN Redirects | |
RewriteEngine On | |
# 301 redirect www to non-www | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
# 301 redirect to https | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# END Redirects |
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
if (typeof yourFunctionName == 'function') { | |
yourFunctionName(); | |
} |
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 echo do_shortcode('[best_selling_products per_page="12" orderby="popularity" order="DESC"]'); ?> | |
OR | |
<?php | |
$args = array( | |
'post_type' => 'product', | |
'meta_key' => 'total_sales', | |
'orderby' => 'meta_value_num', | |
'posts_per_page' => 12, |
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
Not all the browsers accept WEBP image format but you can type a code to check if the browser accept WEBP format then you will have to make a new images cache and convert the existing images to webp | |
on the fir dir catalog/model/tool/image.php add | |
$image_new_webp = 'cachewebp/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . (int)$width . 'x' . (int)$height . '.webp'; | |
after this | |
$image_new = 'cache/' | |
to check if the browser accept image.webp and to create your new images cache in the same file: catalog/model/tool/image.php add this code: |
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 add_rel_preload($html, $handle, $href, $media) { | |
if (is_admin()) | |
return $html; | |
$html = <<<EOT | |
<link rel='preload' as='style' onload="this.onload=null;this.rel='stylesheet'" | |
id='$handle' href='$href' type='text/css' media='all' /> | |
EOT; | |
return $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
add_filter( 'woocommerce_structured_data_product', 'custom_set_extra_schema', 20, 2 ); | |
function custom_set_extra_schema( $schema, $product ) { | |
$gtin = get_post_meta( $product->get_id(), '_custom_gtin', true ); | |
$schema['gtin13'] = $gtin; | |
return $schema; | |
} |