Skip to main content

Posts

Showing posts from 2021

How to Add a New WordPress Admin User via MySQL

In the wp_users table, click on the Insert tab. Fill in the following details: user_login : Insert the username you want to use for your new admin user. user_pass : Add a password for the account and select MD5 in the Function drop-down. user_email : Add the email address you want to use. user_registered : Select the date and time for when this user should be registered. user_status : Set this value to zero.  go to the wp_usermeta table and click on Insert . user_id : Fill in the ID of the user you created in the previous step. meta_key : Enter wp_capabilities meta_value : Fill in the field with a:1:{s:13:"administrator";s:1:"1";}  

get featured products

 <?php                                 $args = array(                                     'featured' => true,                                     'posts_per_page' => 16                                 );                                 $products = wc_get_products( $args );

get all woocommerce categories

 <?php                     $args = array(                         'taxonomy'   => "product_cat",                         'orderby'    => 'name',                         'order' => 'DESC',                     );                     $product_categories = get_terms($args);                     foreach ( $product_categories as $cat )             ...