= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'empo' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'empo_wp_title', 10, 2 ); /** * Tell WordPress to run empo() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'empo' ); if ( ! function_exists( 'empo' ) ): /** * Sets up theme defaults and registers support for WordPress features. */ function empo() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'empo' ), ) ); // Add support for Post Formats add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'video', 'image', 'quote' ) ); // This theme allows users to set a custom background add_theme_support( 'custom-background' ); // Responsive Videos add_theme_support( 'jetpack-responsive-videos' ); // Add support for flexible headers $header_args = array( 'flex-height' => true, 'height' => 350, 'flex-width' => true, 'width' => 960, 'default-image' => '%s/images/headers/headerimage.jpg', 'header-text' => false, ); add_theme_support( 'custom-header', $header_args ); // ... and thus ends the changeable header business. // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'beach' => array( 'url' => '%s/images/headers/beach.jpg', 'thumbnail_url' => '%s/images/headers/beach-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Beach', 'empo' ) ), 'urban' => array( 'url' => '%s/images/headers/urban.jpg', 'thumbnail_url' => '%s/images/headers/urban-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Urban', 'empo' ) ), 'palms' => array( 'url' => '%s/images/headers/palms.jpg', 'thumbnail_url' => '%s/images/headers/palms-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Palms', 'empo' ) ), 'romantic' => array( 'url' => '%s/images/headers/romantic.jpg', 'thumbnail_url' => '%s/images/headers/romantic-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Romantic', 'empo' ) ), 'summer' => array( 'url' => '%s/images/headers/summer.jpg', 'thumbnail_url' => '%s/images/headers/summer-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Summer', 'empo' ) ), 'landscape' => array( 'url' => '%s/images/headers/landscape.jpg', 'thumbnail_url' => '%s/images/headers/landscape-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Landscape', 'empo' ) ) ) ); } endif; if ( ! function_exists( 'empo_admin_header_style' ) ) : /** * Styles the header image displayed on the Appearance > Header admin panel. * Referenced via add_custom_image_header() in empo_setup(). */ function empo_admin_header_style() { ?> ' . __( 'Continue reading ', 'empo' ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and empo_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function empo_auto_excerpt_more( $more ) { return ' …' . empo_continue_reading_link(); } add_filter( 'excerpt_more', 'empo_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function empo_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= empo_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'empo_custom_excerpt_more' ); /** * Remove inline styles printed when the gallery shortcode is used. */ function empo_remove_gallery_css( $css ) { return preg_replace( "##s", '', $css ); } add_filter( 'gallery_style', 'empo_remove_gallery_css' ); if ( ! function_exists( 'empo_comment' ) ) : /** * Template for comments and pingbacks. */ function empo_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
  • id="li-comment-">
    comment_approved == '0' ) : ?>

    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • __( 'Top Panel', 'empo' ), 'id' => 'sidebar-top', 'before_widget' => '", 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array ( 'name' => __( 'Sidebar', 'empo' ), 'id' => 'sidebar-1', 'before_widget' => '", 'before_title' => '

    ', 'after_title' => '

    ', ) ); /* Register the 'first area' sidebar. */ register_sidebar( array( 'id' => 'first-footer-widget-area', 'name' => __( 'First-Footer-Widget-Area','empo'), 'description' => __( 'The first footer widget area', 'empo'), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); /* Register the 'second area' sidebar. */ register_sidebar( array( 'id' => 'second-footer-widget-area', 'name' => __( 'Second-Footer-Widget-Area','empo'), 'description' => __( 'The second footer widget area', 'empo'), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } add_action( 'init', 'empo_widgets_init' ); /** * Removes the default styles that are packaged with the Recent Comments widget. */ function empo_remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } add_action( 'widgets_init', 'empo_remove_recent_comments_style' ); /** * Search form custom styling */ function empo_search_form( $form ) { $form = ''; return $form; } add_filter( 'get_search_form', 'empo_search_form' ); /** * Remove the default CSS style from the WP image gallery */ add_filter('gallery_style', create_function('$a', 'return "
    ";')); /*-----------------------------------------------------------------------------------*/ /* Adds the Customize page to the WordPress admin area /*-----------------------------------------------------------------------------------*/ function empo_customizer_menu() { add_theme_page( __('Customize','empo'), __('Customize','empo'), 'edit_theme_options', 'customize.php' ); } add_action( 'admin_menu', 'empo_customizer_menu' ); /** * Adds the individual sections for custom logo */ function empo_theme_customizer( $wp_customize ) { $wp_customize->add_section( 'empo_logo_section' , array( 'title' => __( 'Logo', 'empo' ), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name and description in the header', ) ); $wp_customize->add_setting( 'empo_logo', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'empo_logo', array( 'label' => __( 'Logo', 'empo' ), 'section' => 'empo_logo_section', 'settings' => 'empo_logo', ) ) ); } add_action('customize_register', 'empo_theme_customizer'); /** * Adds the individual sections for custom favicon */ function anariel_favicon_customizer( $wp_customize ) { $wp_customize->add_section( 'anariel_favicon_section' , array( 'title' => __( 'Favicon', 'anariel' ), 'priority' => 30, 'description' => 'Upload a favicon', ) ); $wp_customize->add_setting( 'anariel_favicon', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anariel_favicon', array( 'label' => __( 'Favicon', 'anariel' ), 'section' => 'anariel_favicon_section', 'settings' => 'anariel_favicon', ) ) ); } add_action('customize_register', 'anariel_favicon_customizer'); /** * Adds the individual sections for colors */ function empo_customize_register( $wp_customize ) { $colors = array(); $colors[] = array( 'slug'=>'content_link_color', 'default' => '#00b5c0', 'label' => __('Change links and borders blue color', 'empo') ); foreach( $colors as $color ) { // SETTINGS $wp_customize->add_setting( $color['slug'], array( 'default' => $color['default'], 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options' ) ); // CONTROLS $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $color['slug'], array('label' => $color['label'], 'section' => 'colors', 'settings' => $color['slug']) ) ); } } add_action( 'customize_register', 'empo_customize_register' ); /** * Sanitization */ //Checkboxes function anariel_sanitize_checkbox( $input ) { if ( $input == 1 ) { return 1; } else { return ''; } } //Integers function anariel_sanitize_int( $input ) { if( is_numeric( $input ) ) { return intval( $input ); } } //Text function anariel_sanitize_text( $input ) { return wp_kses_post( force_balance_tags( $input ) ); }