< id="title" class="site-title site-title-logo has-logo"> > < id="title" class="site-title site-title-no-logo no-logo"> > < id="slogan" class="slogan "> >
section. */ if ( ! function_exists( 'sds_wp_title' ) && ! function_exists( '_wp_render_title_tag' ) ) { add_filter( 'wp_title', 'sds_wp_title' ); function sds_wp_title( $title ) { // Ignore on feeds if ( ! is_feed() ) $title .= get_bloginfo( 'name' ); return $title; } } /** * This function outputs a fallback menu and is used when the Primary Menu is inactive. */ if ( ! function_exists( 'sds_primary_menu_fallback' ) ) { function sds_primary_menu_fallback() { wp_page_menu( array( 'menu_class' => 'primary-nav menu', 'echo' => true, 'show_home' => true, 'link_before' => '', 'link_after' => '' ) ); } } /** * This function outputs a sitemap (most typically found on a 404 template). */ if ( ! function_exists( 'sds_sitemap' ) ) { function sds_sitemap() { global $post; ?>

true ) ) ); // Output all public post types except attachments and pages (see above for pages) if ( ! empty( $public_post_types ) ) foreach( $public_post_types as $post_type ) : // Skip attachments and pages if ( ! in_array( $post_type, array( 'attachment', 'page' ) ) ) : $post_type_object = get_post_type_object( $post_type ); $query = new WP_Query( array( 'post_type' => $post_type, 'posts_per_page' => wp_count_posts( $post_type )->publish ) ); if( $query->have_posts() ) : ?>

labels->name; ?>

', '' ); // Otherwise use fallback functionality else : // Author if ( is_author() ) : $author = get_user_by( 'slug', get_query_var( 'author_name' ) ); // Get user data by slug with value of author_name in query ?>

display_name : false; ?>

' . get_bloginfo( 'name' ) . '. All Rights Reserved.' ); ?> ' . $theme_name . ' by Slocum Studio', $theme_name ); ?> 'fa fa-facebook', 'twitter_url' => 'fa fa-twitter', 'linkedin_url' => 'fa fa-linkedin', 'google_plus_url' => 'fa fa-google-plus', 'youtube_url' => 'fa fa-youtube', 'vimeo_url' => 'fa fa-vimeo-square', // previously fa-play 'pinterest_url' => 'fa fa-pinterest', 'instagram_url' => 'fa fa-instagram', 'flickr_url' => 'fa fa-flickr', //'yelp_url' => '', 'foursquare_url' => 'fa fa-foursquare', 'rss_url' => 'fa fa-rss' ); $social_font_map = apply_filters( 'sds_social_icon_map', $social_font_map ); ?>
$url ) : // RSS (use site RSS feed, $url is Boolean this case) if ( $key === 'rss_url_use_site_feed' && $url ) : ?>

