'latest', 'minified' => true, 'remove_existing_fa' => false, 'load_styles' => true, 'load_admin_styles' => true, 'load_shortcode' => true, 'load_tinymce_plugin' => true, ); // Initialize the Better Font Awesome Library. Better_Font_Awesome_Library::get_instance( $args ); } /*=========================================== * Header ===========================================*/ add_action( 'wp_enqueue_scripts', 'trestle_header_actions', 15 ); /** * Loads theme scripts and styles. * * @since 1.0.0 */ function trestle_header_actions() { // Our main stylesheet. wp_enqueue_style( 'trestle', get_stylesheet_uri(), array(), TRESTLE_THEME_VERSION ); // Google fonts. wp_enqueue_style( 'theme-google-fonts', '//fonts.googleapis.com/css?family=Lato:300,400,700' ); // Theme jQuery. wp_enqueue_script( 'theme-jquery', get_stylesheet_directory_uri() . '/includes/js/theme-jquery.js', array( 'jquery' ), TRESTLE_THEME_VERSION, true ); // Prepare and include some necessary variables. $mobile_nav_text = apply_filters( 'trestle_mobile_nav_text', __( 'Navigation', 'trestle' ) ); wp_localize_script( 'theme-jquery', 'trestle_vars', array( 'mobile_nav_text' => esc_attr( $mobile_nav_text ), ) ); // Get WP uploads directory. $upload_dir = wp_upload_dir(); $upload_path = $upload_dir['basedir']; $upload_url = $upload_dir['baseurl']; // Custom CSS (if it exists). $custom_css_file = '/trestle/custom.css'; if ( is_readable( $upload_path . $custom_css_file ) ) wp_enqueue_style( 'trestle-custom-css', $upload_url . $custom_css_file ); // Custom jQuery (if it exists). $custom_js_file = '/trestle/custom.js'; if ( is_readable( $upload_path . $custom_js_file ) ) wp_enqueue_script( 'trestle-custom-jquery', $upload_url . $custom_js_file, array( 'jquery' ), TRESTLE_THEME_VERSION, true ); } add_filter( 'genesis_pre_load_favicon', 'trestle_do_custom_favicon' ); /** * Output custom favicon if specified in the theme options. * * @since 1.0.0 * * @param string $favicon_url Default favicon URL. * * @return string Custom favicon URL (if specified), or the default URL. */ function trestle_do_custom_favicon( $favicon_url ) { $trestle_favicon_url = trestle_get_option( 'favicon_url' ); return $trestle_favicon_url ? $trestle_favicon_url : $favicon_url; } /*=========================================== * Body Classes ===========================================*/ add_filter( 'body_class', 'trestle_body_classes' ); /** * 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' == trestle_get_option( 'layout' ) ) $classes[] = 'bubble'; // Add link icon classes. if ( trestle_get_option( 'external_link_icons' ) ) { $classes[] = 'external-link-icons'; } if ( trestle_get_option( 'email_link_icons' ) ) { $classes[] = 'email-link-icons'; } if ( trestle_get_option( 'pdf_link_icons' ) ) { $classes[] = 'pdf-link-icons'; } if ( trestle_get_option( 'doc_link_icons' ) ) { $classes[] = 'doc-link-icons'; } // Add menu style class. $nav_primary_location = esc_attr( trestle_get_option( 'nav_primary_location' ) ); if ( $nav_primary_location ) { $classes[] = 'nav-primary-location-' . $nav_primary_location; } // Add mobile menu toggle class. $mobile_nav_toggle = esc_attr( trestle_get_option( 'mobile_nav_toggle' ) ); if ( 'big-button' == $mobile_nav_toggle ) { $classes[] = 'big-button-nav-toggle'; } elseif ( 'small-icon' == $mobile_nav_toggle ) { $classes[] = 'small-icon-nav-toggle'; } // Add footer widget number class. $footer_widgets_number = esc_attr( trestle_get_option( 'footer_widgets_number' ) ); if ( $footer_widgets_number ) { $classes[] = 'footer-widgets-number-' . $footer_widgets_number; } // Add logo class. if ( trestle_get_option( 'logo_url' ) || trestle_get_option( 'logo_url_mobile' ) ) { $classes[] = 'has-logo'; } return $classes; } /*=========================================== * Header ===========================================*/ add_filter( 'genesis_seo_title', 'trestle_do_logos', 10, 3 ); /** * Output logos. * * @since 1.0.0 */ function trestle_do_logos( $title, $inside, $wrap ) { $logo_id = trestle_get_option( 'logo_id' ); $logo_id_mobile = trestle_get_option( 'logo_id_mobile' ); $logo_html = ''; // Regular logo. if ( $logo_id ) { // Default logo classes. $classes = array( 'logo', 'logo-full' ); // If no mobile logo is specified, make regular logo act as mobile logo too. if( ! $logo_id_mobile ) { $classes[] = 'show'; } // Prepare the classes. $logo_attr = array( 'class' => implode( $classes, ' ' ), ); // Build the