Skip to content

Instantly share code, notes, and snippets.

View LeMiira's full-sized avatar
🏠
Working from home

Mira LeMiira

🏠
Working from home
View GitHub Profile
@LeMiira
LeMiira / woocommerce-product-reviews.php
Created July 13, 2021 12:13
woocommerce product reviews
//https://silvawebdesigns.com/woocommerce-product-reviews/
add_shortcode( 'product_reviews', 'silva_product_reviews_shortcode' );
function silva_product_reviews_shortcode( $atts ) {
if ( empty( $atts ) ) return '';
if ( ! isset( $atts['id'] ) ) return '';
@LeMiira
LeMiira / woocommerce-plus-minus.php
Created July 13, 2021 10:09
dd to Cart Quantity Plus & Minus Buttons
//https://www.tychesoftwares.com/how-to-add-plus-and-minus-buttons-to-the-quantity-input-on-the-product-page-in-woocommerce/
add_action( 'woocommerce_after_add_to_cart_quantity', 'ts_quantity_plus_sign' );
function ts_quantity_plus_sign() {
echo '<button type="button" class="plus" >+</button>';
}
add_action( 'woocommerce_before_add_to_cart_quantity', 'ts_quantity_minus_sign' );
function ts_quantity_minus_sign() {
@LeMiira
LeMiira / wp_login_elementor.php
Created May 12, 2021 15:21
custom wordpress login page
<?php
function is_wplogin(){
$ABSPATH_MY = str_replace(array('\\','/'), DIRECTORY_SEPARATOR, ABSPATH);
return ((in_array($ABSPATH_MY.'wp-login.php', get_included_files()) || in_array($ABSPATH_MY.'wp-register.php', get_included_files()) ) || (isset($_GLOBALS['pagenow']) && $GLOBALS['pagenow'] === 'wp-login.php') || $_SERVER['PHP_SELF']== '/wp-login.php');
}
add_action( 'wp_head', 'user_registration_login_init', 10, 1 );
@LeMiira
LeMiira / custom-select.js
Last active August 9, 2021 13:48
Custom Select / jQuery SCSS
if(jQuery('select.hidden-select').length){
initCustomSelect();
}
function initCustomSelect(){
// Iterate over each select element
jQuery('select.hidden-select').each(function () {
// Cache the number of options
@LeMiira
LeMiira / var_dump.php
Created May 3, 2021 07:05
Pretty var_dump
<?php
function var_dump2($data){
print("<pre>".print_r($data,true)."</pre>");
}
?>
@LeMiira
LeMiira / functions.php
Created April 27, 2021 11:41 — forked from yoren/functions.php
Get terms by custom post types and taxonomy
<?php
/**
* my_terms_clauses
*
* filter the terms clauses
*
* @param $clauses array
* @param $taxonomy string
* @param $args array
@LeMiira
LeMiira / elementor-popup.js
Created March 23, 2021 10:11
Open Elementor popup using javascript
elementorProFrontend.modules.popup.showPopup( { id: 123 } );
jQuery( ".add_to_cart_button" ).each(function(){
var product_id = jQuery(this).attr('data-product_id');
var el = jQuery(this);
el.click(function(e) {
e.preventDefault();
var data = {
action: 'woocommerce_ajax_add_to_cart',
@LeMiira
LeMiira / custom-ul-li.css
Created February 25, 2021 13:24
custom ul li fix elementor
.custom-ul-li .elementor-text-editor > ul,.custom-ul-li .elementor-text-editor > ol{
margin: 0;
padding: 0 0 0 20px;
}
.custom-ul-li ::marker{
color:#CF5757;
font-weight: bold;
font-style: italic;
}
@LeMiira
LeMiira / elementor-p.css
Created February 25, 2021 12:26
elementor fix p margins text editor
.elementor-text-editor{
p:first-child {
margin-top: 0;
}
p:last-child {
margin-bottom: 0;
}
}