Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1370756

    In my blog articles I use “Block Editor”.
    How can I do to ensure that the images using the “Image Full Width” block are displayed correctly, ie across the entire width of the screen?

    Example:
    Full-Width-Image

    Best regards
    Oriano

    • This topic was modified 2 years ago by orianos.
    #1370775

    Hey orianos,

    Are you using the default WordPress block editor to create your post? If so, then I guess you would have to find a full width block. We don’t provide support for that editor though, so it might be better if you post this question on a general WordPress support forum.

    Best regards,
    Rikard

    • This reply was modified 2 years ago by Rikard.
    • This reply was modified 2 years ago by Rikard.
    #1370793

    Hi Rikard, thanks for answer

    Are you using the default WordPress block editor to create your post? If

    Yes, I use WordPress block editor to edit this post (see image)

    We don’t provide support for that editor though, so it might be better if you post this question on a general WordPress support forum.

    well … it’s not nice of you (kriesi) not to consider compatibility with “WordPress block editor” … :(
    The Image Full Width block works correctly in almost all the themes I have used (both pro and free themes).
    Enfold is my main theme (I’m using 11 licenses), and it’s a big handicap that important Blocks, like “Full Image” on blog Post, don’t work properly.
    I can’t ask WordPress.org, to fix a problem that seems to me to be from Enfold :(

    I believe it is in Enfold’s interest to make this WordPress Block usable in Post.

    Best regards
    Oriano

    #1370811

    Hi,

    Thanks for the update. What settings do we need to set in order to reproduce the problem you are seeing on your end?

    Best regards,
    Rikard

    #1370830

    Hi Rikard

    Please watch this video.

    You will see how to add two images in a Post using the Block Editor.
    The first image with “None” allignement,
    the second image with “Full Width” allignement.

    Then if I view the page on Enfold, there is no difference between the two images :(
    If instead I view the Post with a WordPress default theme, you can see that the two images are exactly as I edited them in the Post:
    the first image is normal, the second is Full Width.

    I hope I have explained the problem :(

    Best regards
    Oriano

    #1370855

    Hi,

    Thanks for that, I’ll pass this info on to our developers.

    Best regards,
    Rikard

    #1370858

    Hi Rikard, thank you very much.

    Hope this ticket can remain open, awaiting the response from your developers.

    Best regards,
    Oriano

    #1370861

    Hi,

    Yes, we’ll keep you posted here once we have a solution for this problem.

    Best regards,
    Rikard

    #1370948

    Hey!

    The theme doesn’t support fullwidth image blocks by default but we can add a few modifications to adjust it, without editing the single.php template. You can start by adding this code in the functions.php file, which should dynamically adjust the height of the fullwidth image container on window resize.

    
    function ava_full_image_block_height()
    {?>
        <script>
    	(function($){
    		var win = $(window);
    
    		$(document).ready(function() {
    			win.trigger("debouncedresize");
    		});
    
    		win.on("debouncedresize", function(){
    			$('.wp-block-image.alignfull.size-large').each(function(){
    				var imgh = $(this).find('img').height();
    				$(this).height(imgh);
    			});
    		});
    	})(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'ava_full_image_block_height', 9999);

    Then add this css to adjust the width of the image and make it fullwidth.

    .wp-block-image.alignfull img, .wp-block-image.alignwide img {
        height: auto;
        width: 100vw;
        max-width: none;
        left: 50%;
        position: absolute;
        transform: translateX(-50%);
    }

    Let us know if this helps.

    Cheers!
    Ismael

    #1370992

    Hi Ismael, thank for help.

    I have installed your code on a demo site.
    1) On this post, the image is with Image Block “Full width”.
    2) On this post (a duplicate of the previous post), the image is with Image Block “None” allignement.
    As you can see, the full width image overlaps the content that follows.

    Best regards
    Oriano

    #1371003

    Hi!

    Thank you for the update.

    Looks like the script ava_full_image_block_height is not working in your installation. Did you add it in the functions.php file? Please look for this line..

    $('.wp-block-image.alignfull.size-large').each(function(){
    

    .., then replace it with:

    $('.wp-block-image.alignfull').each(function(){
    

    It should work now.

    Best regards,
    Ismael

    #1371020

    Hi Ismael

    your code for the “Block Image Full Wide” now seems to work correctly.
    Thank you.

    Can I also ask you for the code to be able to use the “Block Image Align Width” correctly?

    For the “Block Image AlignWidth” I inserted this css:

    /* Align Width Image */
    .wp-block-image.alignwide img, .wp-block-image.alignwide img {
        height: auto;
        width: 80vw;
        max-width: none;
        left: 50%;
        position: absolute;
        transform: translateX(-50%);
    }

    This changes the size of the image, but does not eliminate the overlap with the content that follows the image :(

    Please see this Post, where the first image is FullWidht, the second image is “Normal” and the third image is “AlignWidth”.

    PS: I believe that allowing proper use of the WordPress Block Editor in blog posts can be very useful for Enfold Theme.

    Best regards
    Oriano

    #1371543

    Hi,
    To have the image not covering the content below, change your css position: absolute; to position: relative;

    Best regards,
    Mike

    #1371546

    Hi Mike, thanks for your help.

    It seems to me that your code is working correctly 👍.
    Now we can use the “Block Image Full Wide” and “Block Image AlignWidth” on the blog post edit with WordPress block editor.

    Thanks Enfold, thanks to all the support staff. 👏

    Best regads
    Oriano

    #1371550

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘The "Image Full Width" block does not work correctly’ is closed to new replies.