Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2015-11-21 02:08:11

PhilippeH
Member
From: Paris, France
Registered: 2014-04-11
Posts: 167

Image on the front

Hello everyone,

Does anybody know, how to do to put an image on the front in an article, which is smaller than the original image size download WordPress.

In advance thank you to you.

Best regards.

Philippe

Offline

#2 2015-11-21 02:23:09

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 13,537
Website

Re: Image on the front

Do you mean in the blog post itself or the Featured Image that can appear before a blog expert on the Blog page?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 1.1.1 test site, Pangolin test site

Offline

#3 2015-11-21 02:39:48

PhilippeH
Member
From: Paris, France
Registered: 2014-04-11
Posts: 167

Re: Image on the front

Good evening,

Thank you to you for your answer, I just found it was necessary to change the image size in functions.php

if (!isset($content_width)){
    $content_width = 450;

Good evening.

Regards,

Philippe

Offline

#4 2015-11-21 03:09:53

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 13,537
Website

Re: Image on the front

Hmm. That doesn't seem right. But if it's working for you...

Just remember that if you change your theme, export, and upload again, then those changes will be wiped out (unless you're doing this with a child theme.)

I'm assuming you were talking about the Featured Image that appears on the Blog page, since individual images in posts can be set at a variety of sizes.

If so, there may be an easier way of doing this via custom css

This appears to work. Adjust size to your liking using percentage or a specific pixel width

.post_thumbnail {
    width: 50%;
}

or

.post_thumbnail {
    width: 400px;
}

You could either add this to the styles.css file in the theme (which will get overwritten by any update unless you're using a child theme) or, if you're already using phplugins you could add it to the custom.css file. Or you can get the Custom CSS WordPress plugin and add it that way.

or you could control the featured image size in a child theme's functions.php file as outlined here:
https://slocumthemes.com/2014/05/adjust … wordpress/


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 1.1.1 test site, Pangolin test site

Offline

#5 2015-11-24 22:46:00

PhilippeH
Member
From: Paris, France
Registered: 2014-04-11
Posts: 167

Re: Image on the front

Hello,

Thank you for all that information, it helped me a lot.

Yes it worked for me, but I still handed the file as it was originally.

I added the code in my custom.css .post_thumbnail and it works flawlessly.

Good evening.

Regards,

Philippe

Offline

#6 2015-11-25 14:12:29

Matthew
Administrator
From: Seoul, South Korea
Registered: 2012-09-24
Posts: 5,085
Website

Re: Image on the front

Yeah, you shouldn't be messing with the $content_width value in functions.php. Various WordPress functions depend on it, and it's something that isn't meant to be user-configurable.


Campagna Pictures, http://campagnapictures.com
The Turning Gate, http://theturninggate.net

Offline

Board footer

Powered by FluxBB