How to use Tailwind CSS in your Vue.js project

Install required dependencies and add config files To use Tailwind CSS, we need the framework itself, PostCSS, and Autoprefixer. The thing is that Vue.js uses an older PostCSS version (7) at the moment, so we have to install the compatible packages for Tailwind CSS which by default uses the latest 8 version. We can install them by… Continue reading How to use Tailwind CSS in your Vue.js project

How to check the current user role in WordPress?

To retrieve the current user’s role, use below codeif ( current_user_can( ‘manage_options’ ) ) { $user = wp_get_current_user(); if ( $user->ID ) { $roles = (array) $user->roles; $role = array_shift( $roles ); echo ‘Current User Role: ‘. translate_user_role( $wp_roles->roles[ $role ][‘name’] ) . ”; }}

Published
Categorized as Wordpress

How can you retrieve a list of all users from WordPress, excluding those with the ‘bbp_blocked’ role, and sort them alphabetically based on their display name?

To retrieve a list of all users from WordPress, excluding those with the ‘bbp_blocked’ role, and sort them alphabetically based on their display name, you can use the following PHP code: write the following code in the function.php Now, the get_all_users the function can be accessed at the following endpoint, http://yoursite.com/wp-json/custom/v1/get-all-users/

Published
Categorized as Wordpress

Disable background scrolling when the mobile menu is active on ios

Disabling background scrolling when a mobile menu is active on iOS can be achieved using the touch-action and -ms-touch-action CSS properties, which help control how touch input is handled by the browser. However, keep in mind that -ms-touch-action is a proprietary property and is specifically for Internet Explorer, not iOS. /* Disable touch events for… Continue reading Disable background scrolling when the mobile menu is active on ios

How to Add Google reCAPTCHA to the Magento 2 custom form?

Method to Add Google reCAPTCHA to Magento 2: Add script to any head or where you want to use google Recaptcha<script src=”https://www.google.com/recaptcha/api.js” type=”text/javascript” xml=”space”></script> Add captcha code to phtml or block/page where you want to add v2 google Recaptcha in the form If the captcha does not validate then add the below code: In any… Continue reading How to Add Google reCAPTCHA to the Magento 2 custom form?

Published
Categorized as Magento

How to disable “Did you mean” and related searches on search history in Magento 2

To disable “Did you mean” and related searches on search history in Magento 2, follow these steps: Go to Stores > Configuration > Catalog > Catalog Search. Under General Search Options, disable the following options: Enable Search Recommendations Enable Search Suggestions Click Save Config. Once you have disabled these options, “Did you mean” and related searches will no longer be displayed on the search… Continue reading How to disable “Did you mean” and related searches on search history in Magento 2

Published
Categorized as Magento

How to set the pagination limit in Magento 2?

Step 1. Log in to the Magento 2 admin panel. Step 2. Go to Content > Configuration and select the necessary Magento 2 theme that you want to customize. Step 3. Click edit and scroll to the Pagination section. Step 5. On the Pagination Frame setting line, set the limit for pagination. Step 6. Click the Save Configuration button.

Published
Categorized as Magento