add_setting( 'num_posts_grid', array( 'default' => '0' ) ); $wp_customize->add_setting( 'num_posts_slider', array( 'default' => '6' ) ); $wp_customize->add_setting( 'layout_mobile', array( 'default' => 'grid' ) ); $wp_customize->add_control( 'num_posts_grid', array( 'label' => __( 'Number of posts for grid', 'text-domain'), 'section' => 'featured_content', 'settings' => 'num_posts_grid', ) ); $wp_customize->add_control( 'num_posts_slider', array( 'label' => __( 'Number of posts for slider', 'text-domain'), 'section' => 'featured_content', 'settings' => 'num_posts_slider', ) ); $wp_customize->add_control( 'layout_mobile', array( 'label' => __( 'Layout for mobile devices', 'text-domain'), 'section' => 'featured_content', 'settings' => 'layout_mobile', 'type' => 'select', 'choices' => array( 'grid' => 'Grid', 'slider' => 'Slider', ), ) ); } add_action( 'customize_register', 'awesome_2014_customize_register' ); function awesome_2014_get_featured_posts( $posts ){ $fc_options = (array) get_option( 'featured-content' ); if ( $fc_options ) { //$tag-name = $fc_options['tag-name']; //} else { $tag_name = 'featured'; } $layout = get_theme_mod( 'featured_content_layout' ); $max_posts = get_theme_mod( 'num_posts_' . $layout, 2 ); $args = array( 'tag' => $tag_name, 'posts_per_page' => $max_posts, 'order_by' => 'post_date', 'order' => 'DESC', 'post_status' => 'publish', ); $new_post_array = get_posts( $args ); if ( count($new_post_array) > 0 ) { return $new_post_array; } else { return $posts; } } add_filter( 'twentyfourteen_get_featured_posts', 'awesome_2014_get_featured_posts', 999, 1 ); function my_child_theme_setup() { load_child_theme_textdomain( '2014child', get_stylesheet_directory() . '/languages' ); } add_action( 'after_setup_theme', 'my_child_theme_setup' ); function be_exclude_post_formats_from_blog( $query ) { if( $query->is_main_query() && $query->is_home() ) { $tax_query = array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-quote', 'post-format-gallery', 'post-format-aside', 'post-format-link', 'post-format-audio', 'post-format-quote', 'post-format-image', 'post-format-video' ), 'operator' => 'NOT IN', ) ); $query->set( 'tax_query', $tax_query ); } } add_action( 'pre_get_posts', 'be_exclude_post_formats_from_blog' ); if (!class_exists('post_teaser')) { include_once(get_stylesheet_directory() . '/post-teaser/post-teaser.php' ); } function mytheme_setup() { set_post_thumbnail_size(300, 300, true); } add_action('after_setup_theme', 'mytheme_setup', 20); function twentyfourteen_paging_nav() { global $wp_query; // Don't print empty markup if there's only one page. if ( $wp_query->max_num_pages < 2 ) return; ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; ?> __( 'Primary Sidebar', 'twentyfourteen' ), 'id' => 'sidebar-1', 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Content Sidebar', 'twentyfourteen' ), 'id' => 'sidebar-2', 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Header Widget Area', 'twentyfourteen' ), 'id' => 'sidebar-4', 'description' => __( 'Appears in the Custom Menu Header section of the site.', 'twentyfourteen' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Custom_Footer Widget Area', 'twentyfourteen' ), 'id' => 'sidebar-5', 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } remove_action( 'widgets_init', 'twentyfourteen_widgets_init', 11 ); add_action( 'widgets_init', 'twentyfourteen_cms3_widgets_init', 11 ); remove_action( 'welcome_panel', 'wp_welcome_panel' ); function your_welcome_panel() { print '

Welcome to the Badeyes 2014 Child Theme

Important! This Theme requires that you have the TwentyFourteen Theme installed.

If you haven\'t already done so you can see a mock up version of this site at www.badeyes.com/2014/ (opens in new window/tab).

This Child Theme has been optimized for screen reader users but should still be understanbable by those who dont, see changes below.

Visual Editor

If you use a screen reader then you will need to go to your Profile page and check the box "Disable the visual Editor" so that you can create Posts properly, you will quickly find out that it does not work very well if you dont.

Widgets

Screen reader users will also need to go to the Widgets page and check the "enable accessibility mode" in the "Screen Options" area in order to be able to add and edit Widgets.

Header Image

The ability to crop the image has been removed for a number of reasons:

Menus

This Child Theme has 3 possible Menus, there is a custom menu an Primary one, both are situated horizontally under the Header section and the Secondary one or "Side Menu" located in the left hand sidebar.

Neither These menus nor their corresponding "Skip Links" will appear unless you create and manage them in the Menus area.

You can see examples at www.badeyes.com/2014/ (opens in new window/tab)

Post Teaser Plugin

For accessibility reasons the Post Teaser Plugin comes bundled with this Theme and is edited accordingly so there is no need to install it again, you can however edit it as you would any other Plugin in the Admin area.

Note: If you do install and activate it you will not be able to access the Admin area and will have to use ftp to uninstal it or change its name.

If you do not wish to use it and know what you are doing then remove the corresponding code from the functions.php file or delete the "Post Teaser" folder from this Child Theme.

WordPress for Bad Eyes

If you are new to WordPress then you might find my book useful even if you dont use a screen reader you can buy it at www.wordpressforbadeyes.com(opens in new window/tab.

'; } add_action('welcome_panel','your_welcome_panel');