Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1116847
    Damageplan
    Participant

    Hi 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
    Matthias

    #1116895
    Rupok
    Member

    Hi 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!

    #1116967
    Damageplan
    Participant

    Hi,

    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.jpg

    I’ve inserted your code, but I can see spacing on top and bottom, altough all my images are square.

    Cheers
    Matthias

    #1116982
    Damageplan
    Participant

    Edit:
    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…

    #1117054
    Christian
    Moderator

    Hey 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.

    #1117080
    Damageplan
    Participant

    Ok, no problem!
    Thanks for the link, seems a great side with some good resources 🙂

    #1117103
    Damageplan
    Participant

    Can 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

    #1117317
    Christian
    Moderator

    You can override the Recent Post shortcode which is located in plugins\cornerstone\includes\shortcodesrecent-posts.php in your child theme’s functions.php.

    The line you need to modify is

    $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'entry-cropped' );

    Change entry-cropped with 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.

  • <script> jQuery(function($){ $("#no-reply-1116847 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>