-
-
I’m uploading a square image (500×500) as featured staff image. When I add a “Single Staff” element to my page, the image URL changes its proportion.
Example:Original URL: https://i2.wp.com/mangostormplay.com/wp-content/uploads/me.png
cropped URL: https://i2.wp.com/mangostormplay.com/wp-content/uploads/me.png?resize=400%2C270
How do I stop the system to add the resize bit to the url?
Thanks
-
This is the live version: https://mangostormplay.com/about-us/
-
Hello,
You have to edit the image sizes from your functions.php file.
Please go to this file and find this function:function codeless_images_sizes(){
Here are set all featured images sizes. When you upload an image, based on where it will be used, the image will be automatically cropped.
The line you need to edit, for the staff featured image, is this one:add_image_size( 'staff', 400, 270, true );
Change the sizes to your need. Save file and re-upload the images.
Or run a thumbnail recreation plugin.Best regards!
-
Thanks! This seems to be the solution, but I’m having trouble adding the functions.php file to the child theme. I’ve tried the 3 methos explained on this website ( https://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623 ) but after I upload it the website stops responding.
Do you have any tutorial on how I can add this function to my child theme?Thanks
-
Hello,
We do not have yet a tutorial for child themes, as they are optional to users.
Please refer to this article: https://codex.wordpress.org/Child_Themes. You may find this topic: https://stackoverflow.com/questions/19039492/override-a-function-with-child-themes-functions-php , useful too.Best regards!
-
Hi-
I am having the same issue. I have images which are set at 200 px wide x 250 px tall. I want them that size on the page. I changed the code above to the dimensions that I wanted but the images are now just stretching to fit the column width. How can I turn off the stretching of the images?
-
Hello,
Please upload images of a bigger size. They may be too small for the new size proportions.
Let us know.Best regards!
-
-
Hello,
Please add these lines into your custom css box, for the staff image sizes:
.single_staff .featured_img { width: 200px; height: 250px; }
To display more text in description, go to file vc_templates\staff.php and find this line:
$output .= '<p>'.codeless_text_limit(get_the_excerpt(), 25).'</p>';
edit the 25 value to your need. The more you increase it, the more words it will display.Best regards!
-
You must be logged in to reply to this topic.