Forum Replies Created

Viewing 15 replies - 16 through 30 (of 35 total)
  • Thread Starter outdoorsdev1

    (@outdoorsdev1)

    I very slightly changed that to be

    add_filter( 'baguettebox_enqueue_assets', function ($load) { return $load ?: is_singular(array('card', 'post' )); } );

    so it works for posts and card type posts.

    Still though, on card pages only the lightbox comes up, but not the image?

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    In testing, now on that page the assets to load to bring up the lightbox but not the image itself?

    https://pastebin.com/YGL67pQS

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Also found this

    https://github.com/WordPress/gutenberg/issues/18272

    this checks to see if a block is reusable, if I add this using code snippets would it be less resource intensive than your workaround?

    function has_reusable_block( $block_name, $id = false ){
        $id = (!$id) ? get_the_ID() : $id;
        if( $id ){
            if ( has_block( 'block', $id ) ){
                // Check reusable blocks
                $content = get_post_field( 'post_content', $id );
                $blocks = parse_blocks( $content );
    
                if ( ! is_array( $blocks ) || empty( $blocks ) ) {
                    return false;
                }
    
                foreach ( $blocks as $block ) {
                    if ( $block['blockName'] === 'core/block' && ! empty( $block['attrs']['ref'] ) ) {
                        if( has_block( $block_name, $block['attrs']['ref'] ) ){
                           return true;
                        }
                    }
                }
            }
        }
    
        return false;
    }
    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    This is again really helpful, thanks.

    As i’d probably be using this on most pages, is it possible to just call it on all blog or specific post types (i use a custom post type) instead of running a check?

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Thanks for pushing the update, that has fixed the issue with the single post and you were right that I hadn’t linked that image to its source. I appreciate the prompt reply and the plugin itself ??

    Yes, this image is in a reusable block which has a dynamic link to the image and also the source in a GB image block. They’re pulled from ACF data if that’s of any use.

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Sorry if I’m not being clear. I am requesting that in blocks that currently don’t have the caption under the image (like masonry, justified, or grid) that an option could be made to have the text underneath the image.

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Is it possible to have the caption underneath the images in the blocks that aren’t slider?

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Thanks Gijo, this still doesn’t fix the issue. Using GP premium. Have selected lazy loading, method is native + javascript for troubleshooting

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    No prob, he’s support for the main theme I pay for but no worries.

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Thanks for taking a look.

    I have no snippets that interfere, I’ve cleared cache every time and disabled any plugins that might interfere too.

    Please note this is with the WP Show Posts classes in the Dispatch theme https://gpsites.co/dispatch/

    I use a very similar set of Wp Show Posts boxes to display my front page so the classes for each are similar. What I refer to as Header is the Hero/header 4 posts top part.

    My issue is that without defining a width (and to be clear i’m just defining width, not height, because it’s more about cropping images than showing the full one), then the full image size loads – regardless of what I’ve put the image size class as.

    For example the css for your thumbnail example shows as

    <img src="https://elvin.wppluginsupport.net/wp-content/uploads/2021/01/543f795f-28f9-31c3-8984-d12888fe9e76-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="Test alt" loading="lazy" itemprop="image" srcset="https://elvin.wppluginsupport.net/wp-content/uploads/2021/01/543f795f-28f9-31c3-8984-d12888fe9e76-150x150.png 150w, https://elvin.wppluginsupport.net/wp-content/uploads/2021/01/543f795f-28f9-31c3-8984-d12888fe9e76-300x300.png 300w, https://elvin.wppluginsupport.net/wp-content/uploads/2021/01/543f795f-28f9-31c3-8984-d12888fe9e76-100x100.png 100w" sizes="(max-width: 150px) 100vw, 150px" width="150" height="150">

    assuming you’ve just defined the image class size as thumbnail and not put eight and width in manually.

    If I do the same with a class I have called “rta_thumb_no_cropped_800x” which is images 800px wide, no defined height, then the css comes out as follows for only the Header WP Show Posts section.

    <img src="https://staging.mysite.com/wp-content/uploads/2021/01/image.jpg" class="attachment-rta_thumb_no_cropped_800x size-rta_thumb_no_cropped_800x wp-post-image" alt="alt here" loading="lazy" title="title here" width="800" height="525">

    It’s loading the full original image size even though i’ve defined a specific size. This also happens if I select another image size like medium. The class name and width/height change to what they should be, but the full size image loads. Also, no srcset, i’m assuming you added that code that you’ve referred to in another post.

    Now if I keep the same image class but define the 800px width for the image for the Header section in WP Show Posts it gives this css : –

    <img src="https://staging.mysite.com/wp-content/uploads/2021/01/image-800x525.jpg" alt="alt text" class="center">

    A lot of changes there including missing image class, size, and title. But otherwise it loads the right image size and displays fine.

    Now here’s the next WPSP box down I have as being called Standard, like the Dispatch theme styles here https://gpsites.co/dispatch/using-wp-show-posts/

    This is with a defined image class size but no defined width/height

    <img src="https://staging.mysite.com/wp-content/uploads/2021/01/image.jpg" class="attachment-rta_thumb_no_cropped_400x size-rta_thumb_no_cropped_400x wp-post-image" alt="alt" loading="lazy" title="title" width="400" height="202">

    This again loads the full image size even though it should be loading the smaller one.

    If I add a width definition as 400px, this is the css for the first image of the set

    <img src="https://staging.mysite.com/wp-content/uploads/2021/01/image-400x202.jpg" alt="alt" class="center" title="Home 8">

    It loads the right image size but again, weird changes to class and no width/height stuff.

    For the second image along, it’s not displayed at all, this is the css

    <img src="" alt="alt" class="center" title="Home 9">

    Not there is a ::before with “box-sizing: inherit” right after the img html.

    This same issues with images not displaying occurs for most other boxes but not the Header or sidebar.

    [redacted]

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    This is using the new beta version available on the website where image sizes are selectable from the image sizes I’ve got, plus you can add height/width.

    I can try the suggestion but I think the beta was aiming to fix the issue of not being able to choose a size by having a specifically selectable one.

    • This reply was modified 4 years, 1 month ago by outdoorsdev1.
    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    This is a big issue for me and I was recommended by Tom to use the beta and change image sizes.

    Would really love a response when it’s possible or an indication it’s a known problem ??

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Hey, I’ve tested this and ticked the

    Disable the sharing buttons block

    button and it doesn’t seem to have helped. This problem seems only to apply to posts in draft.

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Thanks for the detailed reply!

    However – the aim of this is just a links box for people to go directly to my social media sites, not for sharing the site or article.

    It’s just to re-use the icons and styling and the would just be instagram.com/mysite, facebook.com/mysite e.t.c

    Thread Starter outdoorsdev1

    (@outdoorsdev1)

    Saw the update actually, looks good! I looked through the release notes and saw code changes but nothing referencing removal of jquery. You should add it and mention the new code size in the release/plugin notes, I know a lot of pagespeed obsessives like myself steer clear of anything with jquery.

    I run generatepress with dispatch and was hoping an update to this plugin and the theme would reduce loading times.

    Also posted something about resizing a while ago on the gp forums – hopefully this new update could help out with resizing too?
    https://generatepress.com/forums/topic/images-resized-in-css-not-html/

Viewing 15 replies - 16 through 30 (of 35 total)