'',
'before_widget' => '
',
'after_widget' => "\n",
'before_title' => '\n",
) );
// End Register Widgets
// Start BNS Dynamic Copyright
if ( ! function_exists( 'bns_dynamic_copyright' ) ) {
function bns_dynamic_copyright( $args = '' ) {
$initialize_values = array( 'start' => '', 'copy_years' => '', 'url' => '', 'end' => '' );
$args = wp_parse_args( $args, $initialize_values );
/* Initialize the output variable to empty */
$output = '';
/* Start common copyright notice */
empty( $args['start'] ) ? $output .= sprintf( __('Copyright', 'desk-mess-mirrored') ) : $output .= $args['start'];
/* Calculate Copyright Years; and, prefix with Copyright Symbol */
if ( empty( $args['copy_years'] ) ) {
/* Get all posts */
$all_posts = get_posts( 'post_status=publish&order=ASC' );
/* Get first post */
$first_post = $all_posts[0];
/* Get date of first post */
$first_date = $first_post->post_date_gmt;
/* First post year versus current year */
$first_year = substr( $first_date, 0, 4 );
if ( $first_year == '' ) {
$first_year = date( 'Y' );
}
/* Add to output string */
if ( $first_year == date( 'Y' ) ) {
/* Only use current year if no posts in previous years */
$output .= ' © ' . date( 'Y' );
} else {
$output .= ' © ' . $first_year . "-" . date( 'Y' );
}
} else {
$output .= ' © ' . $args['copy_years'];
}
/* Create URL to link back to home of website */
empty( $args['url'] ) ? $output .= ' ' . get_bloginfo( 'name', 'display' ) .' ' : $output .= ' ' . $args['url'];
/* End common copyright notice */
empty( $args['end'] ) ? $output .= ' ' . sprintf( __( 'All rights reserved.', 'desk-mess-mirrored' ) ) : $output .= ' ' . $args['end'];
/* Construct and sprintf the copyright notice */
$output = sprintf( __( ' %1$s ', 'desk-mess-mirrored' ), $output );
$output = apply_filters( 'bns_dynamic_copyright', $output, $args );
echo $output;
}
}
// End BNS Dynamic Copyright
// Start BNS Theme Version
if ( ! function_exists( 'bns_theme_version' ) ) {
function bns_theme_version () {
$theme_version = ''; /* Clear variable */
/* Get details of the theme / child theme */
$blog_css_url = get_stylesheet_directory() . '/style.css';
$my_theme_data = get_theme_data( $blog_css_url );
$parent_blog_css_url = get_template_directory() . '/style.css';
$parent_theme_data = get_theme_data( $parent_blog_css_url );
if ( is_child_theme() ) {
printf( __( '
%1$s version %2$s a child of the %3$s version %4$s theme from BuyNowShop.com.', 'desk-mess-mirrored' ), $my_theme_data['Name'], $my_theme_data['Version'], $parent_theme_data['Name'], $parent_theme_data['Version'] );
} else {
printf( __( '
%1$s version %2$s theme from BuyNowShop.com.', 'desk-mess-mirrored' ), $my_theme_data['Name'], $my_theme_data['Version'] );
}
}
}
// End BNS Theme Version
// Tell WordPress to run desk_mess_mirrored_setup() when the 'after_setup_theme' hook is run. */
add_action( 'after_setup_theme', 'desk_mess_mirrored_setup' );
if ( ! function_exists( 'desk_mess_mirrored_setup' ) ):
function desk_mess_mirrored_setup(){
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// Add theme support for editor-style
add_editor_style();
// This theme allows users to set a custom background
add_custom_background();
// Add wp_nav_menu() custom menu support
if ( ! function_exists( 'dmm_nav_menu' ) ) {
function dmm_nav_menu() {
if ( function_exists( 'wp_nav_menu' ) )
wp_nav_menu( array(
'theme_location' => 'top-menu',
'fallback_cb' => 'dmm_list_pages'
) );
else
dmm_list_pages();
}
}
if ( ! function_exists( 'dmm_list_pages' ) ) {
function dmm_list_pages() {
if ( is_home() || is_front_page() ) {
wp_list_pages( 'title_li=' );
} else { ?>
get_the_modified_date() ) {
printf( __( 'Last modified by %1$s on %2$s.
', 'desk-mess-mirrored' ), get_the_modified_author(), get_the_modified_date() );
}
}
}
// End BNS Modified Post
apply_filters( 'widget_title', ' ' );
// Set the content width based on the theme's design and stylesheet, see #main-blog element in style.css
if ( ! isset( $content_width ) ) $content_width = 580;
?>