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;
?>
'' ) ); ?>
false ) ) ); ?>
'' ) ); ?>
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; ?>
have_posts() ) : $query->the_post(); ?>
', '' );
// 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
?>
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.
?>
',
) );
// Front Page Slider
register_sidebar( array(
'name' => __( 'Front Page Slider', 'capture' ),
'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.', 'capture' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
// Front Page
register_sidebar( array(
'name' => __( 'Front Page', 'capture' ),
'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.', 'capture' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
// Header Call To Action
register_sidebar( array(
'name' => __( 'Header Call To Action', 'capture' ),
'id' => 'header-call-to-action-sidebar',
'description' => __( 'This widget area is used to display a call to action in the header', 'capture' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
// After Posts
register_sidebar( array(
'name' => __( 'After Posts', 'capture' ),
'id' => 'after-posts-sidebar',
'description' => __( 'This widget area is displayed below the content on single posts only.', 'capture' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
// Footer
register_sidebar( array(
'name' => __( 'Footer', 'capture' ),
'id' => 'footer-sidebar',
'description' => __( 'This widget area is displayed in the footer of all pages.', 'capture' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
// Copyright
register_sidebar( array(
'name' => __( 'Copyright Area', 'capture' ),
'id' => 'copyright-area-sidebar',
'description' => __( 'This widget area is designed for small text blurbs or disclaimers at the bottom of the website.', 'capture' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_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 );
}