before - How to add text before price in WooCommerce

How to add text before price in WooCommerce

To put a string before the price of WooCommerce product and cart pages, use the WooCommerce filters woocommerce_cart_item_price and woocommerce_get_price_html Add the following code to your active theme functions.php file. Make sure to change <span class=”price-prefix”>TEXT BEFORE THE PRICE</span> with your text or HTML code. NEXT: How to Add text after the price in WooCommerce

Disable WordPress comments based on User GeoLocation - Disable WordPress comments based on User GeoLocation

Disable WordPress comments based on User GeoLocation

If you want to disable comments in WordPress based on the user’s location, you can do so by using the following steps: Step 1. Install and activate the “GeoIP Detection” plugin. This plugin allows you to detect the user’s location based on their IP address. Step 2. Add the following code to your theme’s functions.php … Read full article →

woocommerce phone number verification - WooCommerce 📱 phone number verification (+381)

WooCommerce 📱 phone number verification (+381)

One of the most important checkout fields for online stores that is also prone to oversight is phone verification. Order confirmation and delivery can both be made much simpler with proper phone verification. In WooCommerce, the phone number field provides an HTML check for a straightforward number: But by ensuring that the number contains a … Read full article →

phpinfo WordPress Shortcode - phpinfo() WordPress Shortcode

phpinfo() WordPress Shortcode

Here is an example of a simple WordPress plugin that uses the [phpinfo] shortcode to display PHP information similar to what the phpinfo() function does: <?php /* Plugin Name: PHP Info Shortcode Description: Displays PHP information using the [phpinfo] shortcode. */ function phpinfo_shortcode_handler( $atts ) { // Build the HTML for the data $html = … Read full article →

How to Show Different Themes to Logged in Users in WordPress - How to Show Different Themes to Logged-in Users in WordPress

How to Show Different Themes to Logged-in Users in WordPress

In this example, we’ll use the is_user_logged_in() to display a different theme on our website for visitors: if(is_user_logged_in()) { function wpxss_set_my_custom_theme() { //replace your theme name here return ‘your-theme-name’; } add_filter( ‘template’, ‘wpxss_set_my_custom_theme’ ); add_filter( ‘stylesheet’, ‘wpxss_set_my_custom_theme’ ); } else { // leave the default theme active for visitors } The template and stylesheet filters are responsible to select the activated … Read full article →

WordPress hooks tutorial - WordPress hooks tutorial

WordPress hooks tutorial

WordPress hooks are a powerful feature that allows you to customize and extend the functionality of your WordPress website without modifying the core code. They are essentialy points in the WordPress code where you can add your own custom code or functions. There are two types of hooks in WordPress: actions and filters. Action hooks … Read full article →

create a new wp admin users - 5 Easy ways to Create a WordPress Admin user

5 Easy ways to Create a WordPress Admin user

Here are five different methods to create a new WordPress Admin user. In all of the examples below I will use the following username/password combination, so make sure to change it before running any of the commands: username123 change username123 with your username password123 change password123 with your password [email protected] change [email protected] with your email … Read full article →