__( 'Header Menu' ) ) ); } add_action( 'init', 'register_my_menus' ); if ( function_exists('register_sidebar') ){ register_sidebar(array( 'name' => 'powiazane posty', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '', 'after_title' => '', )); } remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'rsd_link'); function enqueue_styles() { if(ICL_LANGUAGE_CODE == 'ru'){ //russian style wp_enqueue_style( 'style-ru', get_template_directory_uri() . "/style-ru.css", array(), null ); } } add_action( 'wp_enqueue_scripts', 'enqueue_styles' ); add_action( 'wp_enqueue_scripts', 'enqueue_scroll_animations' ); function enqueue_scroll_animations() { wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' ); wp_enqueue_script( 'jack-in-the-box', get_stylesheet_directory_uri() . '/js/jack-in-the-box.js', array( 'jquery' ), '', true ); wp_enqueue_script( 'jack-in-the-box-init', get_stylesheet_directory_uri() . '/js/jack-in-the-box-init.js', array( 'jack-in-the-box' ), '1.0.0', true ); wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/waypoints.min.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'waypoints-init', get_stylesheet_directory_uri() .'/js/waypoints-init.js' , array( 'jquery', 'waypoints' ), '1.0.0' ); } function get_excerpt(){ $excerpt = get_the_content(); $excerpt = preg_replace(" (\[.*?\])",'',$excerpt); $excerpt = strip_shortcodes($excerpt); $excerpt = strip_tags($excerpt); $excerpt = substr($excerpt, 0, 400); $excerpt = substr($excerpt, 0, strripos($excerpt, " ")); $excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt)); return $excerpt; } add_filter('show_admin_bar', '__return_false'); function bm_dont_display_it($content) { if (!empty($content)) { $content = str_ireplace('
  • ' .__( "No categories" ). '
  • ', "", $content); } return $content; } add_filter('wp_list_categories','bm_dont_display_it'); /* LOGO */ function custom_login_logo() { echo ' '; } add_action('login_head', 'custom_login_logo'); function logo_url(){ return (home_url()); } add_filter('login_headerurl', 'logo_url'); function custom_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); add_action( 'admin_menu', 'remove_menu_pages' ); function remove_menu_pages() { remove_menu_page('edit-comments.php'); // Komentarze } add_filter( 'nav_menu_css_class', 'check_for_submenu', 10, 3); function check_for_submenu($classes, $item) { global $wpdb; $has_children = $wpdb->get_var("SELECT COUNT(meta_id) FROM bossi_postmeta WHERE meta_key='_menu_item_menu_item_parent' AND meta_value='".$item->ID."'"); if ($has_children > 0) array_push($classes,'menu-parent-item'); return $classes; } add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 3); function special_nav_class($classes, $item){ if( in_array('current-menu-item', $classes) ){ $classes[] = 'current_page_item_two a'; } return $classes; } //Paginacja różna ilość wpisów na kategorię function wpse47875_change_posts_per_page( $query ) { //Only alter main query. This only works for 3.3+ if( ! $query->is_main_query() ) return; if ( is_category('13') ){ //Display 5 posts for category 1 $query->set( 'posts_per_page', 2); } } add_action('pre_get_posts', 'wpse47875_change_posts_per_page', 1); function remove_more_link_scroll( $link ) { $link = preg_replace( '|#more-[0-9]+|', '', $link ); return $link; } add_filter( 'the_content_more_link', 'remove_more_link_scroll' ); /** * Define a constant path to our single template folder */ define(SINGLE_PATH, TEMPLATEPATH . ''); /** * Filter the single_template with our custom function */ add_filter('single_template', 'my_single_template'); /** * Single template function which will choose our template */ function my_single_template($single) { global $wp_query, $post; /** * Checks for single template by ID */ if(file_exists(SINGLE_PATH . '/single-' . $post->ID . '.php')) return SINGLE_PATH . '/single-' . $post->ID . '.php'; /** * Checks for single template by category * Check by category slug and ID */ foreach((array)get_the_category() as $cat) : if(file_exists(SINGLE_PATH . '/single-cat-' . $cat->slug . '.php')) return SINGLE_PATH . '/single-cat-' . $cat->slug . '.php'; elseif(file_exists(SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php')) return SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php'; endforeach; /** * Checks for default single post files within the single folder */ if(file_exists(SINGLE_PATH . '/single.php')) return SINGLE_PATH . '/single.php'; elseif(file_exists(SINGLE_PATH . '/default.php')) return SINGLE_PATH . '/default.php'; return $single; } /** * Tests if any of a post's assigned categories are descendants of target categories * * @param int|array $cats The target categories. Integer ID or array of integer IDs * @param int|object $_post The post. Omit to test the current post in the Loop or main query * @return bool True if at least 1 of the post's categories is a descendant of any of the target categories * @see get_term_by() You can get a category by name or slug, then pass ID to this function * @uses get_term_children() Passes $cats * @uses in_category() Passes $_post (can be empty) * @version 2.7 * @link http://codex.wordpress.org/Function_Reference/in_category#Testing_if_a_post_is_in_a_descendant_category */ if ( ! function_exists( 'post_is_in_descendant_category' ) ) { function post_is_in_descendant_category( $cats, $_post = null ) { foreach ( (array) $cats as $cat ) { // get_term_children() accepts integer ID only $descendants = get_term_children( (int) $cat, 'category' ); if ( $descendants && in_category( $descendants, $_post ) ) return true; } return false; } } function new_subcategory_hierarchy() { $category = get_queried_object(); $parent_id = $category->category_parent; $templates = array(); if ( $parent_id == 0 ) { // Use default values from get_category_template() $templates[] = "category-{$category->slug}.php"; $templates[] = "category-{$category->term_id}.php"; $templates[] = 'category.php'; } else { // Create replacement $templates array $parent = get_category( $parent_id ); // Current first $templates[] = "category-{$category->slug}.php"; $templates[] = "category-{$category->term_id}.php"; // Parent second $templates[] = "category-{$parent->slug}.php"; $templates[] = "category-{$parent->term_id}.php"; $templates[] = 'category.php'; } return locate_template( $templates ); } add_filter( 'category_template', 'new_subcategory_hierarchy' ); // Generate the current-cat class when viewing single posts class singlePostCurrentCat { function wp_list_categories ($text) { global $post; if (is_singular()) { $categories = wp_get_post_categories($post->ID); foreach ($categories as $category_id) { $category = get_category($category_id); $text = preg_replace( "/class=\"(.*)\">]*)>$category->name<\/a>/", ' class="$1 current-cat">' . $category->name . '', $text); } } return $text; } } add_filter('wp_list_categories', array('singlePostCurrentCat','wp_list_categories')); ?> Strona nie została znaleziona – Krewel Meuselbach – ekspert od przeziębień
    Uwolnij oskrzela

    Uwolnij Oskrzela

    Preparaty na kaszel
    Uwolnij nos

    Uwolnij Nos

    Preparaty na katar
    Uwolnij gardło

    Uwolnij Gardło

    Preparaty na gardło
      1, 'posts_per_page' => 1 ); ?> have_posts()) : $glowna_akt->the_post(); $count++; ?>
    • więcej