Skip to content

Instantly share code, notes, and snippets.

View advokatb's full-sized avatar

advokatb

  • Ukraine
View GitHub Profile
@micc83
micc83 / skip-to-check-out.php
Last active April 11, 2024 00:13
Skip cart and redirect to direct checkout on WooCommerce
<?php
/**
* Skip cart and redirect to direct checkout
*
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
*/
// Skip the cart and redirect to check out url when clicking on Add to cart
@iqbalrony
iqbalrony / custom-css.php
Last active November 22, 2023 11:56
How to add custom css control with elementor free version.
<?php
use Elementor\Controls_Manager;
use Elementor\Element_Base;
use Elementor\Core\Files\CSS\Post;
use Elementor\Core\DynamicTags\Dynamic_CSS;
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
@sjozsef
sjozsef / Pure Bootstrap Contact Form 7 template
Last active March 23, 2023 10:03
bootstrap-contact-form-7.html
<hr />
<div class="row">
<div class="col-md-4">
[text* your-name class:form-control placeholder "Name (required)"]
</div>
<div class="col-md-4">
[email* your-email class:form-control placeholder "Email (required)"]
@MatthewEppelsheimer
MatthewEppelsheimer / country-shortcode.php
Last active February 27, 2023 11:44
WP Contact Form 7 shortcode with list of Countries
<?php
/*
Localizations:
- [Spanish](https://gist.github.com/MatthewEppelsheimer/1498955#gistcomment-3317461) props @chdgp
UPDATED: 2020-03-09
@mikejolley
mikejolley / gist:e73f9d061aaebd25ccdc
Created February 22, 2016 13:07
WooCommerce - Remove subtotal row.
add_filter( 'woocommerce_get_order_item_totals', 'adjust_woocommerce_get_order_item_totals' );
function adjust_woocommerce_get_order_item_totals( $totals ) {
unset($totals['cart_subtotal'] );
return $totals;
}
@TANVIRFAZLEY
TANVIRFAZLEY / font.php
Created January 11, 2018 23:05
google font from IKAMAL
<?php
if ( ! function_exists( 'name_fonts_url' ) ) :
/**
* Register Google fonts for Your theme
*
* Create your own name_fonts_url() function to override in a child theme.
@TANVIRFAZLEY
TANVIRFAZLEY / scroll.js
Created January 11, 2018 23:06
smooth scroll from IKAMAL
// Add smooth scrolling to all links
$('a[href^="#"]').on('click', function(e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 900, 'swing', function() {
@MogulChris
MogulChris / find-replace-elementor.sql
Created January 24, 2022 00:52
MySQL / PHPMyAdmin find and replace of Elementor data
# Points to note:
# 1. Elementor data is saved as JSON in wp_postmeta with meta_key _elementor_data
# 2. The LIKE operator needs four backslashes for every one in the JSON data you are looking for.
# 3. The REPLACE function needs two backslashes for every one in the find / replace strings.
# 4. Eg: Searching for buttons with a particular label and linking to "/" - I want to change their links to /case-studies
update `wp_3_postmeta` set meta_value = REPLACE(meta_value, '"button_label":"View All","button_link":"\\/','"button_label":"View All","button_link":"\\/case-studies') WHERE meta_key = '_elementor_data' AND meta_value LIKE '%"button_label":"View All","button_link":"\\\\/"%';
@UVLabs
UVLabs / woocommerce_check.php
Last active October 27, 2021 16:02
Check if WooCommerce is active on a website and output admin notice if not
<?php
// check if WooCommerce is activated
function tld_wc_check(){
if ( class_exists( 'woocommerce' ) ) {
global $tld_wc_active;
$tld_wc_active = 'yes';
} else {
@SJ-James
SJ-James / collapse_sections.php
Created March 14, 2018 01:14
Add a 'Collapse Section' button to the Elementor Editor
<?php
//Add to functions.php in child theme
function e_collapse_sections(){
?>
<!-- Scripts and styles should enqueued properly but for the sake of having it all in one function...-->
<script>
if ( self !== top ) { // Check if we're in a preview window / iframe
jQuery(document).ready(function($){