* @copyright Copyright (c) 2013-2016, Arthur Gareginyan
* @link http://mycyberuniverse.com/anarcho-notepad.html
* @license http://www.gnu.org/licenses/gpl-3.0.html
*/
/* Ladies and Gentleman, boys and girls let's start our engine */
function anarcho_setup() {
global $content_width;
// Localization Init
load_theme_textdomain( 'anarcho-notepad', get_template_directory() . '/languages' );
// This feature enables Custom Backgrounds.
add_theme_support( 'custom-background', array(
'default-image' => get_template_directory_uri() . '/images/background.png', ) );
// This feature enables Custom Header.
add_theme_support( 'custom-header', array(
'flex-width' => true,
'width' => 500,
'flex-height' => true,
'height' => 150,
//'default-text-color' => '#e5e5e5',
'header-text' => true,
//'default-image' => get_template_directory_uri() . '/images/logotype.png',
'uploads' => true,
) );
// This feature enables Featured Images (also known as post thumbnails).
add_theme_support('post-thumbnails');
set_post_thumbnail_size(540,230,!1);
// This feature enables post and comment RSS feed links to
.
add_theme_support('automatic-feed-links');
// Add HTML5 elements
add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form', 'gallery', 'caption', ) );
// Add Title-tag
add_theme_support('title-tag');
// This feature enables menu.
register_nav_menus( array(
'primary' => __( 'Primary', 'anarcho-notepad' ) ));
// This feature enables Link Manager in Admin page.
add_filter( 'pre_option_link_manager_enabled', '__return_true' );
}
add_action('after_setup_theme', 'anarcho_setup');
//Adding backwards compatibility for title-tag less than WordPress version 4.1
if ( ! function_exists( '_wp_render_title_tag' ) ) {
function anarcho_render_title() {
?>
';
echo '';
echo '';
}
add_action('wp_head', 'anarcho_add_ie_html5_shim');
/* This feature enables widgets area in the sidebar */
function anarcho_widgets_init() {
register_sidebar(array(
'name' => __('Sidebar Area 1', 'anarcho-notepad'),
'id' => 'sidebar-1',
'description' => __('Widgets in this area will be shown below "Pages".', 'anarcho-notepad'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
register_sidebar(array(
'name' => __('Sidebar Area 2', 'anarcho-notepad'),
'id' => 'sidebar-2',
'description' => __('Widgets in this area will be shown below "What is this place".', 'anarcho-notepad'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
register_sidebar(array(
'name' => __('Sidebar Area 3', 'anarcho-notepad'),
'id' => 'sidebar-3',
'description' => __('Widgets in this area will be shown below "Friends & Links".', 'anarcho-notepad'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
register_sidebar(array(
'name' => __('Sidebar Area 4', 'anarcho-notepad'),
'id' => 'sidebar-4',
'description' => __('Widgets in this area will be shown below "Recent Posts".', 'anarcho-notepad'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
}
add_action( 'widgets_init', 'anarcho_widgets_init' );
/* This feature enables widgets area in the footer */
function anarcho_widgets_footer_init() {
register_sidebar(array(
'name' => __('Footer Area 1', 'anarcho-notepad'),
'id' => 'footer-1',
'description' => __('Widgets in this area will be shown left.', 'anarcho-notepad'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
register_sidebar(array(
'name' => __('Footer Area 2', 'anarcho-notepad'),
'id' => 'footer-2',
'description' => __('Widgets in this area will be shown center.', 'anarcho-notepad'),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
register_sidebar(array(
'name' => __('Footer Area 3', 'anarcho-notepad'),
'id' => 'footer-3',
'description' => __('Widgets in this area will be shown right.', 'anarcho-notepad'),
'before_widget' => '',
'before_title' => '