Skip to content

Instantly share code, notes, and snippets.

@bigdigital
bigdigital / gist:202607c4f861fac5bd9eeb9190500564
Created March 8, 2017 15:43
remove woocommerce add to cart button
function remove_woocommerce_button(){
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
}
add_action('init','remove_woocommerce_button');
@bigdigital
bigdigital / function.php
Created March 29, 2017 09:13
Change logo link The7
//since The7 5.0.2
function my_custom_logo_url($url)
{
return "example.com";
}
add_filter('presscore_display_the_logo-url', 'my_custom_logo_url' , 10, 1 );
@bigdigital
bigdigital / functions.php
Last active March 29, 2017 12:29
Add custom less file to the theme The7
public static function add_my_dynamic_stylesheets_action( $dynamic_stylesheets ) {
return array_merge(
$dynamic_stylesheets,
array(
'bb-press.less' => array(
//for child theme functions.php
'path' => PRESSCORE_CHILD_THEME_DIR . '/css/myless.less',
'src' => PRESSCORE_CHILD_THEME_URI . '/css/myless.less',
//for main theme functions.php
//'path' => PRESSCORE_THEME_DIR . '/css/myless.less',
@bigdigital
bigdigital / functions.php
Created April 7, 2017 13:03
Cnanging Logout Link The7
add_filter( 'logout_url', 'custom_logout_url' );
function custom_logout_url( $default )
{
// set your URL here
return !current_user_can('administrator') ? 'http://example.com/custom' : $default;
}
@bigdigital
bigdigital / finctions.php
Created April 11, 2017 08:59
WooCommerce disable magnification / zoom
add_action( 'wp_enqueue_scripts', 'dt_disable_wc_zomm' );
function dt_disable_wc_zomm() {
wp_dequeue_script( 'zoom' );
}
@bigdigital
bigdigital / custom.css
Last active October 2, 2017 07:14
The7 make static woocommerce popup message
.woocommerce-error, div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content)>.woocommerce-info, div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content)>.woocommerce-message{
position: initial !important;
top: initial !important;
left: initial !important;
width: 100% !important;
max-height: initial !important;
min-height: initial !important;
margin: 15px 0px !important;
padding: 10px 20px;
z-index: 10;
@bigdigital
bigdigital / custom css
Created April 14, 2017 17:29
The7 Sticky Top Bar and Top bar on Mobile
.top-bar, .top-bar a, .top-bar .mini-nav .customSelect, .top-bar .mini-nav a:hover, .header-bottom-bar a {
color: #adb0b6 !important;
position: fixed !important;
width: 100% !important;
background: #fff none repeat center center !important;
z-index: 9999 !important;
top: 0;
}
.masthead {
@bigdigital
bigdigital / functions.php
Last active April 15, 2017 11:07
Replacing "noimage" in child theme
function presscore_get_default_image() {
return array( PRESSCORE_CHILD_THEME_URI . '/images/noimage.jpg', 1000, 700 );
}
function presscore_get_default_small_image() {
return array( PRESSCORE_CHILD_THEME_URI . '/images/noimage-small.jpg', 119, 119 );
}
function presscore_get_default_thumbnail_image() {
return array( PRESSCORE_CHILD_THEME_URI . '/images/noimage-thumbnail.jpg', 150, 150 );
@bigdigital
bigdigital / functions.php
Created April 19, 2017 10:06
The7 Open blog in the new tab
function my_dt_post_thumbnail_args($args)
{
$args['wrap'] = '<p><a %HREF% %CLASS% %CUSTOM% target="_blank"><img %IMG_CLASS% %SRC% %ALT% %IMG_TITLE% %SIZE% /></a></p>';
return $args;
}
add_filter('dt_post_thumbnail_args', 'my_dt_post_thumbnail_args' , 20 );
@bigdigital
bigdigital / functions.php
Last active February 20, 2018 09:50
The7 change logo url
function my_presscore_display_the_logo_url($url) {
$url = 'http://example.com';
if ( presscore_is_microsite() && ( $m_url = get_post_meta( $post->ID, '_dt_microsite_logo_link', true ) ) ) {
$url = $m_url;
}
return $url;
}
add_filter( 'presscore_display_the_logo-url','my_presscore_display_the_logo_url', 10 ,1);