* @copyright 2015 Uitz-Mehler EDV-Dienstleistungen http://edv.uitz.net * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 or later * @version 1.0 */ if ( ! isset( $content_width ) ) { $content_width = 945; } if ( ! function_exists( 'bootflex_setup' ) ) : function bootflex_setup() { add_theme_support( 'menus' ); add_theme_support( 'automatic-feed-links'); $args = array( 'flex-height' => true, 'flex-width' => true, 'height' => 0, 'width' => 0, 'default-image' => get_template_directory_uri() . '/images/bg.png', 'uploads' => true, 'header-text' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', 'random-default' => false, 'default-text-color' => '#fff' ); add_theme_support( 'custom-header', $args ); add_theme_support( 'title-tag'); add_theme_support( 'default-image'); add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'widgets' ) ); register_default_headers( array( 'grid' => array( 'url' => get_template_directory_uri() . '/images/bg.png', 'thumbnail_url' => get_template_directory_uri() . '/images/bg.png', 'description' => _x( 'Grid', 'header image description', 'bootflex' ) ), )); add_filter( 'use_default_gallery_style', '__return_false' ); function bootflex_enqueue_comment_reply() { if ( get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'comment_form_before', 'bootflex_enqueue_comment_reply' ); function bootflex_add_editor_styles() { add_editor_style(); } add_action( 'admin_init', 'bootflex_add_editor_styles' ); add_action( 'widgets_init', 'theme_bootflex_widgets_init' ); function theme_bootflex_widgets_init() { register_sidebar(array( 'before_widget' => '', 'before_title' => '
a little. Full reference of things you can show/remove is here: http://rjpargeter.com/2009/09/removing-wordpress-wp_head-elements/ remove_action('wp_head', 'wp_generator');// Removes the WordPress version as a layer of simple security // Bootstrap Menu Support require_once('inc/wp_bootstrap_navwalker.php'); function register_my_menu() { register_nav_menu('header-menu',__( 'Header Menu', 'bootflex' )); } add_action( 'init', 'register_my_menu' ); // Language Support add_action('after_setup_theme', 'my_theme_setup'); function my_theme_setup(){ load_theme_textdomain('bootflex', get_template_directory() . '/lang'); } require get_template_directory() . '/inc/customizer.php'; add_filter( 'the_content_more_link', 'modify_read_more_link' ); function modify_read_more_link() { return ' …' . __('Read more', 'bootflex') . ' '; } add_filter('get_avatar','add_gravatar_class'); function add_gravatar_class($class) { $class = str_replace("class='avatar", "class='avatar img-rounded", $class); return $class; } //function qot_add_editor_styles() { //add_editor_style( 'custom-editor-style.css' ); //} //add_action( 'admin_init', 'qot_add_editor_styles' ); /** * Breadcrumbs * * Prints full Bootstrap compatible HTML for breadcrumbs * */ function bootflex_breadcrumbs() { global $post; echo ''; } /** * Adds pagecount to breadcrumbs if needed * * @return string */ function bootflex_breadcrumbs_paged(){ $bootflex_myreturn = ''; if ( get_query_var('paged') ) { if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) $bootflex_myreturn .= ' ('; $bootflex_myreturn .= __('Page','bootflex') . ' ' . get_query_var('paged'); if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) $bootflex_myreturn .= ')'; } return $bootflex_myreturn; } /** * Adds Glyphs to known Widgets * * @param strin $title * @return string */ function widget_title_glyph( $title ) { if(!$title){ return '';} if( $title == "Categories" OR $title == "Kategorien") { return ' ' . $title; } elseif( $title == "Archive" OR $title == "Archives" ) { return ' ' . $title; } elseif( $title == "Letzte Beiträge" OR $title == "Recent Posts" ) { return ' ' . $title; } elseif( $title == "Letzte Kommentare" OR $title == "Recent Comments" ) { return ' ' . $title; } elseif( $title == "Schlagwörter" OR $title == "Tags" ) { return ' ' . $title; } elseif( $title == "Seiten" OR $title == "Pages" ) { return ' ' . $title; } elseif( $title == "Kalender" OR $title == "Calendar") { return ' ' . $title; } elseif( $title == "Meta") { return ' ' . $title; } elseif( strpos($title,'.com') OR strpos($title,'RSS') OR strpos($title,'.net') OR strpos($title,'.org') OR strpos($title,'.at') OR strpos($title,'.de')) { return ' ' . $title; } else { return ' ' . $title; } } add_filter( 'widget_title', 'widget_title_glyph' ); /** * Get first post with thumbs for frontpage * * @return Object Object with only one post */ function bootflex_get_first(){ $args = array( 'posts_per_page' => 1, 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish', 'post__not_in' => get_option( 'sticky_posts' ), 'meta_query' => array(array( 'key' => '_thumbnail_id', 'value' => '', 'compare' => '!=', )) ); $firstpost = new WP_Query( $args ); $posttemp = new stdClass(); $posttemp->post_id = $firstpost->post->ID; $posttemp->post_date = $firstpost->post->post_date; $posttemp->title = $firstpost->post->post_title; $thumb_id = (int)get_post_thumbnail_id($firstpost->post->ID); $posttemp->image = wp_get_attachment_image_src( $thumb_id, 'bootflex-image'); $posttemp->content = wp_trim_words( $firstpost->post->post_content,18, ' …' . __('Read more', 'bootflex') . ' ' ); $posttemp->link = get_permalink($firstpost->post->ID); return $posttemp; } //only load contact form 7 on contact page // http://fredrikmalmgren.com/only-include-contact-form-7-javascript-and-css-when-needed/ add_action( 'wp_print_scripts', 'deregister_cf7_javascript', 100 ); function deregister_cf7_javascript() { if ( !is_page(110) ) { wp_deregister_script( 'contact-form-7' ); } } add_action( 'wp_print_styles', 'deregister_cf7_styles', 100 ); function deregister_cf7_styles() { if ( !is_page(110) ) { wp_deregister_style( 'contact-form-7' ); } } function is_login_page() { return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php')); } //load jquery in the footer function jquery_in_footer() { if (!is_admin() AND ! is_login_page()) { wp_deregister_script('jquery'); // load the local copy of jQuery in the footer wp_register_script('jquery', home_url(trailingslashit(WPINC) . 'js/jquery/jquery.js'), array(), null, true); wp_enqueue_script('jquery'); } } add_action('init', 'jquery_in_footer'); // load scripts function bootflex_scripts() { $bootflex_subtheme = get_option( 'bootflex_subtheme_select' ); if(!$bootflex_subtheme){ $bootflex_subtheme = get_template_directory_uri() . '/assets/css/bootstrap.min.css'; } if( get_option( 'bootflex_font_awesome_cdn_select' )){ $bootflex_font_awesome = 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css'; } else { $bootflex_font_awesome = get_template_directory_uri() . '/assets/css/font-awesome.min.css'; } wp_enqueue_style( 'bootflex', get_stylesheet_uri() , array('bootstrap') ); wp_enqueue_style( 'bootstrap', $bootflex_subtheme ); wp_enqueue_style( 'fontawesome', $bootflex_font_awesome ); wp_enqueue_script( 'jquery', '', array( ) , FALSE , TRUE); wp_enqueue_script( 'bootstrapjs', get_template_directory_uri() . '/assets/scripts/bootstrap.min.js', array( 'jquery' ) , FALSE , TRUE); wp_enqueue_script( 'generaljs', get_template_directory_uri() . '/assets/scripts/general.js', array( 'bootstrapjs' ) , FALSE , TRUE); } add_action( 'wp_enqueue_scripts', 'bootflex_scripts' ); //buddypress compatibel
comment_approved == '0' ) : ?>