Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Amin Diary amindiary

🏠
Working from home
View GitHub Profile
View var_dump.php
<?php
function var_dump2($data){
print("<pre>".print_r($data,true)."</pre>");
}
?>
@amindiary
amindiary / functions.php
Created Apr 27, 2021 — forked from yoren/functions.php
Get terms by custom post types and taxonomy
View functions.php
<?php
/**
* my_terms_clauses
*
* filter the terms clauses
*
* @param $clauses array
* @param $taxonomy string
* @param $args array
@amindiary
amindiary / elementor-popup.js
Created Mar 23, 2021
Open Elementor popup using javascript
View elementor-popup.js
elementorProFrontend.modules.popup.showPopup( { id: 123 } );
View woocommerce-ajax.js
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',
@amindiary
amindiary / custom-ul-li.css
Created Feb 25, 2021
custom ul li fix elementor
View custom-ul-li.css
.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;
}
@amindiary
amindiary / elementor-p.css
Created Feb 25, 2021
elementor fix p margins text editor
View elementor-p.css
.elementor-text-editor{
p:first-child {
margin-top: 0;
}
p:last-child {
margin-bottom: 0;
}
}
View elementor-pagination.php
add_filter( 'elementor/widget/render_content', 'elementor_pager_fix', 10, 2 );
function elementor_pager_fix( $widget_content, $widget_base ) {
if (!class_exists('ElementorPro\Modules\Posts\Widgets\Posts_Base') ||
!($widget_base instanceof ElementorPro\Modules\Posts\Widgets\Posts_Base)
) {
return $widget_content;
}
$permalink = get_permalink();
@amindiary
amindiary / elementor-laptop.css
Last active Feb 11, 2021
Elementor Container laptop fixes
View elementor-laptop.css
@media all and (min-width:1025px) and (max-width:1622px){
}
@media all and (min-width:1500px) and (max-width:1622px){
.elementor-section.elementor-section-boxed > .elementor-container {
max-width: 1300px!important;
View stretch-height.css
.stretch-height {
flex: 1;
display: flex;
height: 100%;
}
@amindiary
amindiary / remove-empty.js
Created Feb 4, 2021
remove empty p tags jquery
View remove-empty.js
jQuery('p').each(function() {
var $this = jQuery(this);
if($this.html().replace(/\s|&nbsp;/g, '').length == 0)
$this.remove();
});