'd6c08e',
'border' => 'c5ae7c',
'text' => '000000',
'link' => 'd8471d',
'url' => 'd8471d'
);
}
/**
* Set the maximum content width of the normal content column.
* This prevents large images from overrunning the sides of the column.
*/
if ( ! isset( $content_width ) )
$content_width = 652;
/**
* Load the Theme Options Page that lets users toggle the display of the Random Images photo gallery on attachments page
*/
require_once ( get_template_directory() . '/inc/theme-options.php' );
// Action hook to do all the major theme setup stuff
add_action( 'after_setup_theme', 'matala_setup' );
/**
* Tell WordPress to run matala_setup() when the 'after_setup_theme' hook is run.
*/
if ( ! function_exists( 'matala_setup' ) ):
function matala_setup() {
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// This theme supports post formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status' ) );
// Make theme available for translation
// Translations can be filed in the /languages/ directory
load_theme_textdomain( 'matala', get_template_directory() . '/languages' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'matala' ),
) );
// 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', 300, 300 );
// Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
function matala_page_menu_args($args) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'matala_page_menu_args' );
// This theme styles the visual editor.
add_editor_style('editor-style.css');
}
endif;
function matala_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'matala_custom_header_args', array(
'default-image' => '',
'default-text-color' => 'fff',
'width' => 940,
'height' => 150,
'wp-head-callback' => 'matala_header_style',
'admin-head-callback' => 'matala_admin_header_style',
) ) );
}
add_action( 'after_setup_theme', 'matala_custom_header_setup' );
/**
* Enqueue scripts and styles
*/
function matala_scripts() {
wp_enqueue_style( 'matala', get_stylesheet_uri() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'matala_scripts' );
/**
* Add custom header support
*/
if ( ! function_exists( 'matala_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
*/
function matala_header_style() {
// If no custom options for text are set, let's bail
if ( HEADER_TEXTCOLOR == get_header_textcolor() && '' == get_header_image() )
return;
// If we get this far, we have custom styles. Let's do this.
?>
Header admin panel.
*
*/
function matala_admin_header_style() {
?>
__( 'Default sidebar', 'matala' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area.', 'matala' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
register_sidebar( array (
'name' => __( 'First Supplementary Widget Area', 'matala' ),
'id' => 'first-supplementary-widget-area',
'description' => __( 'The first widgt area appearing below the main post column.', 'matala' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
register_sidebar( array (
'name' => __( 'Second Supplementary Widget Area', 'matala' ),
'id' => 'second-supplementary-widget-area',
'description' => __( 'The second widget area appearing below the main post column.', 'matala' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
'
) );
}
add_action( 'init', 'matala_widgets_init' );
/**
* Count the number of footer sidebars to enable dynamic classes for the widgets appearing below the main post content area
*/
function matala_supplementary_sidebar_class() {
$count = 0;
if ( is_active_sidebar( 'first-supplementary-widget-area' ) )
$count++;
if ( is_active_sidebar( 'second-supplementary-widget-area' ) )
$count++;
$class = '';
switch ( $count ) {
case '1':
$class = 'one';
break;
case '2':
$class = 'two';
break;
}
if ( $class )
echo 'class="' . $class . '"';
}
/**
* Removes the default styles that are packaged with the Recent Comments widget.
*/
function matala_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', 'matala_remove_recent_comments_style' );
if ( ! function_exists( 'matala_post_date' ) ) :
/**
* Prints HTML with meta information for the fancy display of the current post's month and day
*/
function matala_post_date() {
printf( __( '
%1$s%2$s
', 'matala' ),
esc_attr( get_the_time( 'M' ) ),
esc_attr( get_the_time( 'j' ) )
);
}
endif;
if ( ! function_exists( 'matala_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post's full date and author
*/
function matala_posted_on() {
printf( __( '