diff --git a/assets/sass/parts/_typography.scss b/assets/sass/parts/_typography.scss index a3d3a34..bd73140 100644 --- a/assets/sass/parts/_typography.scss +++ b/assets/sass/parts/_typography.scss @@ -13,7 +13,12 @@ html { } 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 d0790a6..7dee0a5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,18 @@ # Playground for Beaver Themer Changelog +## 1.0.2 + +* **Update**: Improving content display +* **Update**: Adding `utm_source` parameter to referral URL + +### Files changed: + + changelog.md + index.php + style.css + includes/class-setup-plugin.php + + ## 1.0.1 * **Fix**: CSS font family values diff --git a/includes/class-setup-plugin.php b/includes/class-setup-plugin.php index 4ba6470..7e0d7b3 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.1 + * @version 1.0.2 */ class PfBT_Setup_Plugin { @@ -14,10 +14,9 @@ class PfBT_Setup_Plugin { * Initialization. * * @since 1.0.0 - * @version 1.0.1 + * @version 1.0.2 */ 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' ); @@ -28,7 +27,7 @@ public static function init() { * Is builder active or enabled? * * @since 1.0.1 - * @version 1.0.1 + * @version 1.0.2 */ public static function is_builder() { if ( @@ -38,41 +37,25 @@ public static function is_builder() { return false; } - return FLBuilderModel::is_builder_active() || FLBuilderModel::is_builder_enabled(); + return have_posts() && ( FLBuilderModel::is_builder_active() || FLBuilderModel::is_builder_enabled() ); } /** - * Front-end notice. - * - * This is displayed only when WordPress found posts - * but there is no Beaver Themer layout to display. + * Content. * * @since 1.0.0 - * @version 1.0.1 + * @version 1.0.2 */ - public static function notice() { + public static function content() { if ( ! class_exists( 'FLThemeBuilder' ) ) { - // Beaver Themer not active? + // Beaver Themer not active? Display notice. get_template_part( 'templates/parts/content/content', 'beaver-themer' ); - } 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() ) { + } else if ( self::is_builder() ) { + // Display Beaver Builder page builder layout if it exists. get_template_part( 'templates/parts/content/content', get_post_type() ); + } else { + // Looks like we have no Themer Layouts: display notice. + get_template_part( 'templates/parts/content/content', 'themer-layouts' ); } } @@ -116,12 +99,20 @@ public static function parts() { * Upgrade link URL. * * @since 1.0.0 - * @version 1.0.0 + * @version 1.0.2 * * @param string $url */ public static function url( $url ) { - return esc_url( add_query_arg( 'fla', '67', $url ) ); + return esc_url( + add_query_arg( + array( + 'fla' => '67', + 'utm_source' => 'pfbt', + ), + $url + ) + ); } } diff --git a/index.php b/index.php index 44e8d3b..f09c30b 100644 --- a/index.php +++ b/index.php @@ -13,26 +13,24 @@ * @copyright WebMan Design, Oliver Juhas * * @since 1.0.0 - * @version 1.0.1 + * @version 1.0.2 */ get_header(); - if ( have_posts() ) { - /** - * Displays an `index.php` template content if we `have_posts()`. - * - * This usually gets overridden by Beaver Themer layouts. - * If the appropriate Beaver Themer layout does not exist, - * 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 - */ - do_action( 'pfbt_content' ); - } + /** + * Displays the content. + * + * This usually gets overridden by Beaver Themer layout. + * If the appropriate Beaver Themer layout does not exist, + * the content hooked onto `pfbt_content` action is being + * displayed instead. + * + * `PfBT_Setup_Plugin::content()` is hooked here. + * Not included in Beaver Themer part hooks, no need to. + * + * @since 1.0.0 + */ + do_action( 'pfbt_content' ); get_footer(); diff --git a/style.css b/style.css index eee16ee..a051277 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.1 +Version: 1.0.2 Text Domain: playground-for-beaver-themer Domain Path: /languages License: GNU General Public License v3