diff --git a/functions.php b/functions.php
index 3100225..bc1e7fa 100644
--- a/functions.php
+++ b/functions.php
@@ -58,16 +58,31 @@ function trestle_theme_setup() {
/*===========================================
- * Header Styles & Scripts
+ * Widget Areas
+ ===========================================*/
+
+ add_action( 'widgets_init', 'trestle_register_widget_areas' );
+
+
+ /*===========================================
+ * Head Styles & Scripts
===========================================*/
add_action( 'wp_enqueue_scripts', 'trestle_header_actions' );
/*===========================================
- * Widget Areas
+ * Body Classes
===========================================*/
-
- add_action( 'widgets_init', 'trestle_register_widget_areas' );
+
+ add_filter( 'body_class', 'trestle_body_classes' );
+
+ /*===========================================
+ * Header
+ ===========================================*/
+
+ // Add logo
+ add_filter( 'genesis_seo_title', 'trestle_do_logos', 10, 3 );
+
/*===========================================
* Auto & Mobile Navigation
@@ -95,9 +110,6 @@ function trestle_theme_setup() {
* General Actions & Filters
===========================================*/
- // Add body classes
- add_filter( 'body_class', 'trestle_body_classes' );
-
// Do custom Read More text
add_filter( 'excerpt_more', 'trestle_read_more_link' );
add_filter( 'get_the_content_more_link', 'trestle_read_more_link' );
diff --git a/lib/admin/admin-functions.php b/lib/admin/admin-functions.php
index b6b67b2..2337d31 100644
--- a/lib/admin/admin-functions.php
+++ b/lib/admin/admin-functions.php
@@ -113,6 +113,8 @@ function trestle_register_social_sanitization_filters() {
'safe_html',
GENESIS_SETTINGS_FIELD,
array(
+ 'trestle_logo_url',
+ 'trestle_logo_url_mobile',
'trestle_home_link_text',
'trestle_nav_button_text',
'trestle_custom_nav_extras_text',
@@ -155,6 +157,16 @@ function trestle_settings_box() {
/>
/>
+
+
+
+
+
+
diff --git a/lib/admin/editor-style.css b/lib/admin/editor-style.css index 66152e1..4d17d21 100644 --- a/lib/admin/editor-style.css +++ b/lib/admin/editor-style.css @@ -11,7 +11,9 @@ /* Overrides --------------------------------------------- */ body { + padding: 8px 16px; background-color: #FFF; + background-image: none; } .content { diff --git a/lib/functions/theme-functions.php b/lib/functions/theme-functions.php index c55f516..a7a4108 100644 --- a/lib/functions/theme-functions.php +++ b/lib/functions/theme-functions.php @@ -10,7 +10,20 @@ */ /*=========================================== - * Header Styles & Scripts + * Widget Areas +===========================================*/ + +/** + * Register custom widget areas + * + * @since 1.0.0 + */ +function trestle_register_widget_areas() { + +} + +/*=========================================== + * Head Styles & Scripts ===========================================*/ /** @@ -44,16 +57,112 @@ function trestle_header_actions() { /*=========================================== - * Widget Areas + * Body Classes ===========================================*/ /** - * Register custom widget areas + * Adds custom classes to the
element for styling purposes. + * + * @since 1.0.0 + * + * @param array $classes Body classes. + * @return array Updated body classes. + */ +function trestle_body_classes( $classes ) { + // Add 'no-jquery' class to be removed by jQuery if enabled + $classes[] = 'no-jquery'; + + // Add 'bubble' class + if ( 'bubble' == genesis_get_option( 'trestle_layout' ) ) + $classes[] = 'bubble'; + + // Add link icon classes + if ( genesis_get_option( 'trestle_external_link_icons' ) ) + $classes[] = 'external-link-icons'; + if ( genesis_get_option( 'trestle_email_link_icons' ) ) + $classes[] = 'email-link-icons'; + if ( genesis_get_option( 'trestle_pdf_link_icons' ) ) + $classes[] = 'pdf-link-icons'; + if ( genesis_get_option( 'trestle_doc_link_icons' ) ) + $classes[] = 'doc-link-icons'; + + // Add footer widget number class + if ( genesis_get_option( 'trestle_footer_widgets_number' ) ) + $classes[] = 'footer-widgets-number-' . esc_attr( genesis_get_option( 'trestle_footer_widgets_number' ) ); + + // Add class for equal height Genesis Extender columns + if ( 1 == genesis_get_option( 'trestle_equal_height_cols' ) ) + $classes[] = 'equal-height-genesis-extender-cols'; + + // Add logo class + if ( genesis_get_option( 'trestle_logo_url' ) || genesis_get_option( 'trestle_logo_url_mobile' ) ) + $classes[] = 'has-logo'; + + return $classes; +} + +/*=========================================== + * Header +===========================================*/ + +/** + * Output logos. * * @since 1.0.0 */ -function trestle_register_widget_areas() { +function trestle_do_logos( $title, $inside, $wrap ) { + $logo_url = genesis_get_option( 'trestle_logo_url' ); + $logo_url_mobile = genesis_get_option( 'trestle_logo_url_mobile' ); + $logo_html = ''; + // Regular logo + if ( $logo_url ) { + + // Default logo class + $classes = array('logo'); + + // If no mobile logo is specified, make regular logo act as mobile logo too + if( ! $logo_url_mobile ) + $classes[] = 'logo-show'; + + $logo_html .= sprintf( '