| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993 |
- <?php
- /*
- Author: Eddie Machado
- URL: http://themble.com/bones/
- This is where you can drop your custom functions or
- just edit things like thumbnail sizes, header images,
- sidebars, comments, etc.
- */
- // LOAD BONES CORE (if you remove this, the theme will break)
- require_once( 'library/bones.php' );
- // CUSTOMIZE THE WORDPRESS ADMIN (off by default)
- // require_once( 'library/admin.php' );
- /*********************
- LAUNCH BONES
- Let's get everything up and running.
- *********************/
- function bones_ahoy() {
- //Allow editor style.
- add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );
- // let's get language support going, if you need it
- load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );
- // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY
- //require_once( 'library/custom-post-type.php' );
- // launching operation cleanup
- add_action( 'init', 'bones_head_cleanup' );
- // A better title
- add_filter( 'wp_title', 'rw_title', 10, 3 );
- // remove WP version from RSS
- add_filter( 'the_generator', 'bones_rss_version' );
- // remove pesky injected css for recent comments widget
- add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );
- // clean up comment styles in the head
- add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );
- // clean up gallery output in wp
- add_filter( 'gallery_style', 'bones_gallery_style' );
- // enqueue base scripts and styles
- add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );
- // ie conditional wrapper
- // launching this stuff after theme setup
- bones_theme_support();
- // adding sidebars to Wordpress (these are created in functions.php)
- add_action( 'widgets_init', 'bones_register_sidebars' );
- // cleaning up random code around images
- add_filter( 'the_content', 'bones_filter_ptags_on_images' );
- // cleaning up excerpt
- add_filter( 'excerpt_more', 'bones_excerpt_more' );
- } /* end bones ahoy */
- // let's get this party started
- add_action( 'after_setup_theme', 'bones_ahoy' );
- /************* OEMBED SIZE OPTIONS *************/
- if ( ! isset( $content_width ) ) {
- $content_width = 680;
- }
- /************* THUMBNAIL SIZE OPTIONS *************/
- // Thumbnail sizes
- add_image_size( 'rl-thumb-600', 600, 150, true );
- add_image_size( 'rl-thumb-300', 300, 100, true );
- add_image_size( 'projekt_thumb', 355, 236, true);
- add_image_size( 'general_thumb', 255, 255, true);
- add_image_size( 'slides_thumb', 1920, 600, true);
- // add_image_size( 'rl-mitarbeiter', 250, 250, true );
- // add_image_size( 'rl-kunden', 240, 240, true );
- add_filter( 'image_size_names_choose', 'bones_custom_image_sizes' );
- function bones_custom_image_sizes( $sizes ) {
- return array_merge( $sizes, array(
- 'rl-thumb-600' => __('600px by 150px'),
- 'rl-thumb-300' => __('300px by 100px'),
- 'general_thumb' => __('Mitarbeiter'),
- 'general_thumb' => __('Kunden'),
- 'projekt_thumb' => __('Projekt'),
- ) );
- }
- /*
- The function above adds the ability to use the dropdown menu to select
- the new images sizes you have just created from within the media manager
- when you add media to your content blocks. If you add more image sizes,
- duplicate one of the lines in the array and name it according to your
- new image size.
- */
- /************* THEME CUSTOMIZE *********************/
- /*
- A good tutorial for creating your own Sections, Controls and Settings:
- http://code.tutsplus.com/series/a-guide-to-the-wordpress-theme-customizer--wp-33722
- Good articles on modifying the default options:
- http://natko.com/changing-default-wordpress-theme-customization-api-sections/
- http://code.tutsplus.com/tutorials/digging-into-the-theme-customizer-components--wp-27162
- To do:
- - Create a js for the postmessage transport method
- - Create some sanitize functions to sanitize inputs
- - Create some boilerplate Sections, Controls and Settings
- */
- function bones_theme_customizer($wp_customize) {
- // $wp_customize calls go here.
- //
- // Uncomment the below lines to remove the default customize sections
- $wp_customize->remove_section('title_tagline');
- $wp_customize->remove_section('colors');
- $wp_customize->remove_section('background_image');
- $wp_customize->remove_section('static_front_page');
- $wp_customize->remove_section('nav');
- // Uncomment the below lines to remove the default controls
- $wp_customize->remove_control('blogdescription');
- // Uncomment the following to change the default section titles
- // $wp_customize->get_section('colors')->title = __( 'Theme Colors' );
- // $wp_customize->get_section('background_image')->title = __( 'Images' );
- }
- add_action( 'customize_register', 'bones_theme_customizer' );
- /************* ACTIVE SIDEBARS ********************/
- // Sidebars & Widgetizes Areas
- function bones_register_sidebars() {
- register_sidebar(array(
- 'id' => 'sidebar1',
- 'name' => __( 'Sidebar 1', 'bonestheme' ),
- 'description' => __( 'The first (primary) sidebar.', 'bonestheme' ),
- 'before_widget' => '<div id="%1$s" class="widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h4 class="widgettitle">',
- 'after_title' => '</h4>',
- ));
- /*
- to add more sidebars or widgetized areas, just copy
- and edit the above sidebar code. In order to call
- your new sidebar just use the following code:
- Just change the name to whatever your new
- sidebar's id is, for example:
- register_sidebar(array(
- 'id' => 'sidebar2',
- 'name' => __( 'Sidebar 2', 'bonestheme' ),
- 'description' => __( 'The second (secondary) sidebar.', 'bonestheme' ),
- 'before_widget' => '<div id="%1$s" class="widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h4 class="widgettitle">',
- 'after_title' => '</h4>',
- ));
- To call the sidebar in your template, you can just copy
- the sidebar.php file and rename it to your sidebar's name.
- So using the above example, it would be:
- sidebar-sidebar2.php
- */
- } // don't remove this bracket!
- /************* COMMENT LAYOUT *********************/
- // Comment Layout
- function bones_comments( $comment, $args, $depth ) {
- $GLOBALS['comment'] = $comment; ?>
- <div id="comment-<?php comment_ID(); ?>" <?php comment_class('cf'); ?>>
- <article class="cf">
- <header class="comment-author vcard">
- <?php
- /*
- this is the new responsive optimized comment image. It used the new HTML5 data-attribute to display comment gravatars on larger screens only. What this means is that on larger posts, mobile sites don't have a ton of requests for comment images. This makes load time incredibly fast! If you'd like to change it back, just replace it with the regular wordpress gravatar call:
- echo get_avatar($comment,$size='32',$default='<path_to_url>' );
- */
- ?>
- <?php // custom gravatar call ?>
- <?php
- // create variable
- $bgauthemail = get_comment_author_email();
- ?>
- <img data-gravatar="http://www.gravatar.com/avatar/<?php echo md5( $bgauthemail ); ?>?s=40" class="load-gravatar avatar avatar-48 photo" height="40" width="40" src="<?php echo get_template_directory_uri(); ?>/library/images/nothing.gif" />
- <?php // end custom gravatar call ?>
- <?php printf(__( '<cite class="fn">%1$s</cite> %2$s', 'bonestheme' ), get_comment_author_link(), edit_comment_link(__( '(Edit)', 'bonestheme' ),' ','') ) ?>
- <time datetime="<?php echo comment_time('Y-m-j'); ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php comment_time(__( 'F jS, Y', 'bonestheme' )); ?> </a></time>
- </header>
- <?php if ($comment->comment_approved == '0') : ?>
- <div class="alert alert-info">
- <p><?php _e( 'Your comment is awaiting moderation.', 'bonestheme' ) ?></p>
- </div>
- <?php endif; ?>
- <section class="comment_content cf">
- <?php comment_text() ?>
- </section>
- <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
- </article>
- <?php // </li> is added by WordPress automatically ?>
- <?php
- } // don't remove this bracket!
- /*
- This is a modification of a function found in the
- twentythirteen theme where we can declare some
- external fonts. If you're using Google Fonts, you
- can replace these fonts, change it in your scss files
- and be up and running in seconds.
- */
- function bones_fonts() {
- wp_enqueue_style('googleFonts', '//fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic');
- }
- add_action('wp_enqueue_scripts', 'bones_fonts');
- // ************************************************************ \\
- // ************************************************************ \\
- // ************************************************************ \\
- function post_remove () //creating functions post_remove for removing menu item
- {
- remove_menu_page('edit.php');
- }
- add_action('admin_menu', 'post_remove');
- // https://blog.teamtreehouse.com/create-your-first-wordpress-custom-post-type
- https://developer.wordpress.org/reference/functions/register_post_type/#capability_type
- add_action('init', 'mitarbeiter', 0);
- function mitarbeiter() {
- $labels = array(
- 'name' => _x('Mitarbeiter', 'Post Type General Name', 'theme'),
- 'singular_name' => _x('Mitarbeiter', 'Post Type Singular Name', 'theme'),
- 'menu_name' => __('Mitarbeiter', 'theme'),
- 'name_admin_bar' => __('Mitarbeiter', 'theme'),
- 'parent_item_colon' => __('Parent Mitarbeiter:', 'theme'),
- 'all_items' => __('All Mitarbeiter', 'theme'),
- 'add_new_item' => __('Add New Mitarbeiter', 'theme'),
- 'add_new' => __('Add New', 'theme'),
- 'new_item' => __('New Mitarbeiter', 'theme'),
- 'edit_item' => __('Edit Mitarbeiter', 'theme'),
- 'update_item' => __('Update Mitarbeiter', 'theme'),
- 'view_item' => __('View Mitarbeiter', 'theme'),
- 'search_items' => __('Search Mitarbeiter', 'theme'),
- 'not_found' => __('Not found', 'theme'),
- 'not_found_in_trash' => __('Not found in Trash', 'theme'),
- );
- $args = array(
- 'label' => __('mitarbeiter', 'theme'),
- 'labels' => $labels,
- 'description' => __('Team', 'theme'),
- 'supports' => array('title', 'editor', 'thumbnail'),
- //'taxonomies' => array('category', 'post_tag'),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 11,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => true,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-id',
- );
- register_post_type( 'mitarbeiter', $args );
- }
- add_action('init', 'projekte', 0);
- function projekte() {
- $labels = array(
- 'name' => _x('Projekte', 'Post Type General Name', 'theme'),
- 'singular_name' => _x('Projek', 'Post Type Singular Name', 'theme'),
- 'menu_name' => __('Projekte', 'theme'),
- 'name_admin_bar' => __('Projekte', 'theme'),
- 'parent_item_colon' => __('Parent Projekte:', 'theme'),
- 'all_items' => __('All Projekte', 'theme'),
- 'add_new_item' => __('Add New project', 'theme'),
- 'add_new' => __('Add New', 'theme'),
- 'new_item' => __('New project', 'theme'),
- 'edit_item' => __('Edit project', 'theme'),
- 'update_item' => __('Update project', 'theme'),
- 'view_item' => __('View projects', 'theme'),
- 'search_items' => __('Search projects', 'theme'),
- 'not_found' => __('Not found', 'theme'),
- 'not_found_in_trash' => __('Not found in Trash', 'theme'),
- );
- $args = array(
- 'label' => __('projekte', 'theme'),
- 'labels' => $labels,
- 'description' => __('Team', 'theme'),
- 'supports' => array('title', 'thumbnail'),
- //'taxonomies' => array('category', 'post_tag'),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 11,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-store',
- );
- register_post_type( 'projekte', $args );
- }
- add_action('init', 'baugruppen', 0);
- function baugruppen() {
- $labels = array(
- 'name' => _x('Baugruppen', 'Post Type General Name', 'theme'),
- 'singular_name' => _x('Baugruppe', 'Post Type Singular Name', 'theme'),
- 'menu_name' => __('Baugruppen', 'theme'),
- 'name_admin_bar' => __('Baugruppen', 'theme'),
- 'parent_item_colon' => __('Parent Baugruppen:', 'theme'),
- 'all_items' => __('All Baugruppen', 'theme'),
- 'add_new_item' => __('Add New group', 'theme'),
- 'add_new' => __('Add New', 'theme'),
- 'new_item' => __('New group', 'theme'),
- 'edit_item' => __('Edit group', 'theme'),
- 'update_item' => __('Update group', 'theme'),
- 'view_item' => __('View groups', 'theme'),
- 'search_items' => __('Search groups', 'theme'),
- 'not_found' => __('Not found', 'theme'),
- 'not_found_in_trash' => __('Not found in Trash', 'theme'),
- );
- $args = array(
- 'label' => __('baugruppen', 'theme'),
- 'labels' => $labels,
- 'description' => __('Team', 'theme'),
- 'supports' => array('title', 'thumbnail'),
- //'taxonomies' => array('category', 'post_tag'),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 11,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-groups',
- );
- register_post_type( 'baugruppen', $args );
- }
- add_action('init', 'clients', 0);
- function clients() {
- $labels = array(
- 'name' => _x('Clients', 'Post Type General Name', 'theme'),
- 'singular_name' => _x('Client', 'Post Type Singular Name', 'theme'),
- 'menu_name' => __('Clients', 'theme'),
- 'name_admin_bar' => __('Clients', 'theme'),
- 'parent_item_colon' => __('Parent Clients:', 'theme'),
- 'all_items' => __('All Clients', 'theme'),
- 'add_new_item' => __('Add New client', 'theme'),
- 'add_new' => __('Add New', 'theme'),
- 'new_item' => __('New client', 'theme'),
- 'edit_item' => __('Edit client', 'theme'),
- 'update_item' => __('Update client', 'theme'),
- 'view_item' => __('View clients', 'theme'),
- 'search_items' => __('Search clients', 'theme'),
- 'not_found' => __('Not found', 'theme'),
- 'not_found_in_trash' => __('Not found in Trash', 'theme'),
- );
- $args = array(
- 'label' => __('clients', 'theme'),
- 'labels' => $labels,
- 'description' => __('Team', 'theme'),
- 'supports' => array('title', 'thumbnail'),
- //'taxonomies' => array('category', 'post_tag'),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 11,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-smiley',
- );
- register_post_type( 'clients', $args );
- }
- add_action('init', 'testimonials', 0);
- function testimonials() {
- $labels = array(
- 'name' => _x('testimonials', 'Post Type General Name', 'theme'),
- 'singular_name' => _x('Testimonial', 'Post Type Singular Name', 'theme'),
- 'menu_name' => __('Testimonials', 'theme'),
- 'name_admin_bar' => __('Testimonials', 'theme'),
- 'parent_item_colon' => __('Parent testimonials:', 'theme'),
- 'all_items' => __('All testimonials', 'theme'),
- 'add_new_item' => __('Add New testimonial', 'theme'),
- 'add_new' => __('Add New', 'theme'),
- 'new_item' => __('New testimonial', 'theme'),
- 'edit_item' => __('Edit testimonial', 'theme'),
- 'update_item' => __('Update testimonial', 'theme'),
- 'view_item' => __('View testimonials', 'theme'),
- 'search_items' => __('Search testimonials', 'theme'),
- 'not_found' => __('Not found', 'theme'),
- 'not_found_in_trash' => __('Not found in Trash', 'theme'),
- );
- $args = array(
- 'label' => __('testimonials', 'theme'),
- 'labels' => $labels,
- 'description' => __('Team', 'theme'),
- 'supports' => array('title', 'thumbnail'),
- //'taxonomies' => array('category', 'post_tag'),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 11,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-format-quote',
- );
- register_post_type( 'testimonials', $args );
- }
- add_action('init', 'slides', 0);
- function slides() {
- $labels = array(
- 'name' => _x('Slides', 'Post Type General Name', 'theme'),
- 'singular_name' => _x('Slide', 'Post Type Singular Name', 'theme'),
- 'menu_name' => __('Slides', 'theme'),
- 'name_admin_bar' => __('Slides', 'theme'),
- 'parent_item_colon' => __('Parent slides:', 'theme'),
- 'all_items' => __('All slides', 'theme'),
- 'add_new_item' => __('Add New slide', 'theme'),
- 'add_new' => __('Add New', 'theme'),
- 'new_item' => __('New slide', 'theme'),
- 'edit_item' => __('Edit slide', 'theme'),
- 'update_item' => __('Update slide', 'theme'),
- 'view_item' => __('View slides', 'theme'),
- 'search_items' => __('Search slides', 'theme'),
- 'not_found' => __('Not found', 'theme'),
- 'not_found_in_trash' => __('Not found in Trash', 'theme'),
- );
- $args = array(
- 'label' => __('slides', 'theme'),
- 'labels' => $labels,
- 'description' => __('Team', 'theme'),
- 'supports' => array('title', 'thumbnail'),
- //'taxonomies' => array('category', 'post_tag'),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 11,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-format-image',
- );
- register_post_type( 'slides', $args );
- }
- add_action('init', 'geschaeftfelder', 0);
- function geschaeftfelder() {
- $labels = array(
- 'name' => _x('Geschäftsfelder', 'Post Type General Name', 'theme'),
- 'singular_name' => _x('Slide', 'Post Type Singular Name', 'theme'),
- 'menu_name' => __('Geschäftsfelder', 'theme'),
- 'name_admin_bar' => __('Geschäftsfelder', 'theme'),
- 'parent_item_colon' => __('Parent geschäftsfelder:', 'theme'),
- 'all_items' => __('All geschäftsfelder', 'theme'),
- 'add_new_item' => __('Add New geschäftsfeld', 'theme'),
- 'add_new' => __('Add New', 'theme'),
- 'new_item' => __('New geschäftsfeld', 'theme'),
- 'edit_item' => __('Edit geschäftsfeld', 'theme'),
- 'update_item' => __('Update geschäftsfeld', 'theme'),
- 'view_item' => __('View geschäftsfelder', 'theme'),
- 'search_items' => __('Search geschäftsfelder', 'theme'),
- 'not_found' => __('Not found', 'theme'),
- 'not_found_in_trash' => __('Not found in Trash', 'theme'),
- );
- $args = array(
- 'label' => __('geschaeftfelder', 'theme'),
- 'labels' => $labels,
- 'description' => __('Team', 'theme'),
- 'supports' => array('title', 'thumbnail'),
- //'taxonomies' => array('category', 'post_tag'),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 11,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-building',
- );
- register_post_type( 'geschaeftfelder', $args );
- }
- add_action("admin_init", "admin_init");
- function admin_init(){
- // mitarbetier
- add_meta_box("mitarbeiter-position", "Position", "mitarbeiter_position", "mitarbeiter", "normal", "low");
- add_meta_box("mitarbeiter-email", "Email", "mitarbeiter_email", "mitarbeiter", "normal", "low");
- add_meta_box("mitarbeiter-beschreibung", "Beschreibung", "mitarbeiter_beschreibung", "mitarbeiter", "normal", "low");
- add_meta_box("mitarbeiter-tel", "Telefonnummer", "mitarbeiter_tel", "mitarbeiter", "normal", "low");
- add_meta_box("mitarbeiter-cv", "Link zum CV", "mitarbeiter_cv", "mitarbeiter", "normal", "low");
- // Projekte
- add_meta_box("projekt-beschreibung", "Description", "projekt_beschreibung", "projekte", "normal", "low");
- add_meta_box("projekt-link", "Link", "projekt_link", "projekte", "normal", "low");
- // Baugruppen
- add_meta_box("baugruppe-link", "Link", "baugruppe_link", "baugruppen", "normal", "low");
- // Baugruppen
- add_meta_box("client-link", "Link", "client_link", "clients", "normal", "low");
- // Testimonials
- add_meta_box("bericht-text", "Text", "testimonial_text", "testimonials", "normal", "low");
- add_meta_box("bericht-autor", "Autor", "testimonial_autor", "testimonials", "normal", "low");
- add_meta_box("bericht-link", "Link", "testimonial_link", "testimonials", "normal", "low");
- // Slides
- add_meta_box("slide-text", "Text", "slide_text", "slides", "normal", "low");
- add_meta_box("slide-link-text", "Link-text", "slide_link_text", "slides", "normal", "low");
- add_meta_box("slide-link", "Link", "slide_link", "slides", "normal", "low");
- // geschaeftfelder
- add_meta_box("geschaeftfeld-text", "Text", "geschaeftfeld_text", "geschaeftfelder", "normal", "low");
- }
- function mitarbeiter_email(){
- global $post;
- $custom = get_post_custom($post->ID);
- $mitarbeiter_email = $custom["mitarbeiter_email"][0];
- ?>
- <label>Email:</label>
- <input name="mitarbeiter_email" value="<?php echo $mitarbeiter_email; ?>" />
- <?php
- }
- function mitarbeiter_position(){
- global $post;
- $custom = get_post_custom($post->ID);
- $mitarbeiter_position = $custom["mitarbeiter_position"][0];
- ?>
- <label>Position:</label>
- <input name="mitarbeiter_position" value="<?php echo $mitarbeiter_position; ?>" />
- <?php
- }
- function mitarbeiter_beschreibung(){
- global $post;
- $custom = get_post_custom($post->ID);
- $mitarbeiter_beschreibung = $custom["mitarbeiter_beschreibung"][0];
- ?>
- <label>Beschreibung:</label>
- <input name="mitarbeiter_beschreibung" maxlength="84" value="<?php echo $mitarbeiter_beschreibung; ?>" />
- <?php
- }
- function mitarbeiter_tel(){
- global $post;
- $custom = get_post_custom($post->ID);
- $mitarbeiter_tel = $custom["mitarbeiter_tel"][0];
- ?>
- <label>Tel:</label>
- <input name="mitarbeiter_tel" value="<?php echo $mitarbeiter_tel; ?>" />
- <?php
- }
- function mitarbeiter_cv(){
- global $post;
- $custom = get_post_custom($post->ID);
- $mitarbeiter_cv = $custom["mitarbeiter_cv"][0];
- ?>
- <label>Link zum CV:</label>
- <input name="mitarbeiter_cv" value="<?php echo $mitarbeiter_cv; ?>" />
- <?php
- }
- function projekt_beschreibung(){
- global $post;
- $custom = get_post_custom($post->ID);
- $projekt_beschreibung = $custom["projekt_beschreibung"][0];
- ?>
- <label>Description:</label>
- <input name="projekt_beschreibung" value="<?php echo $projekt_beschreibung; ?>" />
- <?php
- }
- function projekt_link(){
- global $post;
- $custom = get_post_custom($post->ID);
- $projekt_link = $custom["projekt_link"][0];
- ?>
- <label>Link:</label>
- <input name="projekt_link" value="<?php echo $projekt_link; ?>" />
- <?php
- }
- function baugruppe_link(){
- global $post;
- $custom = get_post_custom($post->ID);
- $baugruppe_link = $custom["baugruppe_link"][0];
- ?>
- <label>Link:</label>
- <input name="baugruppe_link" value="<?php echo $baugruppe_link; ?>" />
- <?php
- }
- function client_link(){
- global $post;
- $custom = get_post_custom($post->ID);
- $client_link = $custom["client_link"][0];
- ?>
- <label>Link:</label>
- <input name="client_link" value="<?php echo $client_link; ?>" />
- <?php
- }
- function testimonial_text(){
- global $post;
- $custom = get_post_custom($post->ID);
- $testimonial_text = $custom["testimonial_text"][0];
- ?>
- <label>Text:</label>
- <input name="testimonial_text" value="<?php echo $testimonial_text; ?>" />
- <?php
- }
- function testimonial_autor(){
- global $post;
- $custom = get_post_custom($post->ID);
- $testimonial_autor = $custom["testimonial_autor"][0];
- ?>
- <label>Author:</label>
- <input name="testimonial_autor" value="<?php echo $testimonial_autor; ?>" />
- <?php
- }
- function testimonial_link(){
- global $post;
- $custom = get_post_custom($post->ID);
- $testimonial_link = $custom["testimonial_link"][0];
- ?>
- <label>Author:</label>
- <input name="testimonial_link" value="<?php echo $testimonial_link; ?>" />
- <?php
- }
- function slide_text(){
- global $post;
- $custom = get_post_custom($post->ID);
- $slide_text = $custom["slide_text"][0];
- ?>
- <label>Text:</label>
- <input name="slide_text" value="<?php echo $slide_text; ?>" />
- <?php
- }
- function slide_link_text(){
- global $post;
- $custom = get_post_custom($post->ID);
- $slide_link_text = $custom["slide_link_text"][0];
- ?>
- <label>Slide link text:</label>
- <input name="slide_link_text" value="<?php echo $slide_link_text; ?>" />
- <?php
- }
- function slide_link(){
- global $post;
- $custom = get_post_custom($post->ID);
- $slide_link = $custom["slide_link"][0];
- ?>
- <label>Slide link:</label>
- <input name="slide_link" value="<?php echo $slide_link; ?>" />
- <?php
- }
- function geschaeftfeld_text(){
- global $post;
- $custom = get_post_custom($post->ID);
- $geschaeftfeld_text = $custom["geschaeftfeld_text"][0];
- ?>
- <label>Text:</label>
- <input name="geschaeftfeld_text" value="<?php echo $geschaeftfeld_text; ?>" />
- <?php
- }
- add_action('save_post', 'save_details');
- function save_details(){
- global $post;
- // mitarbeiter
- update_post_meta($post->ID, "mitarbeiter_position", $_POST["mitarbeiter_position"]);
- update_post_meta($post->ID, "mitarbeiter_email", $_POST["mitarbeiter_email"]);
- update_post_meta($post->ID, "mitarbeiter_beschreibung", $_POST["mitarbeiter_beschreibung"]);
- update_post_meta($post->ID, "mitarbeiter_tel", $_POST["mitarbeiter_tel"]);
- update_post_meta($post->ID, "mitarbeiter_cv", $_POST["mitarbeiter_cv"]);
- // Projekte
- update_post_meta($post->ID, "projekt_beschreibung", $_POST["projekt_beschreibung"]);
- update_post_meta($post->ID, "projekt_link", $_POST["projekt_link"]);
- // baugruppen
- update_post_meta($post->ID, "baugruppe_link", $_POST["baugruppe_link"]);
- // clients
- update_post_meta($post->ID, "client_link", $_POST["client_link"]);
- // testimonials
- update_post_meta($post->ID, "testimonial_text", $_POST["testimonial_text"]);
- update_post_meta($post->ID, "testimonial_autor", $_POST["testimonial_autor"]);
- update_post_meta($post->ID, "testimonial_link", $_POST["testimonial_link"]);
- // slides
- update_post_meta($post->ID, "slide_text", $_POST["slide_text"]);
- update_post_meta($post->ID, "slide_link_text", $_POST["slide_link_text"]);
- update_post_meta($post->ID, "slide_link", $_POST["slide_link"]);
- // geschaeftfeld
- update_post_meta($post->ID, "geschaeftfeld_text", $_POST["geschaeftfeld_text"]);
- }
- // add_image_size( 'mitarbeiter_thumb', 255, 255, true);
- /*
- Baugrupen
- Kunden
- Testimonials
- */
- function theme_settings_page()
- {
- ?>
- <div class="wrap">
- <h1>Theme Panel</h1>
- <form method="post" action="options.php">
- <?php
- settings_fields("section");
- do_settings_sections("theme-options");
- submit_button();
- ?>
- </form>
- </div>
- <?php
- }
- function add_theme_menu_item()
- {
- add_menu_page("RL - Einstellungen", "RL - Einstellungen", "manage_options", "theme-panel", "theme_settings_page", null, 99);
- }
- add_action("admin_menu", "add_theme_menu_item");
- function gf_titel()
- {
- ?>
- <textarea type="text" rows="10" cols="30" name="gf_titel" id="gf_titel" style="width: 50%;" ><?php echo get_option('gf_titel', 'Dafür arbeiten wir <strong>ODER</strong> was uns beschäftigt'); ?>
- </textarea>
- <?php
- }
- function gf_extra()
- {
- ?>
- <textarea type="text" rows="10" cols="30" name="gf_extra" id="gf_extra" style="width: 50%;" ><?php echo get_option('gf_extra', 'Erfahren Sie mehr <strong>ODER</strong> mehr+'); ?>
- </textarea>
- <?php
- }
- function pr_titel()
- {
- ?>
- <textarea type="text" rows="10" cols="30" name="pr_titel" id="pr_titel" style="width: 50%;" ><?php echo get_option('pr_titel', '<h2 class="section-title">Ausgewählte Projekte</h2>'); ?>
- </textarea>
- <?php
- }
- function pr_extra()
- {
- ?>
- <textarea type="text" rows="10" cols="30" name="pr_extra" id="pr_extra" style="width: 50%;" ><?php echo get_option('pr_extra', '<p>Alle Projekte finden Sie unter <a title="https://gemeinschaffen.com" href="https://gemeinschaffen.com">https://gemeinschaffen.com</a></p>'); ?>
- </textarea>
- <?php
- }
- function separator()
- {
- ?>
- <hr style="border-top: 1px solid black;" >
- <?php
- }
- function kontakt_daten()
- {
- $content = get_option('kontakt_daten', 'Erfahren Sie mehr <strong>ODER</strong> mehr+');
- echo '<div class="" style="width: 75%;" >';
- wp_editor( $content, 'kontakt_daten', array(
- 'wpautop' => false,
- 'textarea_name' => 'kontakt_daten',
- 'media_buttons' => false,
- )
- );
- echo '</div>';
- }
- function zweite_spalte()
- {
- $content = get_option('zweite_spalte', 'Erfahren Sie mehr <strong>ODER</strong> mehr+');
- echo '<div class="" style="width: 75%;" >';
- wp_editor( $content, 'zweite_spalte', array(
- 'wpautop' => false,
- 'textarea_name' => 'zweite_spalte',
- 'media_buttons' => false,
- )
- );
- echo '</div>';
- }
- function dritte_spalte()
- {
- $content = get_option('dritte_spalte', 'Erfahren Sie mehr <strong>ODER</strong> mehr+');
- echo '<div class="" style="width: 75%;" >';
- wp_editor( $content, 'dritte_spalte', array(
- 'wpautop' => false,
- 'textarea_name' => 'dritte_spalte',
- 'media_buttons' => false,
- )
- );
- echo '</div>';
- }
- function vierte_spalte()
- {
- ?>
- <textarea type="text" rows="10" cols="30" name="vierte_spalte" id="vierte_spalte" style="width: 50%;" ><?php echo get_option('vierte_spalte', ''); ?>
- </textarea>
- <?php
- }
- function display_theme_panel_fields()
- {
- // add_settings_section("section", "Geschäftsfelder Textblöcke. HTML is erlaubt.", null, "theme-options");
- add_settings_section("section", "Textblöcke. HTML is erlaubt.", null, "theme-options");
- add_settings_field("gf_titel", "Geschäftsfelder Titel", "gf_titel", "theme-options", "section");
- register_setting("section", "gf_titel");
- add_settings_field("gf_extra", "Geschäftsfelder extra Text", "gf_extra", "theme-options", "section");
- register_setting("section", "gf_extra");
- add_settings_field("separator-a", "", "separator", "theme-options", "section");
- add_settings_field("pr_titel", "Projekte Titel", "pr_titel", "theme-options", "section");
- register_setting("section", "pr_titel");
- add_settings_field("pr_extra", "Projekte extra Text", "pr_extra", "theme-options", "section");
- register_setting("section", "pr_extra");
- add_settings_field("separator-b", "", "separator", "theme-options", "section");
- add_settings_field("kontakt_daten", "Kontaktdaten (1. Spalte im Footer)", "kontakt_daten", "theme-options", "section");
- register_setting("section", "kontakt_daten");
- add_settings_field("zweite_spalte", "2. Spalte im Footer", "zweite_spalte", "theme-options", "section");
- register_setting("section", "zweite_spalte");
- add_settings_field("dritte_spalte", "3. Spalte im Footer", "dritte_spalte", "theme-options", "section");
- register_setting("section", "dritte_spalte");
- // add_settings_field("vierte_spalte", "4. Spalte im Footer", "vierte_spalte", "theme-options", "section");
- // register_setting("section", "vierte_spalte");
- /*
- add_settings_section("section", "All Settings", null, "theme-options");
- add_settings_field("twitter_url", "Twitter Profile Url", "display_twitter_element", "theme-options", "section");
- add_settings_field("facebook_url", "Facebook Profile Url", "display_facebook_element", "theme-options", "section");
- register_setting("section", "twitter_url");
- register_setting("section", "facebook_url"); */
- }
- add_action("admin_init", "display_theme_panel_fields");
- function encode_email_shortcode($atts, $content = null) {
- for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';';
- return '<a class="encoded-email" href="mailto:' . $encodedmail . '"><i class="fa fa-envelope" aria-hidden="true"></i></a>';
- }
- add_shortcode('email', 'encode_email_shortcode');
- /* DON'T DELETE THIS CLOSING TAG */ ?>
|