Skip to content

Instantly share code, notes, and snippets.

View zenaul's full-sized avatar

Zenaul Islam zenaul

View GitHub Profile
<?php
if(!function_exists('wc_get_products')) {
return;
}
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$ordering = WC()->query->get_catalog_ordering_args();
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby']));
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby'];
@zenaul
zenaul / example-ajax-enqueue.php
Created July 22, 2019 10:24 — forked from devinsays/example-ajax-enqueue.php
Simple WordPress Ajax Example
<?php
function example_ajax_enqueue() {
// Enqueue javascript on the frontend.
wp_enqueue_script(
'example-ajax-script',
get_template_directory_uri() . '/js/simple-ajax-example.js',
array('jquery')
);
@zenaul
zenaul / Responsive Query
Created April 29, 2017 03:53
Responsive Query
/* Normal desktop :992px. */
@media (min-width: 992px) and (max-width: 1200px) {
}
/* Tablet desktop :768px. */
@media (min-width: 768px) and (max-width: 991px) {
@zenaul
zenaul / Tooltip
Created April 29, 2017 03:48
Bootstrap tooltip customize
Tooltip activation
---------------------
$('[data-toggle="tooltip"]').tooltip({
animated: 'fade',
placement: 'top',
container: 'body'
});
@zenaul
zenaul / Category-menu.html
Last active December 1, 2015 18:49
Category Menu
<div class="category-menu" id="cate-toggle">
<ul>
<li class="has-sub"><a href="#">Shirts</a>
<ul class="category-sub">
<li class="has-sub"><a href="#">Tops</a>
<ul>
<li><a href="#">T-shirts</a></li>
<li><a href="#">Blouses</a></li>
</ul>
</li>