<?php
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 120, 120, true );
//Code fuer Menues
function register_my_menus() {
register_nav_menus(
array( 'main-menu' => __( 'Hauptmenu' ),
'footer-menu' => __( 'Footer-Menu' ),
'social-menu' => __( 'Social-Menu' ),
'maschinen-menu' => __( 'Maschinen-Menu' ),
'sprachen-menu' => __( 'Sprachen-Menu' ),
'downloads-menu' => __( 'Downloads-Menu' ),
'rechtliches-menu' => __( 'Rechtliches-Menu' )
);
}
add_action ('init', 'register_my_menus');
?><?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Page-Contact',
'description' => '',
'before_widget' => '<section class="contact-box">',
'after_widget' => '</section>'
));
register_sidebar(array(
'name' => 'Neueste-Maschinen',
'description' => '',
'before_widget' => '<section class="contact-box">',
'after_widget' => '</section>'
));
register_sidebar(array(
'name' => 'Sonderangebote-Zusatzprodukte',
'description' => '',
'before_widget' => '<section class="contact-box">',
'after_widget' => '</section>'
));
register_sidebar(array(
'name' => 'Sidebar-Blog',
'description' => '',
'before_widget' => '<div>',
'after_widget' => '</div>'
));
register_sidebar(array(
'name' => 'Sidebar-Maschinen',
'description' => '',
'before_widget' => '<aside class="blog-sidebar">',
'after_widget' => '</aside>'
));
register_sidebar(array(
'name' => 'counter',
));
// Security - keine Ausgabe bei Loginfehler und verstecken der WP-Version
add_filter('login_errors', create_function('$a', 'return "Falscher Username oder falsches Passwort";'));
remove_action('wp_head', 'wp_generator');
// Custom Post Types
// Maschinen
add_action('init', 'add_cpt_maschinen');
function add_cpt_maschinen() {
$labels = array(
'name' => _x('Maschinen', 'post type general name'),
'singular_name' => _x('Maschinen', 'post type singular_name'),
'add_new' => _x('Hinzufügen', 'Maschine'),
'add_new_item' => __('Neue Maschine hinzufügen'),
'edit_itm' => __('Maschinen bearbeiten'),
'new_item' => __('Neue Maschinen'),
'view_item' => __('Maschinen ansehen'),
'search_items' => __('Nach Maschinen suchen'),
'not_found' => __('Keine Maschinen gefunden'),
'not_found_in_trash' => __('Keine Maschinen in Papierkorb gefunden'),
'parent_item_colon' => ''
);
$supports = array('title',
'editor',
'thumbnail',
'excerpt');
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'_builtin' => false,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array("slug" => "maschinen"),
'capability_type' => 'post',
'hierarchical' => false,
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 20,
'show_in_nav_menus' => true,
'supports' => $supports
);
register_post_type('maschinen', $args);
};
// Polylang-Support fuer die Post-Types
add_filter('pll_get_post_types', 'my_pll_get_post_types');
function my_pll_get_post_types($types) {
return array_merge($types, array('maschinen' => 'maschinen'));
}
?>