Code Snippets: CSS code.

CodeSnippets Plug in

CodeSnippets Plug in Installation

Code Snippets empowers you to fully control your site, tweaking everything from interactivity and styling on the front-end, to fully customizing the WordPress dashboard to suit your workflow.
A snippet is like a mini-plugin for your WordPress site, providing added functionality without the clutter.

Installation
Automatic installation
1-Log into your WordPress admin
2-Click Plugins
3-Click Add New
4-Search for Code Snippets – Download Code Snippets
5-Click Install Now under “Code Snippets”
6-Activate the plugin

Manual installation
1-Download the plugin
2-Extract the contents of the zip file
3-Upload the contents of the zip file to the wp-content/plugins/ folder of your WordPress installation
4-Activate the Code Snippets plugin from ‘Plugins’ page.

Network Activating Code Snippets through the Network Dashboard will enable a special interface for running snippets across the entire network.

Inserting html code to Code Snippets Plugin

 

WooCommerce

Add to cart button – WooCommerce

How to Change Add to Cart Button Text in WooCommerce
Customizing the Add to Cart button text in WooCommerce is a valuable way to enhance user experience and align your store’s branding. This guide will walk you through the steps on how to change Add to Cart button text in WooCommerce, from editing theme files to using plugins, ensuring your online store stands out and effectively guides customers through their shopping journey.

Insert the following code into Code Snippets Plugin

 

add_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 20 );

Apply a coupon for minimum cart total

The code snippet below allows you to:

Show a notice on the cart and checkout page, reminding customers that they get a discount if spending more than a minimum amount.
Automatically apply a discount and show a notice that the discount was applied when the cart total is more than a minimum amount.

Requirements:

  • A coupon called COUPON created in WooCommerce > Coupons without a minimum amount.
  • The $minimum_amount variable adjusted to the minimum amount according to your needs.
  • Notices edited to reflect the discount wanted.Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

 

add_action( ‘woocommerce_before_cart’ , ‘add_coupon_notice’ );
add_action( ‘woocommerce_before_checkout_form’ , ‘add_coupon_notice’ );

function add_coupon_notice() {

$cart_total = WC()->cart->get_subtotal();
$minimum_amount = 50;
$currency_code = get_woocommerce_currency();
wc_clear_notices();

if ( $cart_total < $minimum_amount ) { WC()->cart->remove_coupon( ‘COUPON’ );
wc_print_notice( “Get 50% off if you spend more than $minimum_amount $currency_code!”, ‘notice’ );
} else {
WC()->cart->apply_coupon( ‘COUPON’ );
wc_print_notice( ‘You just got 50% off your order!’, ‘notice’ );
}
wc_clear_notices();

WordPress Change log in icon

WordPress Log in Icon replace

How replace WordPress Log in Icon 

***

function custom_login_logo() {

    echo ‘<style type=”text/css”>

        .login h1 a {

          background-image: url(https://replace image address) ; // Your Logo Here

          background-position: center center;

  background-size: contain;

      width: 100%;

        }

    </style>’;

}

add_action(‘login_head’, ‘custom_login_logo’);

 

function login_url(){

return “https://gablestech.com/”; // Your URL Here

}

add_filter(‘login_headerurl’, ‘login_url’);

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.