|
@@ -433,6 +433,50 @@ function clients() {
|
|
|
register_post_type( 'clients', $args );
|
|
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' => 5,
|
|
|
|
|
+ '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( 'testimonials', $args );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
add_action("admin_init", "admin_init");
|
|
add_action("admin_init", "admin_init");
|
|
|
|
|
|
|
|
function admin_init(){
|
|
function admin_init(){
|
|
@@ -445,10 +489,13 @@ function admin_init(){
|
|
|
// Baugruppen
|
|
// Baugruppen
|
|
|
add_meta_box("baugruppe-link", "Link", "baugruppe_link", "baugruppen", "normal", "low");
|
|
add_meta_box("baugruppe-link", "Link", "baugruppe_link", "baugruppen", "normal", "low");
|
|
|
// Baugruppen
|
|
// Baugruppen
|
|
|
- add_meta_box("client-link", "Link", "client_link", "clients", "normal", "low");
|
|
|
|
|
|
|
+ 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");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
function mitarbeiter_email(){
|
|
function mitarbeiter_email(){
|
|
|
global $post;
|
|
global $post;
|
|
|
$custom = get_post_custom($post->ID);
|
|
$custom = get_post_custom($post->ID);
|
|
@@ -499,7 +546,6 @@ function baugruppe_link(){
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
function client_link(){
|
|
function client_link(){
|
|
|
global $post;
|
|
global $post;
|
|
|
$custom = get_post_custom($post->ID);
|
|
$custom = get_post_custom($post->ID);
|
|
@@ -510,24 +556,62 @@ function client_link(){
|
|
|
<?php
|
|
<?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
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
add_action('save_post', 'save_details');
|
|
add_action('save_post', 'save_details');
|
|
|
|
|
|
|
|
function save_details(){
|
|
function save_details(){
|
|
|
global $post;
|
|
global $post;
|
|
|
// mitarbeiter
|
|
// mitarbeiter
|
|
|
update_post_meta($post->ID, "mitarbeiter_position", $_POST["mitarbeiter_position"]);
|
|
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_email", $_POST["mitarbeiter_email"]);
|
|
|
// Projekte
|
|
// Projekte
|
|
|
update_post_meta($post->ID, "projekt_beschreibung", $_POST["projekt_beschreibung"]);
|
|
update_post_meta($post->ID, "projekt_beschreibung", $_POST["projekt_beschreibung"]);
|
|
|
- update_post_meta($post->ID, "projekt_link", $_POST["projekt_link"]);
|
|
|
|
|
|
|
+ update_post_meta($post->ID, "projekt_link", $_POST["projekt_link"]);
|
|
|
// baugruppen
|
|
// baugruppen
|
|
|
- update_post_meta($post->ID, "baugruppe_link", $_POST["baugruppe_link"]);
|
|
|
|
|
|
|
+ update_post_meta($post->ID, "baugruppe_link", $_POST["baugruppe_link"]);
|
|
|
|
|
+ // clients
|
|
|
|
|
+ update_post_meta($post->ID, "client_link", $_POST["client_link"]);
|
|
|
// clients
|
|
// clients
|
|
|
- update_post_meta($post->ID, "client_link", $_POST["client_link"]);
|
|
|
|
|
|
|
+ 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"]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-add_image_size( 'projekt_thumb', 355, 236, true);
|
|
|
|
|
|
|
+add_image_size( 'general_thumb', 355, 236, true);
|
|
|
|
|
+add_image_size( 'mitarbeiter_thumb', 255, 255, true);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
|
|
|
|
@@ -542,70 +626,68 @@ 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
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-/* ------------------ */
|
|
|
|
|
-/* theme options page */
|
|
|
|
|
-/* ------------------ */
|
|
|
|
|
-/* https://blog.kulturbanause.de/2011/11/theme-options-page-fur-wordpress-erstellen/ */
|
|
|
|
|
|
|
|
|
|
-add_action( 'admin_init', 'theme_options_init' );
|
|
|
|
|
-add_action( 'admin_menu', 'theme_options_add_page' );
|
|
|
|
|
|
|
|
|
|
-// Einstellungen registrieren (http://codex.wordpress.org/Function_Reference/register_setting)
|
|
|
|
|
-function theme_options_init(){
|
|
|
|
|
- register_setting( 'rl_options', 'rl_theme_options', 'rl_validate_options' );
|
|
|
|
|
|
|
+function add_theme_menu_item()
|
|
|
|
|
+{
|
|
|
|
|
+ add_menu_page("Text blocks", "Text blocks", "manage_options", "theme-panel", "theme_settings_page", null, 99);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Seite in der Dashboard-Navigation erstellen
|
|
|
|
|
-function theme_options_add_page() {
|
|
|
|
|
- add_theme_page('Optionen', 'Optionen', 'edit_theme_options', 'theme-optionen', 'rl_theme_options_page' ); // Seitentitel, Titel in der Navi, Berechtigung zum Editieren (http://codex.wordpress.org/Roles_and_Capabilities) , Slug, Funktion
|
|
|
|
|
-}
|
|
|
|
|
|
|
+add_action("admin_menu", "add_theme_menu_item");
|
|
|
|
|
|
|
|
-// Optionen-Seite erstellen
|
|
|
|
|
-function rl_theme_options_page() {
|
|
|
|
|
-global $select_options, $radio_options;
|
|
|
|
|
-if ( ! isset( $_REQUEST['settings-updated'] ) )
|
|
|
|
|
- $_REQUEST['settings-updated'] = false; ?>
|
|
|
|
|
-
|
|
|
|
|
-<div class="wrap">
|
|
|
|
|
-<?php screen_icon(); ?><h2>Theme-Optionen für <?php bloginfo('name'); ?></h2>
|
|
|
|
|
-
|
|
|
|
|
-<?php if ( false !== $_REQUEST['settings-updated'] ) : ?>
|
|
|
|
|
-<div class="updated fade">
|
|
|
|
|
- <p><strong>Einstellungen gespeichert!</strong></p>
|
|
|
|
|
-</div>
|
|
|
|
|
-<?php endif; ?>
|
|
|
|
|
-
|
|
|
|
|
- <form method="post" action="options.php">
|
|
|
|
|
- <?php settings_fields( 'rl_options' ); ?>
|
|
|
|
|
- <?php $options = get_option( 'rl_theme_options' ); ?>
|
|
|
|
|
-
|
|
|
|
|
- <table class="form-table">
|
|
|
|
|
-
|
|
|
|
|
- <tr valign="top">
|
|
|
|
|
- <th scope="row">Google Analytics</th>
|
|
|
|
|
- <td><textarea id="rl_theme_options[kontakt]" class="large-text" cols="50" rows="10" name="rl_theme_options[kontakt]"><?php echo esc_textarea( $options['kontakt'] ); ?></textarea></td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </table>
|
|
|
|
|
-
|
|
|
|
|
- <!-- submit -->
|
|
|
|
|
- <p class="submit"><input type="submit" class="button-primary" value="Einstellungen speichern" /></p>
|
|
|
|
|
- </form>
|
|
|
|
|
-</div>
|
|
|
|
|
-<?php }
|
|
|
|
|
-
|
|
|
|
|
-// Strip HTML-Code:
|
|
|
|
|
-// Hier kann definiert werden, ob HTML-Code in einem Eingabefeld
|
|
|
|
|
-// automatisch entfernt werden soll. Soll beispielsweise im
|
|
|
|
|
-// Copyright-Feld KEIN HTML-Code erlaubt werden, kommentiert die Zeile
|
|
|
|
|
-// unten wieder ein. http://codex.wordpress.org/Function_Reference/wp_filter_nohtml_kses
|
|
|
|
|
-function rl_validate_options( $input ) {
|
|
|
|
|
- // $input['copyright'] = wp_filter_nohtml_kses( $input['copyright'] );
|
|
|
|
|
- return $input;
|
|
|
|
|
|
|
+
|
|
|
|
|
+function kontakt_daten()
|
|
|
|
|
+{
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <textarea type="text" rows="10" cols="30" name="kontakt_daten" id="kontakt_daten">
|
|
|
|
|
+ <?php echo get_option('kontakt_daten', '<h3 class="small-title">Kontakt</h3><p>realitylab gmbh <br>Ernst-Melchior-Gasse 11/1/G1<br>1020 Wien<br>Fon: (43) 01 996 20 15 - 0<br>Mail: office@realitylab.at<br></p><!--<div class="social-footer"><a href="#"><i class="fa fa-facebook icon-round"></i></a><a href="#"><i class="fa fa-twitter icon-round"></i></a><a href="#"><i class="fa fa-linkedin icon-round"></i></a></div> -->'); ?>
|
|
|
|
|
+ </textarea>
|
|
|
|
|
+ <?php
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/*
|
|
|
|
|
+function display_facebook_element()
|
|
|
|
|
+{
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <input type="text" name="facebook_url" id="facebook_url" value="<?php echo get_option('facebook_url'); ?>" />
|
|
|
|
|
+ <?php
|
|
|
|
|
+}*/
|
|
|
|
|
|
|
|
|
|
+function display_theme_panel_fields()
|
|
|
|
|
+{
|
|
|
|
|
+ add_settings_section("section", "All Settings", null, "theme-options");
|
|
|
|
|
+
|
|
|
|
|
+ add_settings_field("kontakt_daten", "Contact data", "kontakt_daten", "theme-options", "section");
|
|
|
|
|
+
|
|
|
|
|
+ register_setting("section", "kontakt_daten");
|
|
|
|
|
+/*
|
|
|
|
|
+ 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");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|