Skip to content

Instantly share code, notes, and snippets.

View mrkdevelopment's full-sized avatar

Matt Knighton mrkdevelopment

View GitHub Profile
@mrkdevelopment
mrkdevelopment / link pattern
Created May 4, 2017 08:16
Link to product added to cart
@mrkdevelopment
mrkdevelopment / style.css
Created June 7, 2017 13:01
Divi WooCommerce Button Fix
body .et_pb_button:hover, .woocommerce a.button.alt:hover, .woocommerce-page a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce-page button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce-page input.button.alt:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce-page #respond input#submit.alt:hover, .woocommerce #content input.button.alt:hover, .woocommerce-page #content input.button.alt:hover, .woocommerce a.button:hover, .woocommerce-page a.button:hover, .woocommerce button.button:hover, .woocommerce-page button.button:hover, .woocommerce input.button:hover, .woocommerce-page input.button:hover, .woocommerce #respond input#submit:hover, .woocommerce-page #respond input#submit:hover, .woocommerce #content input.button:hover, .woocommerce-page #content input.button:hover {
color: #fff;
}
.woocommerce a.button.alt, .woocommerce-page a.button.alt, .woocommerce button.button.alt, .woocommerce-page button.button.alt, .woocommerce input.button.alt, .woocommerc
@mrkdevelopment
mrkdevelopment / functions.php
Created June 17, 2017 14:57
Disabled WooCommerce Cart Fragments on your homepage
/** Disable Ajax Call from WooCommerce */
add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11);
function dequeue_woocommerce_cart_fragments() { if (is_front_page()) wp_dequeue_script('wc-cart-fragments'); }
@mrkdevelopment
mrkdevelopment / functions.php
Last active August 10, 2018 01:55
Add logo to checkout page in WooCommerce
/**
* add stripe logo to WooCommerce checkout page
*/
function add_siteseal() {
echo '<img src="https://www.mrkwebsites.com/wp-content/uploads/2017/07/powered_by_stripe_big.png" alt="Power by Stripe" />';
}
add_action( 'woocommerce_after_checkout_form', 'add_siteseal');
@mrkdevelopment
mrkdevelopment / functions.php
Last active June 26, 2017 05:45
Remove Script Version Numbers in WordPress
// Remove version numbers from resources in WP
function _remove_script_version($src)
{
if (strpos($src, 'googleapis.com')) {
return $src;
}
$parts = explode('?', $src);
return $parts[0];
}
@mrkdevelopment
mrkdevelopment / functions.php
Created June 18, 2017 06:26
Remove Emojis Script from WordPress
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
@mrkdevelopment
mrkdevelopment / style.css
Created July 1, 2017 07:12
Hide back to top on mobile
@media only screen and ( max-width: 651px ) {
.et_pb_scroll_top{
display:none !important;
}
}
<?php
// Add your icon toggle switch definition here.
$options['divi_show_google_icon'][] = array(
"name" =>esc_html__("Show Paypal Icon", $themename),
"id" => $shortname."_show_paypal_icon",
"type" => "checkbox2",
"std" => "on",
"desc" =>esc_html__("Here you can choose to display the Paypal Icon. ", $themename)
);
<?php
// Add your social icon url definition here.
$options['divi_google_url'][] = array(
"name" =>esc_html__("Paypal Url", $themename),
"id" => $shortname."_paypal_url",
"std" => "#",
"type" => "text",
"validation_type" => "url",
"desc" =>esc_html__("Enter the URL of your Paypal Profile. ", $themename)
<!-- Paypal icon -->
<?php if ('on' === et_get_option('divi_show_paypal_icon', 'on')) : ?>
<li class="et-social-icon et-social-paypal">
<a href="<?php echo esc_url(et_get_option('divi_paypal_url', '#')); ?>" class="icon">
<i class="fa fa-paypal" aria-hidden="true"></i>
<span><?php esc_html_e('Paypal', 'Divi'); ?></span>
</a>
</li>
<?php endif; ?>