Skip to content

Instantly share code, notes, and snippets.

View cuocsongso's full-sized avatar

thembay cuocsongso

View GitHub Profile
@cuocsongso
cuocsongso / limit_title_woo2.php
Created October 18, 2019 07:24
+ Option 2: PHP): Limit all WooCommerce product titles to max number of words
add_filter( 'the_title', 'shorten_woo_product_title', 10, 2 );
function shorten_woo_product_title( $title, $id ) {
if ( ! is_singular( array( 'product' ) ) && get_post_type( $id ) === 'product' ) {
return wp_trim_words( $title, 4, '...' ); // change last number to the number of words you want
} else {
return $title;
}
}
@cuocsongso
cuocsongso / limit_title_woo1.txt
Created October 18, 2019 07:23
Option 1: (CSS): Limit all WooCommerce product titles to one line only
.product-block .name {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@cuocsongso
cuocsongso / urna.pot
Created September 28, 2019 07:38
urna.pot
# Copyright (C) 2019 Thembay Theme
# This file is distributed under the same license as the Thembay Theme package.
msgid ""
msgstr ""
"Project-Id-Version: Thembay Theme\n"
"MIME-Version: 1.0.5\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
@cuocsongso
cuocsongso / Prefetch DNS Requests.xml
Last active July 22, 2020 08:13
Prefetch DNS Requests
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
//s.gravatar.com
@cuocsongso
cuocsongso / Do Not Cache Cookies.xml
Last active October 7, 2019 01:33
Do Not Cache Cookies
urna_recently_viewed_products_list
yith_woocompare_list
yith_wcwl_products
urna_display_mode
@cuocsongso
cuocsongso / CSS Excludes.xml
Created June 4, 2019 07:51
Urna CSS Excludes
/wp-content/plugins/woocommerce/assets/css/woocommerce-smallscreen-rtl.css
/wp-content/plugins/woocommerce/assets/css/woocommerce-smallscreen.css
@cuocsongso
cuocsongso / recently-viewed-products.txt
Created May 25, 2019 03:12
Urna Recently Viewed Products
<p>[vc_row css=".vc_custom_1557971355542{padding-top: 50px !important;}"][vc_column][tbay_product_recently_viewed only_image="" number="10" responsive_type="yes"][/vc_column][/vc_row]</p>
@cuocsongso
cuocsongso / flash-sale.xml
Created May 25, 2019 02:52
Urna Flash Sale
<p>[vc_row full_width="stretch_row_content_no_spaces" css=".vc_custom_1555906234435{padding-bottom: 50px !important;}"][vc_column][vc_single_image image="6722" img_size="full"][/vc_column][/vc_row][vc_row][vc_column][tbay_product_flash_sales date_title="Time remaining:" responsive_type="yes" end_date="2019-07-26" ids="2367, 2365, 2362, 2359, 2357, 2356, 2355, 2354, 2317, 2315"][/vc_column][/vc_row]</p>
@cuocsongso
cuocsongso / urna-htacess.xml
Created May 17, 2019 13:11
urna htacess code
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
@cuocsongso
cuocsongso / urna-mailChimp.html
Created May 15, 2019 13:38
Urna - MailChimp
<div class="mail-style1">
<div class="input-group">
<input id="mc4wp_email" class="form-control input-newletter" name="EMAIL" required="required" type="email" placeholder="Enter your e-mail ..." />
<span class="input-group-btn">
<input class="btn btn-default" type="submit" value="SIGN UP" />
</span>
</div>
</div>