',
));
// Footer Left
register_sidebar(array('name'=>'Footer Links',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
));
// Footer Middle
register_sidebar(array('name'=>'Footer Mitte',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
));
// Footer Right
register_sidebar(array('name'=>'Footer Rechts',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
));
// Alternating widget headers
function head_class($params) {
global $widget_num;
// Widget class
$class = array();
// Iterated class
$widget_num++;
// Alt class
if ($widget_num == 1) :
$class[] = 'one';
elseif ($widget_num == 2) :
$class[] = 'two';
else :
$class[] = 'three';
endif;
if ($widget_num == 3) : $widget_num = 0; endif;
// Join the classes in the array
$class = join(' ', $class);
// Interpolate the 'head_class' placeholder
$params[0]['before_title'] = str_replace('head_class', $class, $params[0]['before_title']);
return $params;
}
add_filter('dynamic_sidebar_params', 'head_class');
// post thumbnail support
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 80, 80, true );
// custom menu support
add_theme_support( 'menus' );
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'header_menu' => 'Header MenŸ',
'sidebar_menu' => 'Sidebar MenŸ',
)
);
}
// enable threaded comments
function enable_threaded_comments(){
if (!is_admin()) {
if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
wp_enqueue_script('comment-reply');
}
}
add_action('get_header', 'enable_threaded_comments');
// removes detailed login error information for security
add_filter('login_errors',create_function('$a', "return null;"));
// Removes Trackbacks from the comment count
add_filter('get_comments_number', 'comment_count', 0);
function comment_count( $count ) {
if ( ! is_admin() ) {
global $id;
$comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
return count($comments_by_type['comment']);
} else {
return $count;
}
}
// custom excerpt ellipses for 2.9+
function custom_excerpt_more($more) {
return 'Weiterlesen »';
}
add_filter('excerpt_more', 'custom_excerpt_more');
// no more jumping for read more link
function no_more_jumping($post) {
return '
'.'Weiterlesen »'.'';
}
add_filter('excerpt_more', 'no_more_jumping');
// category id in body and post class
function category_id_class($classes) {
global $post;
foreach((get_the_category($post->ID)) as $category)
$classes [] = 'cat-' . $category->cat_ID . '-id';
return $classes;
}
add_filter('post_class', 'category_id_class');
add_filter('body_class', 'category_id_class');
// A Function that output's the current page's URL
// Used in the canonical link within the header but can be used elsewhere
// output with: echo curPageURL();
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>