Community Forums › Forums › Archived Forums › Design Tips and Tricks › Lead Photo Won't Center-Featured Post Widget
Tagged: featured post widget, images
- This topic has 4 replies, 2 voices, and was last updated 10 years, 2 months ago by
Tonya.
-
AuthorPosts
-
February 12, 2015 at 1:52 pm #140635
CherylMcL
MemberHi there.
http://essentialspeaking.com/find-your-voice
On this Lifestyle theme site for a client, there's a Featured Post on the Home page that pulls in the latest blog post. For the life of me, I can't get the lead image to center. Though it is centered in the blog post, it aligns left when it displays in the widget area and also on the RSS feed. Any suggestions would be greatly appreciated.
Site: http://essentialspeaking.com/find-your-voice
ThanksFebruary 12, 2015 at 3:08 pm #140643Tonya
MemberCentering can drive you crazy sometimes. LOL
What is happening is: there is specific styling in the stylesheet for the featured post that is overriding the aligncenter class on the image. You can see it on line 1293 of your style.css file:
.featuredpost img, .featuredpage img, .featuredpost .avatar, .featuredpage .avatar { background: #FFFFFF; margin: 0 5px 5px 5px; /* <- this is overriding the centering */ padding: 4px; border: 1px solid #DDDDDD; }
To center the image, margin left and right need to be set to auto and not 5px, i.e. margin: 0 auto 5px;
Cheers,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampFebruary 12, 2015 at 3:28 pm #140647CherylMcL
MemberThank you, Thank you! I haven't had that difficulty before with other StudioPress themes, and I couldn't figure out what was overriding it.
It worked. Thanks so much for your speedy reply. It really helped. Matter resolved.
Cheers,
CherylFebruary 12, 2015 at 3:33 pm #140651Tonya
MemberHi Cheryl,
Excellent. You're welcome 🙂
Enjoy your day,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampFebruary 12, 2015 at 3:41 pm #140653Tonya
MemberHey Cheryl,
A quick tip for you:
If you change your style.css file, make sure that you also uptick the child theme version number, as found in functions.php:define( 'CHILD_THEME_VERSION', '3.0.1' );
You want to do this to ensure that folks who have already visited your website get your latest changes. You see the browser caches the resources in history for each site that a person visits until they clear their browser's cache. WordPress appends the version number to the files to ensure that your visitors get the version you want them to see.
Another way to do changes without ever touching your child theme is to use a plugin, such as the one I have or JetPack.
Cheers,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer Bootcamp -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.