'e6e6e6')); Add_Theme_Support('post-thumbnails' ); Set_Post_Thumbnail_Size( 624, 9999 ); //Add_Image_Size('header-image', get_custom_header()->width, get_custom_header()->height, True); Add_Image_Size('header-image', 1040, 300, True); Add_Image_Size('preview-thumb', 200, 200, True); Add_Image_Size('preview-gallery', 300, 250, True); } function Filter_The_Title($title){ If (Empty($title)) return SPrintF($this->t('%s from %s'), __('Post'), Get_The_Date()); Else return $title; } function Filter_Excerpt_Length($lenght){ Return 40; } function Filter_Shortcode_Atts_Gallery($attributes){ $attributes['size'] = 'preview-gallery'; return $attributes; } function Add_Admin_Menu_Style(){ WP_Register_Style('ability_adminmenu_style', get_template_directory_uri().'/css/style-adminmenu.css', false, '1.0'); WP_Enqueue_Style('ability_adminmenu_style'); } function Add_Dashboard_Meta_Box(){ Add_Meta_Box( 'dashboard-support-widget', $this->t('WordPress Support'), Array($this, 'Print_Dashboard_Support_Widget'), 'dashboard', 'normal', 'high' ); } function Print_Dashboard_Support_Widget() { ?>
<?php echo $this->t('WordPress Support') ?>
t('Thank you for using our WordPress Theme %1$s. If you need support for this theme or if you need help with your WordPress website feel free to contact us. Among other services we provide:'), $this->theme_name) ?>
%3$s', $this->t('http://ulrikeseddig.de/en/wordpress-services/'), $this->t('Contact Ulrike Seddig WordPress Consulting'), $this->t('Get in touch')) ?>
t('Theme by ').'Ulrike Seddig'.' | %5$s', $this->t('http://ulrikeseddig.de/en/'), $this->t('Ulrike Seddig WordPress Consulting'), $this->t('http://ulrikeseddig.de/en/wordpress-themes/ability/'), $this->t('WordPress Theme Ability'), $this->t('Help') ); return $footer_text; } function Locate_File_Uri ($file){ If (SubStr($file, 0, 1) != '/') $file = '/' . $file; If (File_Exists(get_stylesheet_directory() . $file)) return get_stylesheet_directory_uri() . $file; ElseIf (File_Exists(get_template_directory() . $file)) return get_template_directory_uri() . $file; Else return False; } function Load_TextDomain(){ $locale = Apply_Filters( 'theme_locale', get_locale(), __CLASS__ ); load_textdomain (__CLASS__, DirName(__FILE__).'/language/' . $locale . '.mo'); } function t ($text, $context = ''){ // Translates the string $text with context $context If ($context == '') return __ ($text, __CLASS__); Else return _x ($text, $context, __CLASS__); } function Register_Menus(){ register_nav_menu('primary', $this->t('Primary Menu')); register_nav_menu('footer', $this->t('Footer Menu')); } function Filter_Banner_Image($header_image){ If (is_singular() && has_post_thumbnail()) { $featured_image_id = get_post_thumbnail_id(); $featured_image_url = WP_Get_Attachment_Image_Src($featured_image_id, 'header-image'); return $featured_image_url[0]; } return $header_image; } function Custom_Header_Setup() { $args = array( 'default-text-color' => '444', 'default-image' => '', 'height' => 300, 'width' => 1040, 'max-width' => 1040, 'flex-height' => false, 'flex-width' => false, 'random-default' => false, 'wp-head-callback' => Array($this, 'header_style'), 'admin-head-callback' => Array($this, 'admin_header_style'), 'admin-preview-callback' => Array($this, 'admin_header_image'), ); add_theme_support( 'custom-header', $args ); } function Header_Style() { $text_color = get_header_textcolor(); If ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) return; ?>

onclick="return false;" href="">

>

t('on', 'Open Sans font: on or off')) { $subsets = 'latin,latin-ext'; $subset = $this->t('no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)'); if ( 'cyrillic' == $subset ) $subsets .= ',cyrillic,cyrillic-ext'; elseif ( 'greek' == $subset ) $subsets .= ',greek,greek-ext'; elseif ( 'vietnamese' == $subset ) $subsets .= ',vietnamese'; $protocol = is_ssl() ? 'https' : 'http'; $query_args = array( 'family' => 'Open+Sans:400italic,700italic,400,700', 'subset' => $subsets, ); wp_enqueue_style( 'ability-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null ); } wp_enqueue_style( 'ability-style', get_stylesheet_uri() ); } function WP_Title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( $this->t('Page %s'), max( $paged, $page ) ); return $title; } function Page_Menu_Args( $args ) { if ( ! isset( $args['show_home'] ) ) $args['show_home'] = true; return $args; } function Widgets_Init() { register_sidebar( array( 'name' => $this->t('Main Sidebar'), 'id' => 'sidebar-1', 'description' => $this->t('Appears on posts and pages except the optional Footer Widget template, which has its own widgets.'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => $this->t( 'Blog Sidebar'), 'id' => 'sidebar-2', 'description' => $this->t('Appears on all archive pages including the blog page.'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => $this->t( 'Post Sidebar'), 'id' => 'sidebar-3', 'description' => $this->t('Appears only on single view of posts.'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => $this->t('First Footer Widget Area'), 'id' => 'sidebar-4', 'description' => $this->t('Appears below the main content when using the optional Footer Widget template.'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => $this->t('Second Footer Widget Area'), 'id' => 'sidebar-5', 'description' => $this->t('Appears below the main content when using the optional Footer Widget template.'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => $this->t('Third Footer Widget Area'), 'id' => 'sidebar-6', 'description' => $this->t('Appears below the main content when using the optional Footer Widget template.'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => $this->t('Fourth Footer Widget Area'), 'id' => 'sidebar-7', 'description' => $this->t('Appears below the main content when using the optional Footer Widget template.'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } function Content_Nav( $html_id ) { global $wp_query; $html_id = esc_attr( $html_id ); if ( $wp_query->max_num_pages > 1 ) : ?> comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    t('Pingback:'); ?> t('(Edit)'), '', '' ); ?>

  • id="li-comment-">
    %1$s %2$s', get_comment_author_link(), // If current post author is also comment author, make it known visually. ( $comment->user_id === $post->post_author ) ? ' ' . $this->t( 'Post author') . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( $this->t('%1$s at %2$s'), get_comment_date(), get_comment_time() ) ); ?>
    comment_approved ) : ?>

    t('Your comment is awaiting moderation.'); ?>

    t('Edit'), '' ); ?>
    $this->t('Reply'), 'after' => ' ', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    t(', ')); // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', $this->t(', ')); $date = sprintf( '', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $author = sprintf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( $this->t('View all posts by %s'), get_the_author() ) ), get_the_author() ); // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. if ( $tag_list ) { $utility_text = $this->t('This entry was posted in %1$s and tagged %2$s on %3$s by %4$s.'); } elseif ( $categories_list ) { $utility_text = $this->t('This entry was posted in %1$s on %3$s by %4$s.'); } else { $utility_text = $this->t('This entry was posted on %3$s by %4$s.'); } printf( $utility_text, $categories_list, $tag_list, $date, $author ); } function Body_Class( $classes ) { $background_color = get_background_color(); if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) $classes[] = 'full-width'; if ( is_page_template( 'page-templates/front-page.php' ) ) { $classes[] = 'template-front-page'; if ( has_post_thumbnail() ) $classes[] = 'has-post-thumbnail'; if ( is_active_sidebar( 'sidebar-3' ) && is_active_sidebar( 'sidebar-4' ) ) $classes[] = 'two-sidebars'; } if ( empty( $background_color ) ) $classes[] = 'custom-background-empty'; elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) $classes[] = 'custom-background-white'; // Enable custom font class only if the font CSS is queued to load. if ( wp_style_is( 'ability-fonts', 'queue' ) ) $classes[] = 'custom-font-enabled'; if ( ! is_multi_author() ) $classes[] = 'single-author'; return $classes; } function Content_Width() { if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { global $content_width; $content_width = 960; } } function Customize_Register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; } function Customize_Preview_JS() { wp_enqueue_script( 'ability-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true ); } function Custom_Excerpt_More( $more ) { return '...'; } } $THEME = New Theme_Ability;