Skip to content

Instantly share code, notes, and snippets.

Oren Shimon orenshim

Block or report user

Report or block orenshim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@orenshim
orenshim / gist:552117a006b093b5749afe0b4589625a
Created May 1, 2019
Custom CSS to fix Elementor columns gap issue
View gist:552117a006b093b5749afe0b4589625a
/* Make Elementor elements expand to fit the full available width - due to how EL puts padding
all the way round columns */
.elementor-section-boxed .elementor-column-gap-default > .elementor-row {
width: calc(100% + 20px);
margin-left: -10px;
margin-right: -10px;
}
.elementor-section-boxed .elementor-column-gap-narrow > .elementor-row {
width: calc(100% + 10px);
margin-left: -5px;
View Change Add To Cart Button Text
add_filter( 'woocommerce_product_single_add_to_cart_text', 'cw_btntext_cart' );
add_filter( 'woocommerce_product_add_to_cart_text', 'cw_btntext_cart' );
function cw_btntext_cart() {
return __( 'Go To Checkout', 'woocommerce' );
}
View Skip Cart Code
add_filter('add_to_cart_redirect', 'cw_redirect_add_to_cart');
function cw_redirect_add_to_cart() {
global $woocommerce;
$cw_redirect_url_checkout = $woocommerce->cart->get_checkout_url();
return $cw_redirect_url_checkout;
}
@orenshim
orenshim / gist:900cbad097580846bf1c2e88ea2076cd
Last active Feb 19, 2019
Automatically set Elementor pages full width
View gist:900cbad097580846bf1c2e88ea2076cd
add_action( 'template_redirect','tu_add_elementor_filter', 999 );
function tu_add_elementor_filter() {
if ( in_array( 'elementor-page elementor-page-' . get_the_ID(), get_body_class() ) ) {
add_filter( 'body_class', 'tu_add_elementor_classes' );
add_filter( 'generate_show_title','__return_false' );
}
}
function tu_add_elementor_classes( $classes ) {
$classes[] = 'full-width-content';
View gist:1332e26a691734d672be3e9aa5bfbcca
line-height: 25px; /* within paragraph */
margin-bottom: 20px; /* between paragraphs */
}
View Add new image size to WordPress Media 'Size' dropdown
function my_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'content' => __( 'Content' ),
) );
}
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
View Responsive Column Layouts in Elementor
@media (min-width:768px) and (max-width:950px) {
selector .elementor-row {
flex-wrap:wrap;
}
selector .elementor-colum {
width: 50%;
}
}
View Add More Google Fonts for GP
add_filter( 'generate_number_of_fonts','tu_show_all_available_google_fonts' );
function tu_show_all_available_google_fonts() {
return 'all';
}
View hook for homepage
<?php if ( is_front_page() ) : ?>
This content will only show on the static front page
<?php endif; ?>
View hook for page
<?php if ( is_page(22) ) : ?>
[elementor-template id="556"]
<?php endif; ?>
You can’t perform that action at this time.