1/12/2023 0 Comments Codebox odd even background![]() ![]() We've put together a detailed tutorial on how to stop WordPress compressing JPG images, which shows you how to disable the built-in image compression feature with the functions file or a separate plugin. If these images are further compressed with an image optimisation plugin like ShortPixel or WP Smush, the drop in image quality often results in blurry, pixelated images. ![]() Many people don't realise that WordPress automatically compresses uploaded JPG images by up to 90%. Add alt text to Gravatar imagesįunction megademic_gravatar_alt( $text ) Disable WordPress' image compression feature Simply copy and paste it into your theme's functions file, and the alt text "Gravatar for " will be automagically added to author Gravatars. Well-optimised images typically appear higher in image search results, potentially bringing more organic traffic to a site.įor some inexplicable reason, WordPress doesn't include default alt text when it grabs an author image from the Gravatar server. The primary purpose of image alt text is to describe images to people who can't see them, but it can also directly benefit a site's SEO as well. Now you know how to edit the functions file, let's get pimping your website with these useful code snippets for your WordPress functions file! Add alt text to Gravatar imagesĪnyone who knows anything about search engine optimisation (SEO) will tell you that adding descriptive alt text to your images is a low-hanging fruit that's relatively quick and easy to fix. It's also a very good idea to make a backup of your site before editing your theme, just in case something goes wrong and you need to roll back your changes. If you're going to make extensive modifications to yours, I strongly advise you to set up a child theme so your changes don't disappear when you update your theme. Upload the WordPress functions file Child themes and backupsĮach WordPress theme comes with its own functions.php file. Depending on your FTP client preferences, you may have to confirm that you want to overwrite the file that's on your server. Browse to your WordPress theme folder (where the functions.php file is located), right-click the functions file that's on your computer (that you've just edited) and click "Upload". Once you've made your changes, save the functions file and then open up your FTP client again. Then open the file in your favourite code editor (I use Sublime Text, but Visual Studio Code and Atom are also great choices) and add any of the awesome snippets below.Ħ. ![]() Next, right-click your theme's functions.php file and click "Download" to download it to your computer. Typically this is public_html/wp-content/themes//. Once you've logged into your site, use your FTP client to navigate to your theme folder. After you've entered your details, click the "Quick connect" button. Check with your web host if you're not sure what to enter in these fields. Open your FTP client (for the purpose of this quick tutorial I'll be using FileZilla) and enter your FTP host, username, password and port number. See also: How to Change the Width of the Gutenberg Editor Editing the functions fileġ. To get you started, I've put together a quick step-by-step guide to editing this important core file. Want to change the WordPress admin footer text? Want to disable post revisions? Need to exclude certain blog post categories from appearing in your search results? You can do all of that by simply copying and pasting a code snippet into your functions.php file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |