'Sidebar',
'id' => 'blog-sidebar',
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => 'Footer Sidebar',
'id' => 'footer-sidebar',
'before_widget' => '',
'before_title' => '',
));
}
add_action( 'widgets_init', 'invert_widgets_init' );
/**
* Sets up theme defaults and registers the various WordPress features that
* Invert supports.
*
* @uses load_theme_textdomain() For translation/localization support.
* @uses add_editor_style() To add Visual Editor stylesheets.
* @uses add_theme_support() To add support for automatic feed links, post
* formats, and post thumbnails.
* @uses register_nav_menu() To add support for a navigation menu.
* @uses set_post_thumbnail_size() To set a custom post thumbnail size.
*
*/
function invert_theme_setup() {
/*
* Makes Invert available for translation.
*
* Translations can be added to the /languages/ directory.
* If you're building a theme based on Twenty Thirteen, use a find and
* replace to change 'invert' to the name of your theme in all
* template files.
*/
load_theme_textdomain( 'invert', get_template_directory() . '/languages' );
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// Adds RSS feed links to for posts and comments.
add_theme_support( 'automatic-feed-links' );
/*
* 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( 600, 220, true );
add_image_size( 'invert_standard_img',770,365,true); //standard size
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'Header' => __( 'Main Navigation', 'invert' ),
));
}
add_action( 'after_setup_theme', 'invert_theme_setup' );
/**
* Funtion to add CSS class to body
*/
function invert_add_class( $classes ) {
if ( 'page' == get_option( 'show_on_front' ) && ( '' != get_option( 'page_for_posts' ) ) && is_front_page() ) {
$classes[] = 'front-page';
}
return $classes;
}
add_filter( 'body_class','invert_add_class' );
/**
* Filter content with empty post title
*
*/
add_filter('the_title', 'invert_untitled');
function invert_untitled($title) {
if ($title == '') {
return __('Untitled','invert');
} else {
return $title;
}
}
function invert_nav() {
if( has_nav_menu( 'Header' ) ) {
wp_nav_menu(array( 'container_class' => 'ske-menu', 'container_id' => 'skenav', 'menu_id' => 'menu-main','theme_location' => 'Header' ));
}
else {
invert_nav_fallback();
}
}
function invert_nav_fallback() {
?>