Automatically add featured image Alt Text from post title
The following code snippet will automatically generate Alt Text for all featured images from the Post Title. If you are looking for more settings, check the SEO Friendly Images plugin.
The following code snippet will automatically generate Alt Text for all featured images from the Post Title. If you are looking for more settings, check the SEO Friendly Images plugin.
WordPress has an HTML meta generation tag that shows that your website is running WordPress and which version exactly. If you right-click on this page and choose View Source, you can find this tag by searching for “generator” in the source code. You should see something similar to: <meta name=”generator” content=”WordPress 6.0.3″ /> This code … Read full article →
WordPress uses the wp_commentmeta and wp_comments tables to store comments and their data. To delete all comments in WordPress simply empty those tables in the database: To delete all spam comments use: To delete all unapproved comments use: NOTE: In the above commands change wp_ prefix with the table prefix that you are using *(view … Read full article →
On his blog Konstantin Shestopalov recently shared How to disable Cyrillic or Latin characters at checkout in Woocommerce with the following example to disable Latin characters on the checkout page: While the code does not actually disable Cyrillic characters, it simply checks if the letters are in Latin, and if not, prints an error message … Read full article →
Add the following to your theme functions.php file: Source: WordPress搜索功能结果只有一个时直接跳转到结果文章页面
This code snippet will create a new Filter option for WooCommerce: Availability that will allow users to sort products based on stock number. Add the code to your active theme functions.php or create a new Child theme first to make sure that your edits are not deleted after theme update.
This WordPress snippet will add an “edit page” link on the WordPress posts and pages. Only users who are logged in and have the necessary rights to edit that page will be able to see this link (administrator or author). Add the snippet to the theme page where you want the link to appear, for … Read full article →
wp-admin/plugins.php displays the plugins list table using the array $plugins_all which contains information on all installed plugins. We can use pre_current_active_plugins hook to perform actions before the plugin information is displayed on this page. TIP: The best way to understand what a hook does is to look at where it occurs in the source code. … Read full article →
WP_DEBUG option controls the reporting of some errors and warnings and enables use of the WP_DEBUG_DISPLAY and WP_DEBUG_LOG settings. In this quick tutorial I will show you how to enable the WP_DEBUG feature and output the results to a log file. Enable WP_DEBUG in wp-config.php Edit the wp-config.php file, find this line and change the value … Read full article →