Skip to content

Instantly share code, notes, and snippets.

View elias1435's full-sized avatar
🕋
Working from home

Md. Elias elias1435

🕋
Working from home
View GitHub Profile
@elias1435
elias1435 / Archive-product.php
Created August 16, 2022 16:48
Change your woocommerce Product listing with Grid and List view with jQuery
<?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 July 29, 2022 09:53
Elementor - SORT POSTS BASED ON A CUSTOM DATE FIELD
/* 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' );
});
<?php
// Customize SearchWP Engine used.
add_filter( 'searchwp\native\args', function( $args, $query ) {
$args['engine'] = 'supplemental';
return $args;
}, 15, 2 );