Number of Woo Products per page

/** * Change number of products that are displayed per page (shop page) */ add_filter( ‘loop_shop_per_page’, ‘new_loop_shop_per_page’, 20 ); function new_loop_shop_per_page( $cols ) { // $cols contains the current number of products per page based on the value stored on…Continue reading

[Advision Publisher] Short Codes

// === SCHEMA: define every shortcode, its params, and internal template === $shortcode_schemas = [ ‘faqs’ => [ ‘description’ => ‘Expandable FAQ section.’, ‘parameters’ => [], ‘_internal’ => [ ‘template_id’ => 3676 ], // INTERNAL ONLY ], // [faq faqs='[{“question”:”…”,”answer”:”…”}]’]…Continue reading

WORDPRESS DYNAMIC DATA FETCHING FUNCTION

/** * ============================================================================ * WORDPRESS DYNAMIC DATA FETCHING FUNCTION * ============================================================================ * @author Sumaiya Akter, Anytype Doc: anytype://object?objectId=bafyreidvxgrkcebamky2hxzxazxbe3phrie6ev44zyhjzco7cmhkgovhle&spaceId=bafyreih4bocrmskuomcrks3sjwpnzxpbxvxwgto23vof3umg2fywdqzjmy.31bq39w6q8ru7&cid=bafybeifc55atash7zlqcjd3fv425bkwl7z5zstcxdilct5hstlng73xwci&key=6kKA3QiwnksqLbpcJ4T6UhmQ5BHzgJUfbpn1QLnkv5Lv * @description This function dynamically fetches data from any specified * WordPress database table based on a set of search criteria. It…Continue reading

Filter by Taxonomy for unifi menu CPT

function rudr_taxonomy_filter( $post_type ){ // let’s decide about post type first if( ‘unifi-custom-menu’ !== $post_type ){ return; } // pass multiple taxonomies as an array of their slugs $taxonomies = array( ‘un-menu-cat’ ); // for every taxonomy we are going…Continue reading

Expose WP User Meta as Shortcodes

function rd__current_user() { static $u = null; if ($u !== null) { return $u; } $u = wp_get_current_user(); // Core: sets current user if not already set. return $u; } /** [user_first_name] */ function rd_sc_user_first_name() { static $first = null;…Continue reading