Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Welcome to WP Wiki! Get answers to all your WordPress questions and learn about WordPress development on our Q&A website. Connect with experts and join our community today!
How to add a new column in product list page (backend)?
You can create a new custom column in admin product list page. We can use manage_edit-product_columns filter hook and manage_product_posts_custom_column action hook for create new column. "Primary category" is not a default woocommerce feature. It is comes from yoast seo plugin. This field is storedRead more
You can create a new custom column in admin product list page. We can use
manage_edit-product_columns
filter hook andmanage_product_posts_custom_column
action hook for create new column.“Primary category” is not a default woocommerce feature. It is comes from yoast seo plugin. This field is stored in
postmeta
table with “_yoast_wpseo_primary_product_cat
” meta_key.Add the following code in functions.php of your child theme.
This will create a new column with “Primary Category” as shown in the below screenshot.

See lessHow to apply a free shipping coupon for specific user in woocommerce?
Yes,You can add the following code to do that. add_filter('woocommerce_package_rates', 'wp_wiki_woocommerce_tiered_shipping', 10, 2); function wp_wiki_woocommerce_tiered_shipping($rates, $package) { $user = wp_get_current_user(); if ($user->user_email == 'test@email.com') { $free = array(); foreaRead more
Yes,You can add the following code to do that.
See lessHow to change woocommerce shop or product archive page default images?
To fix that,You should call a larger resolution images than the existing one. Let's set a size of 513*385 in both pages,which will look good.These are the following steps: Regenerate a custom size (513*385 in my case) using Regenerate Thumbnails plugin https://wordpress.org/plugins/regenerate-thumbRead more
To fix that,You should call a larger resolution images than the existing one. Let’s set a size of 513*385 in both pages,which will look good.These are the following steps:
How to clear cart item with a custom url in WooCommerce?
By default WooCommerce is not providing a URL to remove items in cart. If you want to create a custom URL for clear cart try this code in functions.php add_action('init', 'woocommerce_clear_cart'); function woocommerce_clear_cart() { if(isset($_GET['clear-cart'])) { global $woocommerce; $woocommerceRead more
By default WooCommerce is not providing a URL to remove items in cart. If you want to create a custom URL for clear cart try this code in functions.php
This will allow you to remove cart item by running this URL
See lesshttps://yourwebsite.com/?clear-cart=true
How to get all orders of a single customer in WooCommerce?
You can use wc_get_orders function to get orders from WooCommerce. Try the following code to retrieve orders from a specific user. $customer_id = '123'; // Set the customer id to retieve orders $args = array( 'customer_id' => $customer_id, 'status' => array('wc-completed', 'wc-processing', 'wcRead more
You can use
wc_get_orders
function to get orders from WooCommerce. Try the following code to retrieve orders from a specific user.You will get 10 recent orders of a customer by using this code. If you want to get all orders, then you can change limit to “-1” as
See lesslimit => -1
. But it is not recommended to use limit “-1” as it may lead to performance issue if your site has large number of orders.How to create a custom database table when activate a plugin?
To create a custom database table in WordPress when activating a plugin, add the following code in plugin file. register_activation_hook(__FILE__, 'create_custom_table'); function create_custom_table() { global $wpdb; $table_name = $wpdb->prefix . 'custom_table'; $charset_collate = $wpdb->get_Read more
To create a custom database table in WordPress when activating a plugin, add the following code in plugin file.
register_activation_hook
function will be triggered when plugin is activateddbDelta
function is used to create the table.custom_table
with your desired table name, andcolumn1
andcolumn2
with your desired column names.How to add a settings link for my plugin in plugin list page?
To add a settings link in your plugin actions, you can use the plugin_action_links filter. Add the following code in your plugins main file. function add_settings_link($links) { $settings_link = '' . __('Settings') . ''; array_push($links, $settings_link); return $links; } add_filter('plugin_action_Read more
To add a settings link in your plugin actions, you can use the
plugin_action_links
filter. Add the following code in your plugins main file.Replace ‘your-plugin-settings’ with the actual settings page slug for your plugin.
See lessHow to Add Custom JavaScript to WordPress?
To enqueue custom JavaScript in WordPress, you can use wp_enqueue_script function. Add your JavaScript file in child theme folder. Lets "custom-script.js" is your file, and it is located in "child-theme/js' folder, then add the following code in functions.php to enqueue your script. function functioRead more
To enqueue custom JavaScript in WordPress, you can use
wp_enqueue_script
function. Add your JavaScript file in child theme folder. Lets “custom-script.js” is your file, and it is located in “child-theme/js’ folder, then add the following code in functions.php to enqueue your script.custom-script
: The handle for the script, which is used as a unique identifier.get_stylesheet_directory_uri() . '/js/custom-script.js'
: The URL of the script file.array( 'jquery' )
: An array of dependencies. If the script not depends on jQuery, then you leave it as emptyarray( '' ).
1.0
: The version number of the script.true
: Whether to load the script in the footer (true
) or the header (false
).How to Create a WordPress Child Theme?
To create a child them in WordPress, do these steps Create a new folder in the "wp-content/themes" directory and name it as "parent-theme-child". (You can give any unique name) Create a new stylesheet (style.css) within the new folder. In the stylesheet, add the following header information at the tRead more
To create a child them in WordPress, do these steps
style.css
) within the new folder.functions.php
file in the child theme folder to add custom functionality. Add following code to enqueue stylesheet.