Tagged: x
-
AuthorPosts
-
August 4, 2016 at 2:09 am #1116847
DamageplanParticipantHi there,
is it possible to show the images of the recent posts width same width and length?
When I set the padding-bottom to 100% the backgroundimage is getting bigger also and doesn’t stay centerd I think.My page URL: http://www.mkrecording.de/
Thanks
MatthiasAugust 4, 2016 at 2:49 am #1116895
RupokMemberHi there,
You can use this CSS to make them squared :
.x-recent-posts .x-recent-posts-img { padding-bottom: 90%; }Note that your images should be squared to get them centered. If you set the image width to 100% then you might see spacing on top and bottom if your images are not square. Let’s try this and see :
.x-recent-posts .x-recent-posts-img { padding-bottom: 90%; background-size: 100% auto!important; }Cheers!
August 4, 2016 at 4:15 am #1116967
DamageplanParticipantHi,
thanks for your reply.
My post images are all square, for example this one of the latest post:
http://www.mkrecording.de/wp-content/uploads/2016/07/Kotov-Syndrome-Logo.jpgI’ve inserted your code, but I can see spacing on top and bottom, altough all my images are square.
Cheers
MatthiasAugust 4, 2016 at 4:36 am #1116982
DamageplanParticipantEdit:
I’ve seen in the code, that the image got somehow cut:
<div class=”x-recent-posts-img” style=”background-image: url(http://www.mkrecording.de/wp-content/uploads/2016/07/Kotov-Syndrome-Logo-800×500.jpg);”></div>Why is this cut to 500px height? I havent’t done this and I cannot find this picture in my media gallery…
August 4, 2016 at 5:11 am #1117054
ChristianModeratorHey there,
That is X generated image size an the Recent Posts element uses that. Regretfully, there is no option to change this. It would require custom development to modify Cornerstone. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/
Thank you for understanding.
August 4, 2016 at 5:25 am #1117080
DamageplanParticipantOk, no problem!
Thanks for the link, seems a great side with some good resources 🙂August 4, 2016 at 5:46 am #1117103
DamageplanParticipantCan you give my some hints please?
I guess I have to do it in a child theme?
Which file is it I have to modify?I could test this in a test environment I have 🙂
Thanks
August 4, 2016 at 9:19 am #1117317
ChristianModeratorYou can override the Recent Post shortcode which is located in
plugins\cornerstone\includes\shortcodesrecent-posts.phpin your child theme’sfunctions.php.The line you need to modify is
$image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'entry-cropped' );Change
entry-croppedwith your own image size (see https://developer.wordpress.org/reference/functions/add_image_size/) or WordPress’ default (see https://developer.wordpress.org/reference/functions/the_post_thumbnail/).For detailed help or issues arising from modification, please seek assistance from a WordPress developer.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1116847 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
