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 →
Here is a snippet that allows you to set a custom image on the WordPress login page and set a custom link: Replace https://your-domain.com/wp-content/uploads/2023/custom-logo.png with your logo https://your-domain.com with your link
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.
Here is a handy snippet that displays a random post, so each time a user refreshes the page a different post will appear. The snippet should be saved as a PHP template for pages and a page has to use it. Step 1. Create a new file random.php inside your active theme folder and put … 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 →
Figuring out templates that are being used while you are building and developing a custom WordPress website can be problematic. Using the following snippets you can quickly and easily display template name or full path to the file in your wp-admin bar. Display Template name To display just template name add the following to functions.php … Read full article →
In this guide I will be adding a scroll percentage to a WordPress page. For a working demo please check this page. Step 1. Add HTML code First step is to add the HTML code that will display the scroll percentage number inside the page or theme header. in this example I’m adding it to … 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 →