SQL order by fields
SELECT * FROM wp_posts WHERE ID IN (5,26,4) ORDER BY FIELD(ID,5,26,4)
Renaming existing tabs. add_filter( ‘woocommerce_product_tabs’, ‘woo_rename_tabs’, 98 ); function woo_rename_tabs( $tabs ) { $tabs[’description’] = array( ‘title’ => __( ‘WORKING’, ‘woocommerce’ ), ‘priority’ => 10, ‘callback’ => ‘the_content’ ); $tabs[’reviews’] = array( ‘title’ => __( ‘FAULTY’, ‘woocommerce’ ), ‘priority’ => 30, ‘callback’ => ‘woo_before_tabs_title’ ); return $tabs; } function woo_before_tabs_title() { the_field(‘faulty’); } This code…
How to get the category ID of the current post? Just copy the codes below and paste it into your .php file. $category = get_the_category( get_the_ID() ); $category_ID = $category[0]->term_id; Another problem is, what if the category ID is a sub category and you need the parent category ID? For Example, the current category ID…
WDES Responsive Tool 2 is a WordPress plug-in designed to provide mobile responsive solution for your websites. WDES Responsive Tool 2 helps your websites mobile friendly and much more reliable in mobile view.
How to fix ajax POST /wp-admin/admin-ajax.php 500 (Internal Server Error)? I’m receiving this error in console when I’m about to call my ajax code backend. It appears to me that I am missing global variable in enable the code to work. See the wrong and correct coding below. It might be not the same issue…
Paste the codes below into your function.php add_action('get_header','remove_title'); function remove_title(){ if( is_home() || is_front_page() ){ remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); } }
Get the sub category of the current product category page. This code is applied if you are viewing the product archive page. The codes below and a sample category hierarchy list. Example: Category Parent Category 1 Category 2 Category 3 Category 4 Category 1.1 Category 2.1 Category 3.1 Category 4.1 Here’s a code: $category_object =…