Skip to content

Instantly share code, notes, and snippets.

View vikaskhunteta's full-sized avatar

Vikas Khunteta vikaskhunteta

View GitHub Profile
@vikaskhunteta
vikaskhunteta / pagination.php
Last active July 30, 2021 10:16
Pagination for different custom post type inside single pages using WP Page Navi Plugin
<?php
$paged = 1;
if ( isset( $_GET['page_no'] ) ) {
$paged = (int)$_GET['page_no'];
} else {
$paged = 1;
}
if ( ! $paged ) {
$paged = 1;
@vikaskhunteta
vikaskhunteta / functions.php
Last active December 4, 2023 03:29
Get available shipping methods before products added into cart
<?php
// Get available shipping methods before products added into cart
// below function is intended to work with single shipping zone and their methods
// Place this code into functions.php file of your WP active theme
if ( ! function_exists( 'get_available_shipping_methods' ) ) {
function get_available_shipping_methods()
{
global $wpdb;