When using https, WordPress doesn’t use https for CSS and JavaScript, and admin doesn’t work. How do I fix this?

Check two things: in the wp-options table, the site URLs (in two places) should be the full URL, as in https://www.example.com . check the site’s htaccess file for proper rewrite of http to https. For a htaccess rule, this one works in most case: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Then look … Read more

Select a Text for CSS

Start by creating a stylesheet for your plugin.Then you can use the do_action(‘admin_enqueue_scripts’) to enqueue it in the controlpanel only, avoiding it to be loaded in the frontend. You could do something like this: function my_plugin_admin_styles() { wp_enqueue_style(‘my-plugin-admin-style’, plugin_dir_url(__FILE__) . ‘assets/css/admin-style.css’, array(), ‘1.0.0’, ‘all’); } add_action(‘admin_enqueue_scripts’, ‘my_plugin_admin_styles’); Just make sure to correct the path for … Read more

How can I catch WordPress custom settings page slug has already changed?

you can use the admin_init hook along with the add_query_arg() function to modify the redirection URL for handle the situation. Redirect users to the correct URL admin.php?page=management if they access the settings page with an unexpected slug. Modify the redirection URL after settings have been updated to include the current page slug management, ensuring that … Read more

/wp-admin/admin-ajax.php Error 500 while using divi premade layout in existing pages

Increase the memory_limit in the wp-config.php by adding: define(‘WP_MEMORY_LIMIT’, ‘256M’); Or, go to your wp-config.php file in your root directory, Change this line: define(‘WP_DEBUG’, false); to; define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, false); this will log any errors you’re having with additional information in wp-content/debug.log file. From your comment, it seems a process or theme/plugin is … Read more

Can I get the role of the currentUser in modern WordPress React?

You can achieve this with the help of useSelect hook and select(‘core’).getCurrentUser() here is the sample component for you. import { useSelect } from ‘@wordpress/data’; const CurrentUserComponent = () => { const { currentUser } = useSelect((select) => ({ currentUser: select(‘core’).getCurrentUser(), }), []); // Here we are checking if currentUser is available or not. if … Read more

tech