__( 'Primary Menu', 'mystique' ),
) );
// This theme allows users to set a custom background.
add_theme_support( 'custom-background' );
// This theme uses post thumbnails.
add_theme_support( 'post-thumbnails' );
add_image_size( 'normal', 90, 70, true ); // normal thumbnail size
// 'large-feature' size is set in mystique_custom_header_setup()
// Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
function mystique_page_menu_args($args) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'mystique_page_menu_args' );
add_theme_support( 'print-style' );
}
endif;
/**
* Enqueue scripts and styles
*/
function mystique_scripts() {
wp_enqueue_style( 'mystique', get_stylesheet_uri() );
wp_enqueue_script( 'functions-js', get_template_directory_uri().'/js/functions.js', array( 'jquery') );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'mystique_scripts' );
/**
* Returns the current Mystique theme options, with default values as fallback
*
*/
function mystique_get_theme_options() {
$defaults = array(
'color_scheme' => 'green',
'theme_layout' => 'content-sidebar',
'show_rss_link' => 0,
'twitter_link' => '',
'facebook_link' => '',
'flickr_link' => '',
'youtube_link' => '',
'featured_post_label' => 'Featured:',
'featured_post_home_only' => 0,
);
$options = get_option( 'mystique_theme_options', $defaults );
return $options;
}
function mystique_attachment_width() {
$options = mystique_get_theme_options();
$current_layout = $options['theme_layout'];
$three_columns = array( 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar' );
$no_columns = array( 'no-sidebar' );
if ( in_array( $current_layout, $three_columns ) )
return 480;
elseif ( in_array( $current_layout, $no_columns ) )
return 914;
else
return 604;
}
/**
* Load the custom tabbed widget
*/
require_once( dirname( __FILE__ ) . '/inc/widgets.php' );
/**
* Register widgetized area and update sidebar with default widgets
*/
function mystique_widgets_init() {
register_sidebar( array (
'name' => __( 'Default sidebar', 'mystique' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area.', 'mystique' ),
'before_widget' => '
',
'after_widget' => '',
'before_title' => ''
) );
register_sidebar( array (
'name' => __( 'Secondary sidebar', 'mystique' ),
'id' => 'secondary-widget-area',
'description' => __( 'The secondary widget area.', 'mystique' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => ''
) );
register_sidebar( array (
'name' => __( 'First Footer Widget Area', 'mystique' ),
'id' => 'first-footer-widget-area',
'description' => __( 'The first footer widget area.', 'mystique' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => ''
) );
register_sidebar( array (
'name' => __( 'Second Footer Widget Area', 'mystique' ),
'id' => 'second-footer-widget-area',
'description' => __( 'The second footer widget area.', 'mystique' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => ''
) );
register_sidebar( array (
'name' => __( 'Third Footer Widget Area', 'mystique' ),
'id' => 'third-footer-widget-area',
'description' => __( 'The third footer widget area.', 'mystique' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => ''
) );
register_sidebar( array (
'name' => __( 'Fourth Footer Widget Area', 'mystique' ),
'id' => 'fourth-footer-widget-area',
'description' => __( 'The fourth footer widget area.', 'mystique' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => ''
) );
}
add_action( 'init', 'mystique_widgets_init' );
/**
* Removes the default styles that are packaged with the Recent Comments widget.
*/
function mystique_remove_recent_comments_style() {
global $wp_widget_factory;
if ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {
remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}
}
add_action( 'widgets_init', 'mystique_remove_recent_comments_style' );
if ( ! function_exists( 'mystique_post_meta' ) ) :
/**
* Prints HTML with meta information for the current post (date, category, tags and permalink).
*/
function mystique_post_meta() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list && ! is_wp_error( $tag_list ) ) {
$posted_in = __( 'Posted on %1$s, in %2$s and tagged %3$s. Bookmark the permalink.', 'mystique' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'Posted on %1$s, in %2$s. Bookmark the permalink.', 'mystique' );
} else {
$posted_in = __( 'Posted on %1$s. Bookmark the permalink.', 'mystique' );
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_date(),
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;
if ( ! function_exists( 'mystique_comment' ) ) :
/**
* Template for comments.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own mystique_comment(), and that function will be used instead.
*
*/
function mystique_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment; ?>
id="li-comment-">
'ffffff',
'border' => 'bcb7b4',
'text' => '4e4e4e',
'link' => '0071bb',
'url' => 'b9de20',
);
break;
case 'red':
$themecolors = array(
'bg' => 'ffffff',
'border' => 'ed1e24',
'text' => '4e4e4e',
'link' => '0071bb',
'url' => 'd91d27',
);
break;
case 'blue':
$themecolors = array(
'bg' => 'ffffff',
'border' => '5ba1e0',
'text' => '4e4e4e',
'link' => '0071bb',
'url' => '44a1fb',
);
break;
case 'grey':
$themecolors = array(
'bg' => 'ffffff',
'border' => 'eeeeee',
'text' => '4e4e4e',
'link' => '888888',
'url' => '7b7b7b',
);
break;
case 'pink':
$themecolors = array(
'bg' => 'ffffff',
'border' => 'ff7888',
'text' => '4e4e4e',
'link' => 'db2f5e',
'url' => 'eb5266',
);
break;
case 'purple':
$themecolors = array(
'bg' => 'ffffff',
'border' => 'd480de',
'text' => '4e4e4e',
'link' => 'b02cc4',
'url' => 'b02cc4',
);
break;
}
/**
* Filters wp_title to print a neat tag based on what is being viewed.
*
* @since Mystique 2.6
*/
function mystique_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'mystique' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'mystique_wp_title', 10, 2 );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';