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搜索功能结果只有一个时直接跳转到结果文章页面
The pipe ( | ) and tilde ( ~ ) separators are removed from Yoast SEO plugin 17.1. It was done because Google routinely alters these symbols in search results, according to Yoast: https://yoast.com/yoast-seo-17-1 To add these separators back to yoastSEO plugin, simply add the following inside your active theme function.php file: and under Search … Read full article →
There is no one WordPress theme in existence that can suit all websites. That is why there is a great variety of websites in existence in which, business owners, organizations, and bloggers can use. So, how do you go about choosing a WordPress theme that you will be certain that it will serve your business? … Read full article →
WordPress has many built-in functions that can help you debug. They can be activated by editing them in the wp-config.php file: 1. Enable debug mode By default Debug mode is disabled in WordPress, so you need to enable it by editing the wp-config.php file and changing the value from define( ‘WP_DEBUG’, false ); to define( … Read full article →
As you may have guessed from this site, I ❤️ LISTS. I pretty much have a list for anything WordPress-related: Here is another list that was once a draft page on this blog that I used to bookmark links to interesting blogs written by other WordPress enthusiasts and developers. The list is simply updated as … Read full article →
Recently I was migrating a website from GoDaddy shared hosting using WP-CLI and noticed the PHP version in cli was outdated. Here is how to install WP-CLI and set custom PHP version for the cli. Setup WP-CLI To download WP cli: To run it use php wp-cli.phar To make it easier to call We’ll rename … Read full article →
In this guide, I talked about adding WP-CLI to your system, but if you use cPanel with CloudLinux, you also need to include it in CageFS so that all users can access the wp command. First, download the WP-CLI command inside /usr/local/bin Add WP-CLI path to CageFS: and inside add: save the file, then update … Read full article →
Here is a simple WordPress plugin that will display your current Slack status: 🔴 Offline or 🟢 Online Note: To use the Slack API, you will need to create a Slack app and obtain an API token. You can find more information on how to do this in the Slack API documentation: https://api.slack.com/authentication/token-types#bot. Generate API … Read full article →
To display the total number of WooCommerce products, you can use the following code snippet: <?php $products = wc_get_products(array( ‘limit’ => -1 )); echo count($products); ?> This code uses the wc_get_products() function to retrieve all published products, with no limit on the number of products returned. The count() function is then used to count the … Read full article →
As of 2021, the vast majority of WordPress websites are using MySQL version 5.6 or higher because WordPress has required at least MySQL version 5.6 since version 4.4, released in 2015. Newer MySQL versions are not yet widely adopted, as some users may be using older hosting environments that do not support them, or they … Read full article →