| 1 |
<?php |
| 2 |
/** |
| 3 |
* Register Custom Block Styles |
| 4 |
*/ |
| 5 |
|
| 6 |
function PatternsWPHero_patterns_register_block_patterns() { |
| 7 |
if ( function_exists( 'register_block_pattern' ) ) { |
| 8 |
/** |
| 9 |
* Add your block patterns below |
| 10 |
*/ |
| 11 |
|
| 12 |
/* |
| 13 |
register_block_pattern( |
| 14 |
'PatternsWPHero-gutenberg-block-patterns/TITLE-OF-YOUR-BLOCK-PATTERN', # Add Hyphens between lowercase words |
| 15 |
array( |
| 16 |
'title' => __( 'TITLE_OF_YOUR_BLOCK_PATTERN', 'PatternsWPHero-gutenberg-block-patterns' ), |
| 17 |
'content' => "BLOCK_PATTERN_GOES_HERE", |
| 18 |
'categories' => array("CATEGORY"), # eg: columns, text ..etc |
| 19 |
) |
| 20 |
); |
| 21 |
*/ |
| 22 |
|
| 23 |
register_block_pattern( |
| 24 |
'PatternsWPHero-gutenberg-block-patterns/hero-one', |
| 25 |
array( |
| 26 |
'title' => __( 'Hero section with right side image', 'PatternsWPHero-gutenberg-block-patterns' ), |
| 27 |
'content' => "<!-- wp:group {\"align\":\"wide\",\"style\":{\"spacing\":{\"padding\":{\"top\":\"64px\",\"right\":\"16px\",\"bottom\":\"64px\",\"left\":\"16px\"},\"blockGap\":\"0\"}},\"backgroundColor\":\"base\",\"layout\":{\"type\":\"constrained\",\"contentSize\":\"1280px\",\"wideSize\":\"1280px\"}} -->\r\n<div class=\"wp-block-group alignwide has-base-background-color has-background\" style=\"padding-top:64px;padding-right:16px;padding-bottom:64px;padding-left:16px\"><!-- wp:columns {\"verticalAlignment\":\"center\",\"style\":{\"spacing\":{\"blockGap\":{\"top\":\"84px\",\"left\":\"84px\"},\"padding\":{\"top\":\"0\",\"right\":\"0\",\"bottom\":\"0\",\"left\":\"0\"},\"margin\":{\"top\":\"0\",\"bottom\":\"0\"}}}} -->\r\n<div class=\"wp-block-columns are-vertically-aligned-center\" style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\"><!-- wp:column {\"verticalAlignment\":\"center\",\"style\":{\"spacing\":{\"padding\":{\"top\":\"0\",\"right\":\"0\",\"bottom\":\"0\",\"left\":\"0\"}}},\"layout\":{\"type\":\"constrained\"}} -->\r\n<div class=\"wp-block-column is-vertically-aligned-center\" style=\"padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\"><!-- wp:heading {\"textAlign\":\"left\",\"level\":1,\"style\":{\"typography\":{\"fontStyle\":\"normal\",\"fontWeight\":\"700\",\"fontSize\":\"60px\"}},\"textColor\":\"black\",\"className\":\"wp-block-heading\"} -->\r\n<h1 class=\"has-text-align-left wp-block-heading has-black-color has-text-color\" style=\"font-size:60px;font-style:normal;font-weight:700\">Build and Scale With Confidence</h1>\r\n<!-- /wp:heading -->\r\n\r\n<!-- wp:paragraph {\"align\":\"left\",\"style\":{\"typography\":{\"fontStyle\":\"normal\",\"fontWeight\":\"300\",\"fontSize\":\"20px\"},\"color\":{\"text\":\"#555555\"}}} -->\r\n<p class=\"has-text-align-left has-text-color\" style=\"color:#555555;font-size:20px;font-style:normal;font-weight:300\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vehicula, diam nec congue.</p>\r\n<!-- /wp:paragraph -->\r\n\r\n<!-- wp:buttons {\"layout\":{\"type\":\"flex\",\"justifyContent\":\"left\"},\"style\":{\"spacing\":{\"blockGap\":\"var:preset|spacing|30\"}}} -->\r\n<div class=\"wp-block-buttons\"><!-- wp:button {\"backgroundColor\":\"black\",\"textColor\":\"white\",\"style\":{\"border\":{\"radius\":\"7px\"}}} -->\r\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-white-color has-black-background-color has-text-color has-background wp-element-button\" style=\"border-radius:7px\"><strong>Get Started for Free</strong></a></div>\r\n<!-- /wp:button -->\r\n\r\n<!-- wp:button {\"style\":{\"border\":{\"radius\":\"7px\"}},\"className\":\"is-style-outline\"} -->\r\n<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link wp-element-button\" style=\"border-radius:7px\"><strong>Explore It</strong></a></div>\r\n<!-- /wp:button --></div>\r\n<!-- /wp:buttons -->\r\n\r\n<!-- wp:paragraph {\"align\":\"left\",\"style\":{\"typography\":{\"fontStyle\":\"normal\",\"fontWeight\":\"300\",\"fontSize\":\"14px\"},\"color\":{\"text\":\"#555555\"}}} -->\r\n<p class=\"has-text-align-left has-text-color\" style=\"color:#555555;font-size:14px;font-style:normal;font-weight:300\"><strong>1,450+</strong> Reviews | <strong>No Credit Card</strong> Required</p>\r\n<!-- /wp:paragraph --></div>\r\n<!-- /wp:column -->\r\n\r\n<!-- wp:column {\"style\":{\"spacing\":{\"padding\":{\"top\":\"0\",\"right\":\"0\",\"bottom\":\"0\",\"left\":\"0\"}}},\"layout\":{\"type\":\"default\"}} -->\r\n<div class=\"wp-block-column\" style=\"padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\"><!-- wp:image {\"align\":\"center\",\"id\":24,\"width\":540,\"height\":392,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\r\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img src=\"https://nce-studio-muki.instawp.xyz/wp-content/uploads/2023/03/Image.svg\" alt=\"\" class=\"wp-image-24\" width=\"540\" height=\"392\"/></figure>\r\n<!-- /wp:image --></div>\r\n<!-- /wp:column --></div>\r\n<!-- /wp:columns --></div>\r\n<!-- /wp:group -->", |
| 28 |
'categories' => array("patternswp-hero"), |
| 29 |
) |
| 30 |
); |
| 31 |
|
| 32 |
register_block_pattern( |
| 33 |
'PatternsWPHero-gutenberg-block-patterns/hero-two', |
| 34 |
array( |
| 35 |
'title' => __( 'Hero section with center alignment', 'PatternsWPHero-gutenberg-block-patterns' ), |
| 36 |
'content' => "<!-- wp:group {\"align\":\"full\",\"style\":{\"spacing\":{\"padding\":{\"top\":\"64px\",\"right\":\"20px\",\"bottom\":\"64px\",\"left\":\"20px\"},\"blockGap\":\"0\"}},\"backgroundColor\":\"base\",\"layout\":{\"type\":\"constrained\",\"contentSize\":\"1280px\",\"wideSize\":\"1440px\",\"justifyContent\":\"center\"}} -->\r\n<div class=\"wp-block-group alignfull has-base-background-color has-background\" style=\"padding-top:64px;padding-right:20px;padding-bottom:64px;padding-left:20px\"><!-- wp:columns {\"verticalAlignment\":\"center\",\"style\":{\"spacing\":{\"blockGap\":{\"top\":\"var:preset|spacing|60\",\"left\":\"var:preset|spacing|60\"},\"padding\":{\"top\":\"0\",\"right\":\"0\",\"bottom\":\"0\",\"left\":\"0\"},\"margin\":{\"top\":\"0\",\"bottom\":\"0\"}}}} -->\r\n<div class=\"wp-block-columns are-vertically-aligned-center\" style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\"><!-- wp:column {\"verticalAlignment\":\"center\",\"style\":{\"spacing\":{\"padding\":{\"top\":\"0\",\"right\":\"0\",\"bottom\":\"0\",\"left\":\"0\"}}},\"layout\":{\"type\":\"constrained\",\"contentSize\":\"700px\"}} -->\r\n<div class=\"wp-block-column is-vertically-aligned-center\" style=\"padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\"><!-- wp:heading {\"textAlign\":\"center\",\"level\":1,\"style\":{\"typography\":{\"fontStyle\":\"normal\",\"fontWeight\":\"700\",\"fontSize\":\"60px\"}},\"textColor\":\"black\",\"className\":\"wp-block-heading\"} -->\r\n<h1 class=\"has-text-align-center wp-block-heading has-black-color has-text-color\" style=\"font-size:60px;font-style:normal;font-weight:700\">Build and Scale With Confidence.</h1>\r\n<!-- /wp:heading -->\r\n\r\n<!-- wp:paragraph {\"align\":\"center\",\"style\":{\"typography\":{\"fontStyle\":\"normal\",\"fontWeight\":\"300\",\"fontSize\":\"20px\"},\"color\":{\"text\":\"#555555\"}}} -->\r\n<p class=\"has-text-align-center has-text-color\" style=\"color:#555555;font-size:20px;font-style:normal;font-weight:300\">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae.</p>\r\n<!-- /wp:paragraph -->\r\n\r\n<!-- wp:buttons {\"layout\":{\"type\":\"flex\",\"justifyContent\":\"center\",\"orientation\":\"horizontal\"},\"style\":{\"spacing\":{\"blockGap\":\"var:preset|spacing|30\"}}} -->\r\n<div class=\"wp-block-buttons\"><!-- wp:button {\"backgroundColor\":\"black\",\"textColor\":\"white\",\"style\":{\"border\":{\"radius\":\"7px\"}}} -->\r\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-white-color has-black-background-color has-text-color has-background wp-element-button\" style=\"border-radius:7px\"><strong>Get Started for Free</strong></a></div>\r\n<!-- /wp:button -->\r\n\r\n<!-- wp:button {\"backgroundColor\":\"white\",\"style\":{\"border\":{\"radius\":\"7px\"}},\"className\":\"is-style-outline\"} -->\r\n<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link has-white-background-color has-background wp-element-button\" style=\"border-radius:7px\"><strong>Explore It</strong></a></div>\r\n<!-- /wp:button --></div>\r\n<!-- /wp:buttons -->\r\n\r\n<!-- wp:paragraph {\"align\":\"center\",\"style\":{\"typography\":{\"fontStyle\":\"normal\",\"fontWeight\":\"300\",\"fontSize\":\"14px\"},\"color\":{\"text\":\"#555555\"}}} -->\r\n<p class=\"has-text-align-center has-text-color\" style=\"color:#555555;font-size:14px;font-style:normal;font-weight:300\"><strong>1,456+</strong> Reviews | <strong>No Credit Card</strong> Required</p>\r\n<!-- /wp:paragraph --></div>\r\n<!-- /wp:column --></div>\r\n<!-- /wp:columns --></div>\r\n<!-- /wp:group -->", |
| 37 |
'categories' => array("patternswp-hero"), |
| 38 |
) |
| 39 |
); |
| 40 |
|
| 41 |
} |
| 42 |
} |
| 43 |
add_action( 'init', 'PatternsWPHero_patterns_register_block_patterns' ); |
| 44 |
|
| 45 |
|