section.
*/
if ( ! function_exists( 'sds_wp_title' ) ) {
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() {
?>
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. Specifically formatted for Soliloquy or SlideDeck sliders.* 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' );
}