Save
Saving
  • B
    bro

    Am hearing that Lightbox is not working on our live site on Internet Explorer. Is this a bug or is there just no support for IE/Lightbox/Lay Theme?

    Please advise.

    posted in Bug Reports read more
  • B
    bro

    Thanks, @f-albert . Will try your plugin suggestion at a later time.

    posted in Feedback read more
  • B
    bro

    Hello everyone,

    Thought I would share this here for future reference, and/or as feedback.

    I think I managed to add working SVG support to the Gridder, by following these steps:

    1. Add SVG Support plugin to your WP.

    This just makes sure you’re actually able to see the SVGs when you add them to your Media Library, as well as be able to add them as images in the Gridder.

    1. Add the solution offered by Laxmana on this page to your theme’s functions.php file (just copy paste his code to the bottom of your theme’s functions.php file).
    function svg_meta_data($data, $id){
    
        $attachment = get_post($id); // Filter makes sure that the post is an attachment
        $mime_type = $attachment->post_mime_type; // The attachment mime_type
    
        //If the attachment is an svg
    
        if($mime_type == 'image/svg+xml'){
    
            //If the svg metadata are empty or the width is empty or the height is empty
            //then get the attributes from xml.
    
            if(empty($data) || empty($data['width']) || empty($data['height'])){
    
                $xml = simplexml_load_file(wp_get_attachment_url($id));
                $attr = $xml->attributes();
                $viewbox = explode(' ', $attr->viewBox);
                $data['width'] = isset($attr->width) && preg_match('/\d+/', $attr->width, $value) ? (int) $value[0] : (count($viewbox) == 4 ? (int) $viewbox[2] : null);
                $data['height'] = isset($attr->height) && preg_match('/\d+/', $attr->height, $value) ? (int) $value[0] : (count($viewbox) == 4 ? (int) $viewbox[3] : null);
            }
    
        }
    
        return $data;
    
    }
    
    add_filter('wp_update_attachment_metadata', 'svg_meta_data', 10, 2);
    

    What this beautiful piece of code does, is make sure the dimensions of your SVGs are read when you upload your SVGs to the Media Library, and adds this to the file’s info.

    Lay Theme needs these dimensions to determine the aspect ratio of your images (regardless of their file type), which in turn is needed to correctly determine how much space these images are taking on your website.

    1. You can now upload your SVGs to your Media Library, and start adding them to the Gridder as images.

    Enjoy!

    @mariusjopen @arminunruh

    1. Could you please confirm this is a working solution, and that it doesn't break anything? I am by no means a coder…

    2. If this is a working solution, maybe you could consider adding this function to the theme?

    posted in Feedback read more
  • B
    bro

    I would love to have a px option instead of % for basically everything, and mostly for:
    • mobile spaces
    • column gutters
    • intro svg overlay margins
    • …

    To get px consistent responsive layouts.

    @mariusjopen @arminunruh
    Something to consider?

    posted in Feedback read more
  • B
    bro

    @mariusjopen

    Website is in maintenance mode still, so can't post the link. But yes, the workaround solves the problem.

    I’ll be sure to post you the link to the website when it goes online, for inspection.

    Best, Bas

    posted in Bug Reports read more
  • B
    bro

    @mariusjopen and anyone who might read this

    Managed to (temporarily?) work around this issue by adding to custom css for mobile version:

    body {padding-top: 0}
    -> deleting menu bar height value automatically set as padding-top on body

    #main-region {padding-top: [menu bar height value]}
    -> adding it to main region instead

    posted in Bug Reports read more