tag global $wp_query; $page = ''; if (is_front_page() ) { $page = 'home'; } elseif (is_page()) { $page = $wp_query->query_vars["pagename"]; } if ($page) echo 'class= "'. $page. '"'; } /** * Rename "Posts" to "News" * * @link http://new2wp.com/snippet/change-wordpress-posts-post-type-news/ */ add_action( 'admin_menu', 'pilau_change_post_menu_label' ); add_action( 'init', 'pilau_change_post_object_label' ); function pilau_change_post_menu_label() { global $menu; global $submenu; $menu[5][0] = 'Nyheter'; $submenu['edit.php'][5][0] = 'Nyheter'; echo ''; } function pilau_change_post_object_label() { global $wp_post_types; $labels = &$wp_post_types['post']->labels; $labels->name = 'Nyheter'; $labels->singular_name = 'Nyheter'; } /* JS Fallback to contact form 7 */ add_filter( 'wpcf7_support_html5_fallback', '__return_true' ); /* THE EXCERPT */ function new_excerpt_length($length) { return 15; } add_filter('excerpt_length', 'new_excerpt_length'); // Replaces the excerpt "more" text by a link function new_excerpt_more($more) { global $post; return ' Läs mer...'; } add_filter('excerpt_more', 'new_excerpt_more'); /* NO EMAIL FOR REG */ add_action( 'user_profile_update_errors', 'remove_empty_email_error' ); function remove_empty_email_error( $arg ) { if ( !empty( $arg->errors['empty_email'] ) ) unset( $arg->errors['empty_email'] ); } /* Secondary post thumbnail */ // Define additional "post thumbnails". Relies on MultiPostThumbnails to work if (class_exists('MultiPostThumbnails')) { $types = array('page', 'food_drinks', 'meetings', 'living', 'camping' ); /* 'landing_pages' adds support for landing pages CPT, 'post' adds support for blog single pages */ foreach($types as $type) { new MultiPostThumbnails(array('label' => '2nd Feature Image', 'id' => 'feature-image-2', 'post_type' => $type)); //new MultiPostThumbnails(array('label' => '3rd Feature Image', 'id' => 'feature-image-3', 'post_type' => $type)); //new MultiPostThumbnails(array('label' => '4th Feature Image', 'id' => 'feature-image-4', 'post_type' => $type)); //new MultiPostThumbnails(array('label' => '5th Feature Image', 'id' => 'feature-image-5', 'post_type' => $type)); } }; // make opening hours translatable add_filter('pll_get_post_types', 'my_pll_get_post_types2'); function my_pll_get_post_types2($types) { return array_merge($types, array('board' => 'board')); } add_action('init', 'my_custom_menus'); function my_custom_menus() { register_nav_menus( array( 'primary-menu' => __('Primary Menu') ) ); } add_theme_support( 'post-thumbnails' ); add_action( 'init', 'create_blurbs' ); function create_blurbs() { $args = array( 'label' => 'Blurbs', 'public' => false, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => 'leveranser'), 'query_var' => true, 'menu_icon' => 'dashicons-images-alt2', 'menu_position' => 5, 'taxonomies' => array('category'), 'supports' => array('title', 'editor', 'thumbnail') ); register_post_type( 'blurbs' , $args ); } add_action( 'init', 'create_deliveries' ); function create_deliveries() { $args = array( 'label' => 'Leveranser', 'public' => false, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => 'leveranser'), 'query_var' => true, 'menu_icon' => 'dashicons-images-alt2', 'menu_position' => 5, 'taxonomies' => array('category'), 'supports' => array('title', 'editor', 'thumbnail') ); register_post_type( 'deliveries' , $args ); } add_action( 'init', 'create_pellets' ); function create_pellets() { $args = array( 'label' => 'Pellets', 'public' => false, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'query_var' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-calendar-alt', 'supports' => array('title', 'editor', 'thumbnail') ); register_post_type( 'pellets' , $args ); } add_action( 'init', 'create_loggs' ); function create_loggs() { $args = array( 'label' => 'Loggs', 'public' => false, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'query_var' => true, 'menu_position' => 10, 'menu_icon' => 'dashicons-calendar-alt', 'supports' => array('title', 'editor', 'thumbnail') ); register_post_type( 'loggs' , $args ); } add_action( 'init', 'create_products' ); function create_products() { $args = array( 'label' => 'Produkter', 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'rewrite' => array('slug' => 'produkter'), 'hierarchical' => false, 'query_var' => true, 'menu_position' => 15, //'taxonomies' => array('post_tag', 'category'), 'menu_icon' => 'dashicons-calendar-alt', 'supports' => array('title', 'editor', 'thumbnail', 'excerpt') ); register_post_type( 'products' , $args ); } //Add action for separators in admin menu add_action( 'admin_init', 'add_admin_menu_separator' ); function add_admin_menu_separator( $position ) { global $menu; $menu[ $position ] = array( 0 => '', 1 => 'read', 2 => 'separator' . $position, 3 => '', 4 => 'wp-menu-separator' ); } //hook for admin separators add_action( 'admin_menu', 'set_admin_menu_separator' ); function set_admin_menu_separator() { do_action( 'admin_init', 9 ); do_action( 'admin_init', 11 ); do_action( 'admin_init', 19 ); do_action( 'admin_init', 21 ); } // end set_admin_menu_separator //Add css to admin menu add_action('admin_head', 'my_custom_fonts'); function my_custom_fonts() { echo ''; } //Dashboard 'widget' //add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); //function my_custom_dashboard_widgets() { //global $wp_meta_boxes; // //wp_add_dashboard_widget('custom_help_widget', 'Tema Finska Bastun', 'custom_dashboard_help'); //} // //function custom_dashboard_help() { //echo '

Välkommen till Finska Bastun! Behöver du hjälp? Kontakta utvecklaren här.

'; //} // function clean_head_init() { // Remove links to the extra feeds (e.g. category feeds) remove_action( 'wp_head', 'feed_links_extra', 3 ); // Remove links to the general feeds (e.g. posts and comments) remove_action( 'wp_head', 'feed_links', 2 ); // Remove link to the RSD service endpoint, EditURI link remove_action( 'wp_head', 'rsd_link' ); // Remove link to the Windows Live Writer manifest file remove_action( 'wp_head', 'wlwmanifest_link' ); // Remove index link remove_action( 'wp_head', 'index_rel_link' ); // Remove prev link remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // Remove start link remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // Display relational links for adjacent posts remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Remove XHTML generator showing WP version remove_action( 'wp_head', 'wp_generator' ); } function clean_head_widgets() { global $wp_widget_factory; // Remove inline recent comments styles remove_action( 'wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' )); } ?> Bränslebolaget

Välkommen till BränsleBolaget

Vi tillhandahåller Eldningsolja, Diesel och Värmepellets för dina uppvärmnings och transportbehov. Vi levererar i hela mellansverige.