'Main Menu',
'footer_menu' => 'Footer Menu'
));
/** Add custom theme header, background, post formats, and etc...
* http://codex.wordpress.org/Function_Reference/add_theme_support
* **/
/*
* This theme does not style the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
* Uncomment line below to add your own styles to the editor.
*/
add_editor_style( array( 'css/editor-style.css') );
// Adds RSS feed links to
for posts and comments.
add_theme_support( 'automatic-feed-links' );
// Switches default core markup for search form, comment form, and comments
// to output valid HTML5.
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list'));
/*
* This theme uses a custom image size for featured images, displayed on
* "standard" posts and pages.
*/
add_theme_support('post-thumbnails');
set_post_thumbnail_size(690, 300, true);
// This theme uses BigGallery instead of WordPress default gallerys.
add_filter('use_default_gallery_style', '__return_false');
// add custom metaboxs and save the data
add_action('add_meta_boxes', 'be_add_custom_box');
add_action('save_post', 'be_save_post');
}
}
/** remove unwanted elements from */
function be_head_cleanup() {
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
remove_action('wp_head', 'wp_generator');
}
add_action('init', 'be_head_cleanup');
/** remove script versions to enable caching */
function be_remove_script_version($src) {
$parts = explode('?', $src);
return $parts[0];
}
add_filter('script_loader_src', 'be_remove_script_version');
add_filter('style_loader_src', 'be_remove_script_version');
/**
* register scripts and styles
*/
function be_register_scripts_and_styles() {
if (!is_admin()) {
wp_register_style('style', get_stylesheet_uri(), false, '1.0', 'all');
// Compressed all JS files in scripts.min.js for fewer http calls:
// load the latest jQuery from theme library
// wp_deregister_script('jquery');
// wp_register_script('jquery', get_template_directory_uri() . '/js/jquery.js', false, '2.0.3', true);
// or load from Google CDN
// wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js', false, false, true);
// or load from WP included library
wp_register_script('jquery', false, false, false, true);
// Read more about wp_register_script at: http://codex.wordpress.org/Function_Reference/wp_register_script
wp_register_script('scripts', get_template_directory_uri() . '/js/scripts.min.js', array('jquery'), false, true);
wp_register_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery', 'scripts'), '1.0', true);
wp_register_script('comment-reply', false, false, false, true);
}
}
add_action('init', 'be_register_scripts_and_styles');
/**
* enqueue scripts
*/
function be_enqueue_scripts_and_styles() {
if (!is_admin()) {
wp_enqueue_style('style');
wp_enqueue_script('jquery');
wp_enqueue_script('scripts');
wp_enqueue_script('custom');
if (is_singular() AND comments_open() AND (get_option('thread_comments'))) {
wp_enqueue_script('comment-reply');
}
}
}
add_action('wp_enqueue_scripts', 'be_enqueue_scripts_and_styles');
/**
* filter p tags
*/
function filter_ptags_on_images($content) {
return preg_replace('/