Tagged: x
-
AuthorPosts
-
August 17, 2016 at 4:05 pm #1135777
EricParticipantHey I’m trying to resize/center my featured image for all blog posts (via CSS), but I can’t seem to figure it out.
I tried a few combinations, one of which was this:
.single-post .entry-featured {
display: block;
width: 90%;
margin: 0 auto;
}And it got me close, however my image was never perfectly aligned (see screenshot 2). In terms of size, I’d like to make the width the same as the column width of my text (see screenshot 1), which was achieved by manually inserting the image into my post via cornerstone.
So if you have any idea on how to do this, please let me know.
Also, just to be thorough, here’s the code that I added to my funtions.php file, which is what I used to drop the featured image below the blog post title:
function my_custom_footer_output() {
if (is_single($post)) : ?>
<script type=”text/javascript”>
jQuery( document ).ready(function($) {
$(“.post .entry-header”).insertBefore(“.post .entry-thumb”);
$(“.post .entry-header” ).addClass( “mvl” );
});
</script>
<?php endif; }
add_action( ‘wp_footer’, ‘my_custom_footer_output’, 30 ); ?>Thanks in advance!
August 17, 2016 at 4:07 pm #1135785
EricParticipantThis reply has been marked as private.August 17, 2016 at 10:42 pm #1136194
FriechModeratorHi There,
Thanks for writing in! You can add this under Custom > CSS in the Customizer.
.single-post .x-main.left .hentry .entry-featured { padding-left: 6%; padding-right: 6%; }Hope it helps, Cheers!
August 17, 2016 at 11:23 pm #1136235
EricParticipantHey I tried that code but it didn’t help with the alignment. It’s still slightly off-centered as you can see in screenshot 1. Any other ideas?
August 18, 2016 at 3:01 am #1136427
RadModeratorHi there,
It’s because of this CSS,
.entry-thumb{width:95%;}You have your featured image at 90%, then another 95% on the thumbnail. Hence 95% of 90% makes it smaller and not centered. Please remove that CSS.
Thanks!
August 18, 2016 at 9:38 am #1136874
EricParticipantWorked perfectly! Thanks a lot
August 18, 2016 at 10:49 am #1136998
LelyModeratorYou’re welcome Eric!
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1135777 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
