Clean up and name prefixing

This commit is contained in:
Mike Francis 2014-08-07 10:54:20 +01:00
parent 37f1eca74a
commit 85be4a104f
1 changed files with 42 additions and 13 deletions

View File

@ -1,6 +1,8 @@
<?php
// Add support for useful stuff
/*
* Add support for useful stuff
*/
add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-formats', array( 'post' ) );
@ -8,7 +10,10 @@ add_theme_support( 'custom-header' );
add_theme_support( 'custom-background' );
add_post_type_support( 'page', 'excerpt' );
// Remove junk
/*
* Remove junk
*/
add_filter('show_admin_bar', '__return_false');
@ -20,35 +25,43 @@ remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
function remove_comments_rss( $for_comments ) {
function barebones_remove_comments_rss( $for_comments ) {
return;
}
add_filter( 'post_comments_feed_link', 'remove_comments_rss' );
add_filter( 'post_comments_feed_link', 'barebones_remove_comments_rss' );
// jQuery the right way
function theme_scripts() {
/*
* jQuery the right way
*/
function barebones_scripts() {
// If you need 'em
// wp_enqueue_style( 'fonts', '//fonts.googleapis.com/css?family=Font+Family:Weight' );
// wp_enqueue_style( 'fonts', '//fonts.googleapis.com/css?family=Font+Family' );
// wp_enqueue_style( 'icons', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css' );
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js', false, '1.11.1', true );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'script', get_stylesheet_directory_uri() . '/script.js', array( 'jquery' ), null, true );
wp_enqueue_script( 'bxSlider', get_stylesheet_directory_uri() . '/js/jquery.bxslider.min.js', array( 'jquery' ), null, true );
wp_enqueue_script( 'script', get_stylesheet_directory_uri() . '/js/script.js', array( 'jquery' ), null, true );
}
add_action( 'wp_enqueue_scripts', 'theme_scripts' );
add_action( 'wp_enqueue_scripts', 'barebones_scripts' );
// Nav menus
if ( function_exists( 'register_nav_menus' ) )
/*
* Nav menus
*/
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(array(
'header' => 'Header',
'footer' => 'Footer'
));
}
function wp_nav_menu_args( $args = '' ) {
function barebones_nav_menu_args( $args = '' ) {
$args['container'] = false;
$args['container_class'] = false;
$args['menu_id'] = false;
@ -56,4 +69,20 @@ function wp_nav_menu_args( $args = '' ) {
return $args;
}
add_filter( 'wp_nav_menu_args', 'wp_nav_menu_args' );
add_filter( 'wp_nav_menu_args', 'barebones_nav_menu_args' );
/*
* Email
*/
function barebones_mail_from( $email ) {
return get_option( 'admin_email' );
}
add_filter( 'wp_mail_from', 'barebones_mail_from' );
function barebones_mail_from_name( $name ) {
return get_bloginfo( 'name' );
}
add_filter( 'wp_mail_from_name', 'barebones_mail_from_name' );