If there is only one search result, skip the results page and jump directly to the content 🔧
Add the following to your theme functions.php file: Source: WordPress搜索功能结果只有一个时直接跳转到结果文章页面
Add the following to your theme functions.php file: Source: WordPress搜索功能结果只有一个时直接跳转到结果文章页面
Here is a small snippet that you can add to your functions.php file to show different menus to logged-in users in WordPress. In this example 5 is the menu ID of the menu shown to logged-in users and 6 is the ID for the menu shown to guests. So, create two menus and copy their … Read full article →
A locale is the translation language code used in WordPress that usually consists of a combination of language code and country code, combined with an underscore, for example en_AU or en_GB. Here is a complete and UPDATED List of All WordPress Language Locales 🏳️🌈 This page displays the market share (in %) for each locale (Language code) that WordPress websites are … Read full article →
Here are 4 different methods to fix the scary-looking error: “WordPress database error Table ‘./db/wp_options’ is marked as crashed and should be repaired”. NOTE: It is critically important that you backup your database before performing any of the following suggestions. You’re fully responsible for undertaking this yourself, I can’t be held responsible if you break … Read full article →
This is the official WordPress Color Palette. Since WordPress 5.7 Themes and Plugin developers are encouraged to use this new color palette, for better consistency between their products and WordPress Core. Plugin authors that use the existing CSS Core classes should be all set up with the new color palette, as every Core class was updated accordingly. … Read full article →
Deleting all inactive WordPress themes and plugins from your website is a recommended security practice. Even when deactivated, old, insecure plugins and themes might still pose a threat to the security of your WordPress website. Here are oneliners to remove inactive themes and plugins from your WordPress website using WP-CLI. List all inactive WordPress themes: Delete … Read full article →
This is another neat feature that I needed but didn’t really want to use another plugin to accomplish it. To display user roles inside WordPress comments like on the image above ? use the following code snippet:
The ‘Remember Me’ option is a checkbox on the WordPress login screen that lets your users save their username and password. If checked, WordPress will remember the login session for 14 days. If you want to disable the Remember Me option in WordPress, here is how to do it: 1. Hide the option using CSS … Read full article →
The .htaccess file is a configuration file that is used by the Apache web server to control various aspects of how the server functions. In WordPress, the .htaccess file is used to control various settings related to the permalinks of your website, as well as to protect your website from various types of attacks. The … Read full article →
WordPress.org has a list that explains the default and most commonly used wp-config.php constants. But there are many more constants that are not covered in this guide and can only be found when browsing the WordPress core itself. Here I will do my best to list all WordPress constants, and keep the list up to … Read full article →