Change the recommended image size in word press

The update date is March 10, 2017. The recommended images will be used in many ways in word press according to the theme used. Most topics typically use the recommended image as a thumbnail preview of one of the images of the post or page displayed on the home page and archive page. This feature was introduced in WordPress 2.9 and was originally considered \
The person who created the WordPress site is very important. The site contains not only recommended images, but also original images and a large number of images. To use recommended images in all graph paper press topics, simply select the recommended image from the link on the right side of the post editor screen. It’s good if the default recommended image size set in the theme suits your purpose. Otherwise, you can change the size by editing a little code. What is the reason for changing the recommended image size? In addition to making the thumbnail gallery larger or smaller, you can also change the aspect ratio of the size. For example, suppose you are a landscape photographer and your product portfolio consists of panoramic photos. In this case, if the default recommended image for the theme is a square, most of the images will be cropped. You can manually adjust the size to a more appropriate size to solve this problem.
functions. In PHP functions, the default image size is changed. Some code must be changed in the PHP file. The file can be accessed via FTP or edited directly in the shape > editor of the word press dashboard. I always recommend the former method more than the latter. It is recommended that you always back up the original version before changing the file to prevent problems. If you don’t have the original theme file on your computer, you can at least use the function. You must the PHP file and save it to the backup folder.
There are two ways to resize the recommended image. To resize proportionally (that is, without increasing or compressing the image), use the following code: set_post_thumbnail_size( 50, 50 ); \/\/ You can also use the code in the width 50 pixels, depth 50 pixels and zoom mode to cut the image and adjust the image size. set_post_thumbnail_size( 50, 50, true ); \/\/ Sets the default size of the recommended image for landscape 50 pixels, portrait 50 pixels, and clipping mode. Adding image sizes can also add additional lines of code for each image size and additional image sizes as needed.
Add_image_size (\
This feature is useful if you want to display recommended images in multiple ways. For example, you can set the thumbnail size of the image library and set the size of the post title to be larger. The uploaded image must be at least larger than the size set for the recommended image. Uploading smaller images will increase the size and eventually make the image pixelated and blurred.
Rebuild the recommended image. Changing the size of the recommended image only affects the upload after the code change. All previous uploads are saved in their original size and must be recreated. If there are few images that need to be resized, you can upload them again manually. If there are multiple plug-ins, it is best to use plug-ins such as generate thumbnail to perform all heavy tasks. The plug-in is accessed through the tools menu
You can resize one or more images on the selected media set. Subtopic, with future oriented editing function. The problem with editing PHP files directly is that if a new version of the theme needs to be released and upgraded, it will be lost. Record the added code and create a new function. Although you can insert PHP files, this can be boring, especially if you edit too much or often see new versions of the theme.
The subtopic solves this problem because the subtopic will remain unchanged when the parent theme is updated. functions. If you edit theme code in a PHP file, style sheet, or other file, it’s a good idea to always use subtopics. We already have a complete guide to creating sub themes in our blog, but for our purposes, we need to know something. To create a sub theme, connect to the site via FTP and create a new folder for the new sub theme in \/ WP content \/ themes \/. Usually, the specified folder name is the same as the theme to be edited, and \
Even if you don’t want to edit CSS, you must create style sheets in the subtopics folder. style. Create a new file named CSS and paste the following code\/*
Topic name: handsome children
Subject URI: http:\/\/example.com\/awesome-child\/
Description: wonderful children’s theme
Introduction to the author
Author URI: http:\/\/example.com
Template: very
Version: 1.0.0
Label: bright, dark, reactive layout, auxiliary functions
Text field: awesome child
*\/
@import url(\
\/**=Theme customization starts here.
Change the subject name and other details as appropriate.
To add the ability to change the recommended image to a sub theme, use the new function. Since you need to create a PHP file, continue with this operation in the subtopics directory. This file is a function of the parent theme. Will be loaded with PHP. functions. The template of PHP is as follows: Male \/ \/ PHP closes the tag, and then adds the image scaling code between the PHP tags, as shown below: The \/ \/ PHP tag must be activated after the code generation of the sub topic is completed. You can do this through the site dashboard under administration panel > shapes > themes. Locate the child topic in the list and click activate.
Appreciate the resized new recommended image. Changing the size of the recommended image and adding a new image size is a very simple task, but it requires some code editing. There is always a risk that users like to use other plug-ins to process images. Going inside and making a few changes to the code actually helps to cultivate confidence in using WordPress. It will be easier to customize the theme and make it your own.

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *