{"id":1135,"date":"2020-08-08T18:49:04","date_gmt":"2020-08-08T18:49:04","guid":{"rendered":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/?p=1135"},"modified":"2020-08-08T21:16:58","modified_gmt":"2020-08-08T21:16:58","slug":"how-to-create-masonry-grid-in-elementor","status":"publish","type":"post","link":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/2020\/08\/08\/how-to-create-masonry-grid-in-elementor\/","title":{"rendered":"How To Create Masonry Grid In Elementor"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">How to use masonry grid<\/h4>\n\n\n\n<p>You can use <strong>Section<\/strong> element as grid parent and <strong>Column<\/strong> element will be grid-item.<\/p>\n\n\n\n<p>Molla offers several pre-defined masonry grid layouts in Elementor.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"299\" height=\"847\" src=\"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-5.jpg\" alt=\"\" class=\"wp-image-1138\" srcset=\"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-5.jpg 299w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-5-106x300.jpg 106w\" sizes=\"(max-width: 299px) 100vw, 299px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"401\" src=\"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-6-1024x401.jpg\" alt=\"\" class=\"wp-image-1139\" srcset=\"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-6-1024x401.jpg 1024w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-6-300x118.jpg 300w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-6-768x301.jpg 768w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-6-600x235.jpg 600w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-6.jpg 1204w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<div class=\"notice-info\">NOTE:<br \/>Customizing grid item order is available. You can set this in column settings.<\/div>\n<div class=\"notice-error\">IMPORTANT NOTE:<br>\nYou are able to add grid items by adding <strong>columns<\/strong> to it based on presets. Each grid item&#8217;s width &amp; height can be set in added column settings.\n<\/div>\n<div class=\"notice-info\">NOTE:<br>Float grid is the layout configured as &#8216;float: left&#8217; css not use isotope plugin.<\/div>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">How to add custom layout<\/h4>\n\n\n\n<p>Molla offers 8 masonry layout presets and general masonry layout.<\/p>\n\n\n\n<p>We can add custom layouts using \u201c<strong>molla_creative_grid_options<\/strong>\u201d and \u201c<strong>molla_creative_grid_layout_type<\/strong>\u201d filters.<br>All default layouts are defined in&nbsp;<strong>molla_creative_grid_layout<\/strong> function in functions\/helper.php of <strong>Molla-Core<\/strong> plugin.<\/p>\n\n\n\n<p>Below code shows how to add 10th custom layout like following image using functions.php in child theme.<\/p>\n\n\n<div class=\"notice-info\">NOTE:<br>We suppose that new grid layout image is located in child themes\u2019 assets\/images\/grid-layout directory.<\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"765\" src=\"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-7-1024x765.jpg\" alt=\"\" class=\"wp-image-1155\" srcset=\"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-7-1024x765.jpg 1024w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-7-300x224.jpg 300w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-7-768x574.jpg 768w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-7-600x448.jpg 600w, https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-content\/uploads\/sites\/40\/2020\/08\/elementor-7.jpg 1090w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'molla_creative_grid_options', 'molla_child_custom_creative_grid_layout_names' );\nfunction molla_child_custom_creative_grid_layout_names( $layouts ) {\n    $layouts = array_merge(\n        $layouts,\n        '11' => array(\n            'title' => __( 'Grid 11', 'molla-core' ),\n            'image' => get_theme_file_uri( 'assets\/images\/grid-layout\/grid-11.jpg' ),\n            'width' => '1', \/\/ width in elementor radio-image control\n        )\n    );\n    return $layouts;\n}\n\nadd_filter( 'molla_creative_grid_layout_type', 'molla_child_custom_creative_grid_layouts', 10, 2 );\nfunction molla_child_custom_creative_grid_layouts( $layout_id ) {\n    if ( '11' == $layout_id ) {\n        return array(\n            array( 'w' => '1-2', 'h' => '1-2', 'w-l' => '3-4', 'w-m' => '1', 'size' => 'large' ),\n            array( 'w' => '1-4', 'h' => '1-4', 'w-l' => '1-4', 'w-m' => '1-2', 'w-s' => '1', 'size' => 'medium' ),\n            array( 'w' => '1-4', 'h' => '1-4', 'w-l' => '1-4', 'w-m' => '1-2', 'w-s' => '1', 'size' => 'medium' ),\n            array( 'w' => '1-2', 'h' => '1-2', 'w-l' => '1-2', 'w-m' => '1', 'size' => 'large' ),\n            array( 'w' => '1-2', 'h' => '1-4', 'w-l' => '1-2', 'w-m' => '1-2', 'w-s' => '1', 'size' => 'medium' ),\n        );\n    }\n}<\/code><\/pre>\n\n\n\n<p>&#8216;w-l&#8217;, &#8216;w-m&#8217; and &#8216;w-s&#8217;: responsive width of grid item<br>&#8216;1-2&#8217; means half and &#8216;1-3&#8217; means one third.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to use masonry grid You can use Section element as grid parent and Column element will be grid-item. Molla offers several pre-defined masonry grid layouts in Elementor. How to add custom layout Molla offers 8 masonry layout presets and general masonry layout. We can add custom layouts using \u201cmolla_creative_grid_options\u201d and \u201cmolla_creative_grid_layout_type\u201d filters.All default layouts [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,86],"tags":[],"featured_image_src":{"landsacpe":false,"list":false,"medium":false,"full":false},"categories_name":["12 - How tos \/ Guides","Elementor"],"author_name":"John Doe","comment_count":{"approved":0,"awaiting_moderation":0,"spam":0,"trash":0,"post-trashed":0,"all":0,"total_comments":0},"_links":{"self":[{"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/posts\/1135"}],"collection":[{"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/comments?post=1135"}],"version-history":[{"count":2,"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/posts\/1135\/revisions"}],"predecessor-version":[{"id":1197,"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/posts\/1135\/revisions\/1197"}],"wp:attachment":[{"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/media?parent=1135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/categories?post=1135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/molla\/documentation\/wp-json\/wp\/v2\/tags?post=1135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}