General. This data is retrieved from the 'blogname' record in the wp_options table. 'description' - Returns the 'Tagline' set in Settings > General. This data is retrieved from the 'blogdescription' record in the wp_options table. 'wpurl' - Returns the 'WordPress address (URL)' set in Settings > General. This data is retrieved from the 'siteurl' record in the wp_options table. Consider using site_url() instead. 'siteurl' / 'home (note this is deprecated! from version 2.2)' / 'url' - Returns the 'Site address (URL)' set in Settings > General. This data is retrieved from the 'home' record in the wp_options table. Consider using home_url() instead. 'admin_email' - Returns the 'E-mail address' set in Settings > General. This data is retrieved from the 'admin_email' record in the wp_options table. 'charset' - Returns the 'Encoding for pages and feeds' set in Settings > Reading. This data is retrieved from the 'blog_charset' record in the wp_options table. 'version' - Returns the WordPress Version you use. This data is retrieved from the '$wp_version' variable set in wp-includes/version.php. 'html_type' - Returns the Content-Type of WordPress HTML pages (default: text/html). This data is retrieved from the 'html_type' record in the wp_options table. Themes and plugins can override the default value using the pre_option_html_type filter. 'text_direction' - Returns the Text Direction of WordPress HTML pages. Consider using is_rtl() instead. 'language' - Returns the language of WordPress. 'stylesheet_url' - Returns the primary CSS (usually style.css) file URL of the active theme. Consider using get_stylesheet_uri() instead. 'stylesheet_directory' - Returns the stylesheet directory URL of the active theme. (Was a local path in earlier WordPress versions.) Consider using get_stylesheet_directory_uri() instead. 'template_url' / 'template_directory' - URL of the active theme's directory ('template_directory' was a local path before 2.6; see get_theme_root() and get_template() for hackish alternatives.) Within child themes, both get_bloginfo('template_url') and get_template() will return the parent theme directory. Consider using get_template_directory_uri() instead (for the parent template directory) or get_stylesheet_directory_uri() (for the child template directory). 'pingback_url' - Returns the Pingback XML-RPC file URL (xmlrpc.php). 'atom_url' - Returns the Atom feed URL (/feed/atom). 'rdf_url' - Returns the RDF/RSS 1.0 feed URL (/feed/rfd). 'rss_url' - Returns the RSS 0.92 feed URL (/feed/rss). 'rss2_url' - Returns the RSS 2.0 feed URL (/feed). 'comments_atom_url' - Returns the comments Atom feed URL (/comments/feed). 'comments_rss2_url' - Returns the comments RSS 2.0 feed URL (/comments/feed). */ // Set the content width based on the theme's design and stylesheet. if ( ! isset( $content_width ) ){ $content_width = 600; } // Make the Theme available for translation. Translations can be added to the /languages/ directory. load_theme_textdomain( 'steffenhollstein_loc', get_template_directory() . '/languages' ); // Include Theme Options require( get_template_directory() . '/inc/theme-options.php' ); if( function_exists('register_sidebar') ){ register_sidebar(); } add_action( 'after_setup_theme', 'customThemeSetup' ); if( ! function_exists( 'customThemeSetup' ) ): function customThemeSetup() { // localization files created with poEdit (http://www.poedit.net/) load_theme_textdomain( 'steffenhollstein_loc', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if( is_readable( $locale_file ) ){ require_once( $locale_file ); } // Add default posts and comments RSS feed links to . add_theme_support( 'automatic-feed-links' ); add_theme_support('post-thumbnails'); define('AVATAR_GUEST_SIZE', 32); define('AVATAR_AUTHOR_SIZE', 48); } endif; function textcount($text, $count, $divider = '|') { /* * Check if the text containts braces [] and save it to * $parts - use the whole text when no braces are defined * * $orig_replace: Copy for the braces text (incl. braces) * for later use */ if(preg_match('/\[(.*?)\]/', $text, $matches)) { $orig_replace = $matches[0]; $parts = $matches[1]; } else { $parts = $orig_replace = $text; } $fragments = explode($divider, $parts); /* * When there are just two arguments, take the * second parameter ($fragments[1]) as zero-text. */ if(count($fragments) == 2) $fragments = array_pad($fragments, -(count($fragments) + 1), $fragments[1]); /* * Get text for the amount */ if($count <= 0) { $return_text = $fragments[0]; } elseif( $count == 1) { $return_text = $fragments[1]; } elseif( $count > 1) { $return_text = str_replace('%n', number_format($count), $fragments[2]); } /* * Replace the text between the braces [] and return */ return str_replace($orig_replace, $return_text, $text); } // Artikel: http://wp-anpassen.de/wp-tutorials/anzahl-der-artikel-seiten-und-custom-post-types-in-wordpress-ausgeben/ function currentCountPosts(){ $count = wp_count_posts()->publish; return $count; } function currentCountPages(){ $count = wp_count_posts('page')->publish; return $count; } function currentCountCategorys(){ $count = sizeof( get_categories($args) ); return $count; } function shift_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
  • >
    $depth, 'max_depth' => $args['max_depth']); ?>
    ', '' ); ?>
    comment_approved == '0' ) : ?>
  • : ', '' ); ?>

    max_num_pages; if( !$pages ){ $pages = 1; } } if( 1 != $pages ){ echo ''; } } function getSiteContext(){ /* Example: ----------------------- */ $context = 'index'; if( is_front_page() ) { // Front Page $context = 'front-page'; } else if( is_date() ) { // Date Archive Index $context = 'date'; } else if( is_author() ) { // Author Archive Index $context = 'author'; } else if( is_category() ) { // Category Archive Index $context = 'category'; } else if( is_tag() ) { // Tag Archive Index $context = 'tag'; } else if( is_tax() ) { // Taxonomy Archive Index $context = 'taxonomy'; } else if( is_archive() ) { // Archive Index $context = 'archive'; } else if( is_search() ) { // Search Results Page $context = 'search'; } else if( is_404() ) { // Error 404 Page $context = '404'; } else if( is_attachment() ) { // Attachment Page $context = 'attachment'; } else if( is_single() ) { // Single Blog Post $context = 'single'; } else if( is_page() ) { // Static Page $context = 'page'; } else if( is_home() ) { // Blog Posts Index $context = 'home'; } return $context; } function metaPageTitle(){ if( is_single() || is_page() ){ single_post_title(); echo ' | '; bloginfo( 'name' ); } else { if( is_category() || is_archive() ){ wp_title(''); echo ' auf '; bloginfo( 'name' ); } else { if( is_front_page() || is_home() ){ bloginfo('name'); echo ' | '; bloginfo( 'description' ); } else { wp_title(''); //echo ' | by creative! '; } } } } function metaKeyWords(){ $posttags = get_the_tags(); if( $posttags) { foreach($posttags as $tag) { echo $tag->name . ' '; } } } function metaDescription(){ $metaDescription = get_bloginfo('description'); $metaDescriptionRSS = ( is_home() ? "" : get_the_excerpt() ); if( $metaDescriptionRSS == '' ){ $metaDescriptionRSS = $metaDescription; } echo $metaDescriptionRSS; } function getCurrentYear(){ /* Example: ----------------------- */ setlocale( LC_TIME, 'de_DE' ); $currentYear = strftime("%Y"); return $currentYear; } // get current author function getCurrentAuthor( $author ) { /* Example: ----------------------- */ $authorLength = 0; if( $author != "" ){ $authorLength = strlen($author); if( $authorLength > 13 ){ $getAuthorsFirstnameLastname = preg_split( "/[\s,]+/", $author ); $author = ""; foreach( $getAuthorsFirstnameLastname as $i => $value ){ $author = $author . substr( $getAuthorsFirstnameLastname[$i], 0, 1 ) . '.'; } } } return $author; } // check that post conatin images function containCurrentPostImages( $currentPost ) { /* Example: ---------------------------- $postHasImage = containCurrentPostImages( $post->post_content ); if( $postHasImage ){ // do something } */ $hasImages = false; $searchimages = '~]* />~'; /*Run preg_match_all to grab all the images and save the results in $pics*/ preg_match_all( $searchimages, $currentPost, $pics ); // Check to see if we have at least 1 image $iNumberOfPics = count($pics[0]); if ( $iNumberOfPics > 0 ) { $hasImages = true; } return $hasImages; } // Filter zum des Kommentarformulars /*function customFormFields($fields) { // Text des Namensfeldes ändern $fields['author'] = '
    ' . '
    '; // Text des E-Mail-Feldes ändern $fields['email'] = '
    ' . '
    '; // Text des Webseitenfeldes ändern $fields['url'] = '
    ' . '
    '; return $fields; } add_filter( 'comment_form_default_fields', 'customFormFields' );*/ /* Aufruf comments.php: $comments_args = array( // remove "Text or HTML to be displayed after the set of comment fields" //'comment_notes_after' => '', //'label_submit' => 'Send', // redefine your own textarea (the comment body) 'comment_field' => '
    ', ); comment_form($comments_args); */ // add custom class to posts /*function customPostsClasses( $classes ) { $classes[] = 'globalBoxShadow-10'; return $classes; } add_filter( 'post_class', 'customPostsClasses' );*/ // add custom class to body function customBodyClasses( $classes ) { if( function_exists( 'getSiteContext' ) ){ $classes[] = 'pagetype_' . getSiteContext(); } return $classes; } add_filter( 'body_class', 'customBodyClasses' ); ?>