Center featured image

Posted in: Newspaper
Post count: 38

Hi!

I removed the sidebar from my articles and have the issue now, that featured images of my old posts are not wide enough anymore. I dont want to upload new photos for over 200 posts, it would be okay for me to show the smaller picture, but the theme shows the picture either left aligned (post style default, 1, 2) or it tries to show it bigger (styles 3,4,6,7). Is there a way to just show the orgiginal size of my image but center it?

Thanks,

Timo

Post count: 22421

Hello Timo,
Please try this custom css to center the images:

.td-post-template-default .td-post-featured-image img,
.td-post-template-1 .td-post-featured-image img,
.td-post-template-2 .td-post-featured-image img
{
margin-left: auto!important;
margin-right: auto!important;
}

This will work for the default, 1 and 2 templates.

Thanks.

Post count: 38

It works, thank you very much!

Post count: 38

It kind of belongs to my changes I did like we talked about above, thats why I keep on using this thread: I had the idea that it might look good, if the text in my posts is as wide as my featured images (745px wide). I imagine that might be possible?

(Btw: I really appreciate your fantastic support here, thank you!)

Post count: 22421

Hi,

I assume you want to reduce the text are size as without a sidebar, the text are has a width of 1068px
Please provide a link to your website to I can inspect it and create the css directly.

Thank you!

Post count: 38

Hi,

thats correct. You can find my site here: http://www.bruderleichtfuss.com

As I haven’t figuered out how to make it look good without the sidebar its still there now. Let me know if you need more information!

Thank you!

Post count: 22421

Hi,
I will need a link to a post without sidebars though. I could not find any posts without sidebars on your website. I will need one to work with.
Thank you!

Post count: 38
Post count: 22421

Hi,
The best way to do it is add all of your post content inside a div element like so: http://screencast.com/t/lPLcAJy7y then use the class assigned to it with css like so:
.mycontent{
width:745px;
margin-left:auto;
margin-right:auto;
}

Result: http://screencast.com/t/fbfbPNIW
Thanks.

Post count: 38

Thank you guys so much!

Post count: 38

That was too easy – this way it does not work on mobile. I think, because it doesnt adjust the content to the width of the mobile screen anymore (See: https://www.dropbox.com/s/apgnn1jt1nbelnk/Screenshot_2016-03-11-14-31-38.png?dl=0)

Any ideas? Is it possible to put the width in percentage into the css?

Thank you!

Post count: 22421

Hi,
You need to adapt the css for responsiveness, yes. You can set the width in % or you can assign a different width for different viewports using @media or the advanced css boxes here: http://screencast.com/t/FIh6a3XY
Thanks.

Viewing 12 posts - 1 through 12 (of 12 total)
The forum ‘Newspaper’ is closed to new topics and replies.