Skip to content

Instantly share code, notes, and snippets.

Avatar

Md. Elias elias1435

View GitHub Profile
@elias1435
elias1435 / Archive-product.php
Created Aug 16, 2022
Change your woocommerce Product listing with Grid and List view with jQuery
View Archive-product.php
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive
*
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@elias1435
elias1435 / functions.php
Created Jul 29, 2022
Elementor - SORT POSTS BASED ON A CUSTOM DATE FIELD
View functions.php
/* Sort Posts by Custom Date Field */
add_action( 'elementor/query/event_sort_date', function( $query ) {
$query->set( 'meta_key', 'event_date' );
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'order', 'ASC' );
});
View Elementor Search Filter using SearchWP plugins Filter
<?php
// Customize SearchWP Engine used.
add_filter( 'searchwp\native\args', function( $args, $query ) {
$args['engine'] = 'supplemental';
return $args;
}, 15, 2 );