diff --git a/assets/css/base.css b/assets/css/base.css index 18587a3..00cd7ac 100644 --- a/assets/css/base.css +++ b/assets/css/base.css @@ -1 +1 @@ -html{-webkit-box-sizing:border-box;box-sizing:border-box;border-color:rgba(0, 0, 0, 0.2)}*{border-color:inherit}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{line-height:1.618;font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol}code,kbd,pre,tt,var{font-family:Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;font-size:.9375rem}h1{font-size:2.618em}h2{font-size:2.058em}h1,h2{line-height:1.191}h3{font-size:1.618em}h4{font-size:1.272em}h3,h4{line-height:1.382}blockquote:first-child,dl:first-child,figure:first-child,form:first-child,h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,h6:first-child,hr:first-child,iframe:first-child,ol:first-child,p:first-child,table:first-child,ul:first-child{margin-top:0}blockquote:last-child,dl:last-child,figure:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,hr:last-child,iframe:last-child,ol:last-child,p:last-child,table:last-child,ul:last-child{margin-bottom:0}ol,ul{margin-left:0;padding-left:1.618em}.page-header{margin-bottom:1.618em}h1,h2,h3,h4,h5,h6{clear:both;word-wrap:break-word}cite,dfn,em,i{font-style:italic}blockquote{padding:.618rem 0;padding-left:1.618rem;margin-left:0;margin-right:0;font-size:1.272em;font-weight:300;font-style:italic;border-left:2px solid}pre{max-width:100%;overflow:auto;padding:1.618em}table{border-collapse:collapse}td,th{padding:.5em;border-bottom-width:1px;border-bottom-style:solid}fieldset{padding:0;margin:0;border-width:0}button,input,select,textarea{max-width:100%;padding:.618em;line-height:normal;font-size:1em;font-family:inherit;background:transparent;color:inherit;border-width:1px;border-style:solid;border-radius:2px;vertical-align:baseline}select[multiple],select[size],textarea{height:auto;line-height:inherit}textarea{vertical-align:top;overflow-y:auto;resize:vertical}[type=button],[type=reset],[type=submit],button{padding:calc( .618em - 1px);text-transform:uppercase;border-width:2px;cursor:pointer}option{background:#fff!important;color:#444!important}label[for]{cursor:pointer}input[type=checkbox]+label{margin-left:.382em}:disabled,[aria-disabled=true],[disabled]{cursor:default;pointer-events:none;opacity:.5}::-webkit-input-placeholder{font-weight:300;opacity:.8}:-ms-input-placeholder{font-weight:300;opacity:.8}::-ms-input-placeholder{font-weight:300;opacity:.8}::placeholder{font-weight:300;opacity:.8}.screen-reader-text{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;width:1px;word-wrap:normal!important}.screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;-webkit-box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);clip:auto!important;-webkit-clip-path:none;clip-path:none;color:#21759b;display:block;font-size:14px;font-size:0.875rem;font-weight:bold;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#content[tabindex="-1"]:focus{outline:0}.alignleft{float:left;margin-right:1em;margin-bottom:1em}.alignright{float:right;margin-left:1em;margin-bottom:1em}.aligncenter{margin-left:auto;margin-right:auto}.alignnone{margin-left:0;margin-right:0}.wp-caption{margin-bottom:1.618em;max-width:100%}.wp-caption img[class*=wp-image-]{display:block;margin-left:auto;margin-right:auto}.wp-caption .wp-caption-text{margin:.618em 0}.wp-caption-text{text-align:center}.comment{margin:2.618em 0}.commentlist{clear:both}.commentlist,.commentlist .children{padding:0;margin:2.618em 0;list-style:none}.commentlist .children{margin-left:.618em}@media (min-width:480px){.commentlist .children{margin-left:1.618em}}.comment-body{position:relative}@media (min-width:640px){.comment-body{padding-top:0.8555em;padding-left:4.329em}}.pingback .comment-body{padding:0}.comment .avatar{width:3.329em;margin-right:.382em;border-radius:10em;vertical-align:bottom}@media (min-width:640px){.comment .avatar{position:absolute;left:0;top:0}}.comment-content{margin:1em 0}.comment-content a{word-wrap:break-word}.comment-respond{margin-top:2.618em}.comment-respond [type=email],.comment-respond [type=text],.comment-respond [type=url],.comment-respond textarea{width:100%}.comment-respond label:first-child{display:block;margin-bottom:.382em}.comment-respond textarea:invalid{max-height:4.472em;overflow-y:hidden}.comment-reply-title{margin-bottom:0;font-size:1.272em}.bypostauthor{}.comment-metadata,.logged-in-as{font-size:.819em}.fl-module-fl-comments .navigation{overflow:hidden}.sticky{}.gallery{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:-0.191em}.gallery:not(:last-child){margin-bottom:1.618em}.gallery-item{-webkit-box-flex:1;-ms-flex:auto;flex:auto;display:inline-block;text-align:center;vertical-align:top}.gallery-columns-1 .gallery-item{width:calc( 100% - 0.382em);margin:0.191em}.gallery-columns-2 .gallery-item{width:calc( 50% - 0.382em);margin:0.191em}.gallery-columns-3 .gallery-item{width:calc( 33.33333% - 0.382em);margin:0.191em}.gallery-columns-4 .gallery-item{width:calc( 25% - 0.382em);margin:0.191em}.gallery-columns-5 .gallery-item{width:calc( 20% - 0.382em);margin:0.191em}.gallery-columns-6 .gallery-item{width:calc( 16.66667% - 0.382em);margin:0.191em}.gallery-columns-7 .gallery-item{width:calc( 14.28571% - 0.382em);margin:0.191em}.gallery-columns-8 .gallery-item{width:calc( 12.5% - 0.382em);margin:0.191em}.gallery-columns-9 .gallery-item{width:calc( 11.11111% - 0.382em);margin:0.191em}.gallery-caption{display:block}.gallery img{vertical-align:top}img{max-width:100%;height:auto}.comment-content .wp-smiley,.entry-content .wp-smiley,.page-content .wp-smiley{border:0;margin-bottom:0;margin-top:0;padding:0}embed,iframe,object{max-width:100%}.custom-logo-link{display:inline-block}.post-page-numbers{display:inline-block;padding:.191em .618em;margin:.1em;text-decoration:none;border-width:1px;border-style:solid;vertical-align:middle}.post-page-numbers.current,.post-page-numbers:hover{border-color:currentColor}.page-numbers a{text-decoration:none}.fl-module-sidebar .widget:not(:last-child),.sidebar .widget:not(:last-child){margin-bottom:2.618em}.widget-title,.widgettitle{font-size:1.618em} \ No newline at end of file +html{-webkit-box-sizing:border-box;box-sizing:border-box;border-color:rgba(0, 0, 0, 0.2)}*{border-color:inherit}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{line-height:1.618;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}code,kbd,pre,tt,var{font-family:Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;font-size:.9375rem}h1{font-size:2.618em}h2{font-size:2.058em}h1,h2{line-height:1.191}h3{font-size:1.618em}h4{font-size:1.272em}h3,h4{line-height:1.382}blockquote:first-child,dl:first-child,figure:first-child,form:first-child,h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,h6:first-child,hr:first-child,iframe:first-child,ol:first-child,p:first-child,table:first-child,ul:first-child{margin-top:0}blockquote:last-child,dl:last-child,figure:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,hr:last-child,iframe:last-child,ol:last-child,p:last-child,table:last-child,ul:last-child{margin-bottom:0}ol,ul{margin-left:0;padding-left:1.618em}.page-header{margin-bottom:1.618em}h1,h2,h3,h4,h5,h6{clear:both;word-wrap:break-word}cite,dfn,em,i{font-style:italic}blockquote{padding:.618rem 0;padding-left:1.618rem;margin-left:0;margin-right:0;font-size:1.272em;font-weight:300;font-style:italic;border-left:2px solid}pre{max-width:100%;overflow:auto;padding:1.618em}table{border-collapse:collapse}td,th{padding:.5em;border-bottom-width:1px;border-bottom-style:solid}fieldset{padding:0;margin:0;border-width:0}button,input,select,textarea{max-width:100%;padding:.618em;line-height:normal;font-size:1em;font-family:inherit;background:transparent;color:inherit;border-width:1px;border-style:solid;border-radius:2px;vertical-align:baseline}select[multiple],select[size],textarea{height:auto;line-height:inherit}textarea{vertical-align:top;overflow-y:auto;resize:vertical}[type=button],[type=reset],[type=submit],button{padding:calc( .618em - 1px);text-transform:uppercase;border-width:2px;cursor:pointer}option{background:#fff!important;color:#444!important}label[for]{cursor:pointer}input[type=checkbox]+label{margin-left:.382em}:disabled,[aria-disabled=true],[disabled]{cursor:default;pointer-events:none;opacity:.5}::-webkit-input-placeholder{font-weight:300;opacity:.8}:-ms-input-placeholder{font-weight:300;opacity:.8}::-ms-input-placeholder{font-weight:300;opacity:.8}::placeholder{font-weight:300;opacity:.8}.screen-reader-text{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;width:1px;word-wrap:normal!important}.screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;-webkit-box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);clip:auto!important;-webkit-clip-path:none;clip-path:none;color:#21759b;display:block;font-size:14px;font-size:0.875rem;font-weight:bold;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#content[tabindex="-1"]:focus{outline:0}.alignleft{float:left;margin-right:1em;margin-bottom:1em}.alignright{float:right;margin-left:1em;margin-bottom:1em}.aligncenter{margin-left:auto;margin-right:auto}.alignnone{margin-left:0;margin-right:0}.wp-caption{margin-bottom:1.618em;max-width:100%}.wp-caption img[class*=wp-image-]{display:block;margin-left:auto;margin-right:auto}.wp-caption .wp-caption-text{margin:.618em 0}.wp-caption-text{text-align:center}.comment{margin:2.618em 0}.commentlist{clear:both}.commentlist,.commentlist .children{padding:0;margin:2.618em 0;list-style:none}.commentlist .children{margin-left:.618em}@media (min-width:480px){.commentlist .children{margin-left:1.618em}}.comment-body{position:relative}@media (min-width:640px){.comment-body{padding-top:0.8555em;padding-left:4.329em}}.pingback .comment-body{padding:0}.comment .avatar{width:3.329em;margin-right:.382em;border-radius:10em;vertical-align:bottom}@media (min-width:640px){.comment .avatar{position:absolute;left:0;top:0}}.comment-content{margin:1em 0}.comment-content a{word-wrap:break-word}.comment-respond{margin-top:2.618em}.comment-respond [type=email],.comment-respond [type=text],.comment-respond [type=url],.comment-respond textarea{width:100%}.comment-respond label:first-child{display:block;margin-bottom:.382em}.comment-respond textarea:invalid{max-height:4.472em;overflow-y:hidden}.comment-reply-title{margin-bottom:0;font-size:1.272em}.bypostauthor{}.comment-metadata,.logged-in-as{font-size:.819em}.fl-module-fl-comments .navigation{overflow:hidden}.sticky{}.gallery{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:-0.191em}.gallery:not(:last-child){margin-bottom:1.618em}.gallery-item{-webkit-box-flex:1;-ms-flex:auto;flex:auto;display:inline-block;text-align:center;vertical-align:top}.gallery-columns-1 .gallery-item{width:calc( 100% - 0.382em);margin:0.191em}.gallery-columns-2 .gallery-item{width:calc( 50% - 0.382em);margin:0.191em}.gallery-columns-3 .gallery-item{width:calc( 33.33333% - 0.382em);margin:0.191em}.gallery-columns-4 .gallery-item{width:calc( 25% - 0.382em);margin:0.191em}.gallery-columns-5 .gallery-item{width:calc( 20% - 0.382em);margin:0.191em}.gallery-columns-6 .gallery-item{width:calc( 16.66667% - 0.382em);margin:0.191em}.gallery-columns-7 .gallery-item{width:calc( 14.28571% - 0.382em);margin:0.191em}.gallery-columns-8 .gallery-item{width:calc( 12.5% - 0.382em);margin:0.191em}.gallery-columns-9 .gallery-item{width:calc( 11.11111% - 0.382em);margin:0.191em}.gallery-caption{display:block}.gallery img{vertical-align:top}img{max-width:100%;height:auto}.comment-content .wp-smiley,.entry-content .wp-smiley,.page-content .wp-smiley{border:0;margin-bottom:0;margin-top:0;padding:0}embed,iframe,object{max-width:100%}.custom-logo-link{display:inline-block}.post-page-numbers{display:inline-block;padding:.191em .618em;margin:.1em;text-decoration:none;border-width:1px;border-style:solid;vertical-align:middle}.post-page-numbers.current,.post-page-numbers:hover{border-color:currentColor}.page-numbers a{text-decoration:none}.fl-module-sidebar .widget:not(:last-child),.sidebar .widget:not(:last-child){margin-bottom:2.618em}.widget-title,.widgettitle{font-size:1.618em} diff --git a/assets/sass/base.scss b/assets/sass/base.scss index 181729c..d3887e1 100644 --- a/assets/sass/base.scss +++ b/assets/sass/base.scss @@ -11,7 +11,7 @@ // @copyright WebMan Design, Oliver Juhas // // @since 1.0.0 -// @version 1.0.0 +// @version 1.0.1 // $left: left; diff --git a/assets/sass/parts/_typography.scss b/assets/sass/parts/_typography.scss index 74923c5..a3d3a34 100644 --- a/assets/sass/parts/_typography.scss +++ b/assets/sass/parts/_typography.scss @@ -3,17 +3,17 @@ html { font-family: -apple-system, BlinkMacSystemFont, - Segoe UI, + 'Segoe UI', Helvetica, Arial, sans-serif, - Apple Color Emoji, - Segoe UI Emoji, - Segoe UI Symbol; + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol'; } pre, code, kbd, tt, var { - font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: .9375rem; } diff --git a/changelog.md b/changelog.md index 0552e37..d0790a6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,22 @@ # Playground for Beaver Themer Changelog +## 1.0.1 + +* **Fix**: CSS font family values +* **Fix**: Making the theme work with Beaver Builder pages/posts + +### Files changed: + + changelog.md + index.php + style.css + assets/css/base.css + assets/sass/base.scss + assets/sass/parts/_typography.scss + includes/class-setup-plugin.php + templates/parts/content/content.php + + ## 1.0.0 * Initial release. diff --git a/includes/class-setup-plugin.php b/includes/class-setup-plugin.php index c82e7d2..4ba6470 100644 --- a/includes/class-setup-plugin.php +++ b/includes/class-setup-plugin.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 1.0.0 - * @version 1.0.0 + * @version 1.0.1 */ class PfBT_Setup_Plugin { @@ -14,15 +14,33 @@ class PfBT_Setup_Plugin { * Initialization. * * @since 1.0.0 - * @version 1.0.0 + * @version 1.0.1 */ public static function init() { add_action( 'pfbt_content', __CLASS__ . '::notice' ); + add_action( 'pfbt_content', __CLASS__ . '::content' ); add_filter( 'fl_theme_builder_part_hooks', __CLASS__ . '::parts' ); add_filter( 'fl_builder_upgrade_url', __CLASS__ . '::url' ); } + /** + * Is builder active or enabled? + * + * @since 1.0.1 + * @version 1.0.1 + */ + public static function is_builder() { + if ( + ! is_callable( 'FLBuilderModel::is_builder_active' ) + || ! is_callable( 'FLBuilderModel::is_builder_enabled' ) + ) { + return false; + } + + return FLBuilderModel::is_builder_active() || FLBuilderModel::is_builder_enabled(); + } + /** * Front-end notice. * @@ -30,21 +48,34 @@ public static function init() { * but there is no Beaver Themer layout to display. * * @since 1.0.0 - * @version 1.0.0 + * @version 1.0.1 */ public static function notice() { if ( ! class_exists( 'FLThemeBuilder' ) ) { // Beaver Themer not active? get_template_part( 'templates/parts/content/content', 'beaver-themer' ); - } else if ( - ! is_callable( 'FLBuilderModel::is_builder_active' ) - || ! FLBuilderModel::is_builder_active() - ) { + } else if ( ! self::is_builder() ) { // Looks like we have no Themer Layouts... get_template_part( 'templates/parts/content/content', 'themer-layouts' ); } } + /** + * Display page builder layout if it exists. + * + * Allows displaying custom page builder layout if it exists, + * such as pages built with Beaver Builder. This will bypass + * the Beaver Themer layout. + * + * @since 1.0.1 + * @version 1.0.1 + */ + public static function content() { + if ( self::is_builder() ) { + get_template_part( 'templates/parts/content/content', get_post_type() ); + } + } + /** * Registers hooks for theme parts. * diff --git a/index.php b/index.php index 8921f93..44e8d3b 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 1.0.0 - * @version 1.0.0 + * @version 1.0.1 */ get_header(); @@ -27,6 +27,7 @@ * this content is being displayed instead. * * `PfBT_Setup_Plugin::notice()` is hooked here. + * `PfBT_Setup_Plugin::content()` is hooked here. * Not included in Beaver Themer part hooks, no need to. * * @since 1.0.0 diff --git a/style.css b/style.css index a2a46a6..eee16ee 100644 --- a/style.css +++ b/style.css @@ -3,7 +3,7 @@ Theme Name: Playground for Beaver Themer Theme URI: https://github.com/webmandesign/playground-for-beaver-themer/ Author: WebMan Design Author URI: https://www.webmandesign.eu/ -Version: 1.0.0 +Version: 1.0.1 Text Domain: playground-for-beaver-themer Domain Path: /languages License: GNU General Public License v3 diff --git a/templates/parts/content/content.php b/templates/parts/content/content.php new file mode 100644 index 0000000..21565a8 --- /dev/null +++ b/templates/parts/content/content.php @@ -0,0 +1,17 @@ +