esc_url( get_pagenum_link() ) . '%_%', // %_% will be replaced with format below 'format' => ( ( get_option( 'permalink_structure' ) && ! $wp_query->is_search ) || ( is_home() && get_option( 'show_on_front' ) !== 'page' && ! get_option( 'page_on_front' ) ) ) ? '?paged=%#%' : '&paged=%#%', // %#% will be replaced with page number 'current' => max( 1, get_query_var( 'paged' ) ), // Get whichever is the max out of 1 and the current page count 'total' => $wp_query->max_num_pages, // Get total number of pages in current query 'next_text' => 'Next →', 'prev_text' => '← Previous', 'type' => ( $return ) ? 'array' : 'list' // Output this as an array or unordered list ) ); if( $return ) return $pagination_links; else echo $pagination_links; } } /** * Template for comments and pingbacks. * * Used as a callback by wp_list_comments() for displaying the comments. * * @param object $comment Comment to display. * @param array $args Optional args. * @param int $depth Depth of comment. */ if ( ! function_exists( 'sds_comment' ) ) { function sds_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • >

    ', '' ); ?>

  • >

    ', 'symphony' ), esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), sprintf( __( '%1$s at %2$s', 'symphony' ), get_comment_date(), get_comment_time() ) ); ?> ', '' ); ?>
    comment_approved == '0' ) : ?>

     
    __( 'Reply', 'symphony' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • get_sds_theme_option_defaults(); /** * Logo Upload */ // Setting (data is sanitized upon update_option() call using the sanitize function in $sds_theme_options_instance) $wp_customize->add_setting( 'sds_theme_options[logo_attachment_id]', // IDs can have nested array keys array( 'default' => $sds_theme_options_defaults['logo_attachment_id'], 'type' => 'option', 'sanitize_callback' => 'absint' ) ); // Section - overwrite the default title_tagline section properties $wp_customize->get_section( 'title_tagline' )->title = __( 'Logo/Site Title & Tagline', 'symphony' ); // Control $wp_customize->add_control( new SDS_Theme_Options_Customize_Logo_Control( $wp_customize, 'logo_attachment_id', array( 'label' => __( 'Logo', 'symphony' ), 'section' => 'title_tagline', 'settings' => 'sds_theme_options[logo_attachment_id]', 'sds_theme_options_instance' => $sds_theme_options_instance, 'type' => 'sds_theme_options_logo' // Used in js controller ) ) ); /** * Content Color */ // Setting $wp_customize->add_setting( 'content_color', array( 'default' => apply_filters( 'theme_mod_content_color', '' ), 'sanitize_callback' => 'sanitize_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color' ) ); // Control $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content_color', array( 'label' => __( 'Content Color', 'symphony' ), 'section' => 'colors', 'settings' => 'content_color' ) ) ); } /** * This function re-initializes theme options to ensure the Theme Customizer preview functions as expected. * It also contains a backwards compatibility check for the Remove Logo option. */ add_action( 'customize_preview_init', 'sds_customize_preview_init' ); function sds_customize_preview_init() { global $sds_theme_options; $sds_theme_options = SDS_Theme_Options::get_sds_theme_options(); /** * Remove Logo backwards compatibility check * * If 'remove-logo' is set in the options array, we need to remove it here * to ensure the Theme Customizer will save the logo information correctly. * This is due to the Theme Options sanitize function running on save of Theme * Customizer, which checks for 'remove-logo' and nulls the logo_attachment_id * value if it's set. We're now unset()ing 'remove-logo' if it is set in Theme * Options, however previous versions were not doing so. This check is necessary * for backwards compatibility. */ if ( isset( $sds_theme_options['remove-logo'] ) ) { unset( $sds_theme_options['remove-logo'] ); update_option( SDS_Theme_Options::get_option_name(), $sds_theme_options ); } } /** * This function enqueues scripts and styles on the Theme Customizer only. */ add_action( 'customize_controls_enqueue_scripts', 'sds_customize_controls_enqueue_scripts' ); function sds_customize_controls_enqueue_scripts() { wp_enqueue_style( 'sds-theme-options-customizer', get_template_directory_uri() . '/includes/css/customizer-sds-theme-options.css' ); } /*************************** * Non-Pluggable Functions * ***************************/ /** * This function sets various theme options to their defaults to prevent overlap between themes. */ add_action( 'after_switch_theme' , 'sds_after_switch_theme' ); function sds_after_switch_theme() { global $sds_theme_options; $sds_theme_option_defaults = SDS_Theme_Options::get_sds_theme_option_defaults(); // Defaults // Color Scheme (reset if necessary) if ( ! empty( $sds_theme_options['color_scheme'] ) && function_exists( 'sds_color_schemes' ) ) { $color_scheme = $sds_theme_options['color_scheme']; $color_schemes = sds_color_schemes(); if ( ! isset( $color_schemes[$color_scheme] ) ) $sds_theme_options['color_scheme'] = $sds_theme_option_defaults['color_scheme']; } // Web Font (reset if necessary) if ( ! empty( $sds_theme_options['web_font'] ) && function_exists( 'sds_web_fonts' ) ) { $web_font = $sds_theme_options['web_font']; $web_fonts = sds_web_fonts(); if ( ! isset( $web_fonts[$web_font] ) ) $sds_theme_options['web_font'] = $sds_theme_option_defaults['web_font']; } // Content Layouts (reset if necessary) if ( function_exists( 'sds_content_layouts' ) ) { $content_layouts = $sds_theme_options['content_layouts']; $sds_content_layouts = sds_content_layouts(); foreach( $content_layouts as $content_layout_id => $content_layout ) if ( $content_layout && ! isset( $sds_content_layouts[$content_layout] ) ) $sds_theme_options['content_layouts'][$content_layout_id] = $sds_theme_option_defaults['content_layouts'][$content_layout_id]; } // Update the option with new values update_option( SDS_Theme_Options::$option_name, $sds_theme_options ); } /** * This function ties into the TGM Plugin Activation Class and recommends plugins to the user. */ add_action( 'tgmpa_register', 'sds_tgmpa_register' ); function sds_tgmpa_register() { $plugins = array( // One-Click Child Themes for Slocum Themes array( 'name' => 'One-Click Child Themes for Slocum Themes', 'slug' => 'sds-one-click-child-themes-master', 'source' => 'https://github.com/sdsweb/sds-one-click-child-themes/archive/master.zip', 'required' => false, 'force_activation' => false, 'force_deactivation' => false, 'external_url' => 'https://github.com/sdsweb/sds-one-click-child-themes/' ), // Note array( 'name' => 'Note - A live text widget', 'slug' => 'note', 'required' => false ) ); $plugins = apply_filters( 'sds_tgmpa_plugins', $plugins ); tgmpa( $plugins ); } /** * This function enqueues all necessary scripts/styles based on options. */ add_action( 'wp_enqueue_scripts', 'sds_wp_enqueue_scripts' ); function sds_wp_enqueue_scripts() { global $sds_theme_options; // Color Schemes if ( $selected_color_scheme = sds_get_color_scheme() ) wp_enqueue_style( $selected_color_scheme['deps'] . '-' . $sds_theme_options['color_scheme'], get_template_directory_uri() . $selected_color_scheme['stylesheet'], array( $selected_color_scheme['deps'] ) ); // Web Fonts if ( function_exists( 'sds_web_fonts' ) && ! empty( $sds_theme_options['web_font'] ) ) { $web_fonts = sds_web_fonts(); $protocol = is_ssl() ? 'https' : 'http'; if ( ! empty( $sds_theme_options['web_font'] ) ) wp_enqueue_style( 'sds-google-web-font', $protocol . '://fonts.googleapis.com/css?family=' . $sds_theme_options['web_font'] ); } // Theme Option Fonts (Social Media) if ( ! empty( $sds_theme_options['social_media'] ) ) { $social_networks_active = false; foreach( $sds_theme_options['social_media'] as $network => $url ) if ( ! empty( $url ) ) { $social_networks_active = true; break; } if ( $social_networks_active ) wp_enqueue_style( 'font-awesome-css-min', get_template_directory_uri() . '/includes/css/font-awesome.min.css' ); } // Comment Replies if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); } /** * This function is a fallback for 'title-tag' theme support added in WordPress 4.1. */ if ( ! function_exists( '_wp_render_title_tag' ) ) { add_action( 'wp_head', 'sds_wp_head_title', 1 ); function sds_wp_head_title() { ?> <?php wp_title( '|', true, 'right' ); ?> '; } /** * This function outputs the necessary CSS classes in the body_class() function based on content layout settings. */ add_filter( 'body_class', 'sds_body_class' ); function sds_body_class( $classes ) { global $sds_theme_options, $post; // If theme supports content layouts if ( function_exists( 'sds_content_layouts' ) ) { // If single page, determine if specific page template is set $wp_page_template = ( is_page() ) ? get_post_meta( $post->ID, '_wp_page_template', true ) : false; $sds_theme_options['page_template'] = $wp_page_template; // Global if ( ! empty( $sds_theme_options['content_layouts']['global'] ) ) { $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['global']; // Remove content layout styles if a page template is selected if ( ! empty( $wp_page_template ) && $wp_page_template !== 'default' ) { unset( $sds_theme_options['body_class'] ); unset( $classes['sds-content-layout'] ); } } // 404 Error if ( is_404() && ! empty( $sds_theme_options['content_layouts']['404'] ) ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['404']; // Single Post if ( is_single() && ! empty( $sds_theme_options['content_layouts']['single'] ) ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['single']; // Home (Blog) if ( is_home() && ! empty( $sds_theme_options['content_layouts']['home'] ) ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['home']; // Single Page if ( is_page() && ! empty( $sds_theme_options['content_layouts']['page'] ) ) { // Add content layout styles only if a page template is not selected if( empty( $wp_page_template ) || $wp_page_template === 'default' ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['page']; } // Front Page if ( is_front_page() && ! empty( $sds_theme_options['content_layouts']['front_page'] ) ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['front_page']; // Archive if ( is_archive() && ! empty( $sds_theme_options['content_layouts']['archive'] ) ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['archive']; // Category Archive if ( is_category() && ! empty( $sds_theme_options['content_layouts']['category'] ) ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['category']; // Tag Archive if ( is_tag() && ! empty( $sds_theme_options['content_layouts']['tag'] ) ) $sds_theme_options['body_class'] = $classes['sds-content-layout'] = $sds_theme_options['content_layouts']['tag']; } return $classes; } /** * This function configures/sets up theme options/features. */ add_action( 'after_setup_theme', 'sds_after_setup_theme' ); function sds_after_setup_theme() { // Enable Featured Images add_theme_support( 'post-thumbnails' ); // Enable Automatic Feed Links add_theme_support( 'automatic-feed-links' ); // Enable excerpts on Pages add_post_type_support( 'page', 'excerpt' ); // Enable Title Tag Support (4.1) add_theme_support( 'title-tag' ); // Register WordPress Menus register_nav_menus( array( 'top_nav' => __( 'Top Navigation', 'symphony' ), 'primary_nav' => __( 'Primary Navigation', 'symphony' ), 'footer_nav' => __( 'Footer Navigation', 'symphony' ) ) ); } /** * This function configures sidebars for use throughout the theme */ add_action( 'widgets_init', 'sds_widgets_init' ); function sds_widgets_init() { // Register SDS Social Media Widget (/includes/widget-social-media.php) register_widget( 'SDS_Social_Media_Widget' ); // Primary sidebar register_sidebar( array( 'name' => __( 'Primary Sidebar', 'symphony' ), 'id' => 'primary-sidebar', 'description' => __( 'This widget area is the primary widget area.', 'symphony' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Secondary sidebar register_sidebar( array( 'name' => __( 'Secondary Sidebar', 'symphony' ), 'id' => 'secondary-sidebar', 'description' => __( 'This widget area is the secondary widget area.', 'symphony' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Front Page Slider register_sidebar( array( 'name' => __( 'Front Page Slider', 'symphony' ), 'id' => 'front-page-slider-sidebar', 'description' => __( '*This widget area is only displayed if a Front Page is selected via Settings > Reading in the Dashboard.* This widget area is displayed above the content on the Front Page.', 'symphony' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' ) ); // Front Page register_sidebar( array( 'name' => __( 'Front Page', 'symphony' ), 'id' => 'front-page-sidebar', 'description' => __( '*This widget area is only displayed if a Front Page is selected via Settings > Reading in the Dashboard.* This widget area is displayed below the Front Page Slider on the Front Page and will replace the Front Page content.', 'symphony' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' ) ); // Header Call To Action register_sidebar( array( 'name' => __( 'Header Call To Action', 'symphony' ), 'id' => 'header-call-to-action-sidebar', 'description' => __( 'This widget area is used to display a call to action in the header', 'symphony' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); // After Posts register_sidebar( array( 'name' => __( 'After Posts', 'symphony' ), 'id' => 'after-posts-sidebar', 'description' => __( 'This widget area is displayed below the content on single posts only.', 'symphony' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' ) ); // Footer register_sidebar( array( 'name' => __( 'Footer', 'symphony' ), 'id' => 'footer-sidebar', 'description' => __( 'This widget area is displayed in the footer of all pages.', 'symphony' ), 'before_widget' => '', 'before_title' => '' ) ); // Copyright register_sidebar( array( 'name' => __( 'Copyright Area', 'symphony' ), 'id' => 'copyright-area-sidebar', 'description' => __( 'This widget area is designed for small text blurbs or disclaimers at the bottom of the website.', 'symphony' ), 'before_widget' => '', 'before_title' => '', ) ); } /** * This function outputs the Primary Sidebar. */ function sds_primary_sidebar() { if ( is_active_sidebar( 'primary-sidebar' ) ) dynamic_sidebar( 'primary-sidebar' ); } /** * This function outputs the Secondary Sidebar. */ function sds_secondary_sidebar() { if ( is_active_sidebar( 'secondary-sidebar' ) ) dynamic_sidebar( 'secondary-sidebar' ); } /** * This function outputs the Front Page Slider Sidebar. */ function sds_front_page_slider_sidebar() { if ( is_active_sidebar( 'front-page-slider-sidebar' ) ) dynamic_sidebar( 'front-page-slider-sidebar' ); } /** * This function outputs the Header Call to Action Sidebar. */ function sds_header_call_to_action_sidebar() { if ( is_active_sidebar( 'header-call-to-action-sidebar' ) ) dynamic_sidebar( 'header-call-to-action-sidebar' ); } /** * This function outputs the After Posts Sidebar. */ function sds_after_posts_sidebar() { if ( is_active_sidebar( 'after-posts-sidebar' ) ) dynamic_sidebar( 'after-posts-sidebar' ); } /** * This function outputs the Footer Sidebar. */ function sds_footer_sidebar() { if ( is_active_sidebar( 'footer-sidebar' ) ) dynamic_sidebar( 'footer-sidebar' ); } /** * This function outputs the Copyright Area Sidebar. */ function sds_copyright_area_sidebar() { if ( is_active_sidebar( 'copyright-area-sidebar' ) ) dynamic_sidebar( 'copyright-area-sidebar' ); } /** * This function determines whether or not the user has selected a color scheme and returns * the color scheme details if they have. * * The default color scheme can be ignored and thus if the user has selected the default color * scheme it will not be returned. */ function sds_get_color_scheme( $ignore_default = true ) { global $sds_theme_options; // Return value $r = false; // Default and all other color schemes (when user has selected options) if ( function_exists( 'sds_color_schemes' ) && ! empty( $sds_theme_options['color_scheme'] ) ) { $color_schemes = sds_color_schemes(); if ( ! empty( $sds_theme_options['color_scheme'] ) && isset( $color_schemes[$sds_theme_options['color_scheme']] ) ) { $selected_color_scheme = array_key_exists( $sds_theme_options['color_scheme'], $color_schemes ) ? $color_schemes[$sds_theme_options['color_scheme']] : false; // Is this the default color scheme? $default_color_scheme = ( isset( $selected_color_scheme['default'] ) && $selected_color_scheme['default'] ) ? true : false; // If we're not ignoring the default, or we are and this isn't a default color scheme if ( ( ! $ignore_default || ! $default_color_scheme ) ) $r = $selected_color_scheme; } } // Default else if ( function_exists( 'sds_color_schemes' ) && empty( $sds_theme_options['color_scheme'] ) && ! $ignore_default ) { $color_schemes = sds_color_schemes(); $r = $color_schemes['default']; } return apply_filters( 'sds_color_scheme', $r, $ignore_default ); }