Change default image size in blogpost

Mauer Themes Support Narrator Change default image size in blogpost

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3810
    DidieSchackman
    Participant

    I want to make the images within a blogpost the same size as the featured image. What CSS can I add in the editor to make this work?

    #3863
    Paul
    Keymaster

    Hi Didie,

    Yes, this is possible. However, there’s no way to do it properly with only CSS, you’d need to edit a bit of JS as well.

    It’s best to perform this in a child theme. Or you can just redo these changes after updating the theme.

    So, what you need to do is go to js/general.js file in the theme folder. And replace this line:

    $('.entry-full .mauer-narrator-pswp-gallery, .entry-full .mauer-narrator-wp-embed-wrapper').each(function(){

    with this one:

    $('.entry-full .mauer-narrator-pswp-gallery, .entry-full .mauer-narrator-wp-embed-wrapper, .entry-full .wp-block-image').each(function(){

    And this line:

    var sideMargin = (targetElement.width() - $('.gallery-width-reference').width()) / 4;

    with this one:

    var sideMargin = (targetElement.width() - $('.gallery-width-reference').width()) / 2;

    The end result should look like this: see screenshot.

    After that, please add the following CSS:

    .entry-full .wp-block-image {
    	max-width: none;
    }
    
    .entry-content .wp-block-image img {
    	width: 100%;
    }

    Regards,
    Paul

    #3872
    DidieSchackman
    Participant

    Thanks for your full support. This way I appreciate the theme even more.

    #3899
    Paul
    Keymaster

    You are very welcome, Didie!
    Thanks for using the theme.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.