'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( __( '
Posted on by
', 'matala' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'matala' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; if ( ! function_exists( 'matala_posted_in' ) ) : /** * Prints HTML with meta information for the current post (category, tags and permalink). */ function matala_posted_in() { $posted_in = ''; $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list && ! is_wp_error( $tag_list ) ) { $posted_in = __( 'Filed under %1$s and tagged %2$s |', 'matala' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( 'Filed under %1$s |', 'matala' ); } // Prints the string, replacing the placeholders. printf( $posted_in, get_the_category_list( ', ' ), $tag_list ); } endif; if ( ! function_exists( 'matala_nav_below' ) ) : /** * Display navigation to next/previous pages when applicable */ function matala_content_nav( $nav_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    comment_parent ) $avatar_size = 39; echo get_avatar( $comment, $avatar_size ); /* translators: 1: comment author, 2: date and time */ printf( __( '%1$s on %2$s said:', 'matala' ), sprintf( '%s', get_comment_author_link() ), sprintf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'matala' ), get_comment_date(), get_comment_time() ) ) ); ?>
    comment_approved == '0' ) : ?>
    __( 'Reply ↓', 'matala' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ', '', false ); else $content .= the_title( '

    ', '

    ', false ); } return $content; } add_filter( 'the_content', 'matala_conditional_title', 0 ); /** * Filters wp_title to print a neat tag based on what is being viewed. * * @since Matala 1.6 */ function matala_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', 'matala' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'matala_wp_title', 10, 2 );