diff --git a/assets/css/rrze-faudir.css b/assets/css/rrze-faudir.css index 7dd6fbe..3ba56da 100644 --- a/assets/css/rrze-faudir.css +++ b/assets/css/rrze-faudir.css @@ -1 +1 @@ -.block-classname{padding:20px;background-color:#eaeaea}.block-label>select{width:clamp(10rem,25rem,100%)!important}body{--border-color:var(--color-branding-primary, var(--faudir-color-border))}#wpbody-content .wrap .contacts-wrapper,.shortcode-contacts-wrapper{display:flex;flex-wrap:wrap;gap:20px;padding:20px}#wpbody-content .wrap .contact-card{border-radius:10px;box-shadow:0 4px 6px var(--color-ContentBorders);width:calc(33.333% - 20px);box-sizing:border-box;transition:transform .2s ease-in-out}#wpbody-content .wrap .contact-card:hover{transform:translateY(-5px)}#wpbody-content .wrap .contact-card h2.contact-name{font-size:1.5em;margin-bottom:10px;color:var(--color-KontrastDunkel)}#wpbody-content .wrap .contact-card p{margin:5px 0;color:var(--color-MetaTextDefault)}#wpbody-content .wrap .contact-card p strong{color:var(--color-black)}#wpbody-content .wrap .contact-card h3{font-size:1.2em;margin-top:15px;color:var(--color-MetaTextDefault)}#wpbody-content .wrap .contact-card,.contact-page,.shortcode-contact-card{padding:20px;background-color:var(--color-white)}.shortcode-contact-card{width:calc(33.333% - 40px);box-sizing:border-box;transition:transform .2s ease-in-out;text-align:center}.shortcode-contact-card img{border-radius:50%;max-width:70%}.shortcode-contact-card h2{display:block;font-size:18px;margin-bottom:10px}.shortcode-contact-card h3{display:block;font-size:16px;color:var(--color-MetaTextDefault)}.contact-page{align-items:center;gap:20px;box-shadow:0 4px 8px var(--color-ContentBorders);margin-bottom:20px;border-radius:8px}.contact-page-img-container{display:flex}.shortcode-contact-kompakt{display:flex;gap:20px;padding:20px;background-color:var(--color-white);box-shadow:0 4px 8px var(--color-ContentBorders);margin-bottom:20px;border-radius:8px}.contact-page-img-container img,.shortcode-contact-kompakt img{width:20%;object-fit:cover}.card-section-title,.kompakt-section-title,.page-section-title{font-size:24px;font-weight:600;color:var(--color-black)}.card-section-title a,.card-section-title a:active,.card-section-title a:focus,.card-section-title a:hover,.kompakt-section-title a,.kompakt-section-title a:active,.kompakt-section-title a:focus,.kompakt-section-title a:hover,.list-section-title a,.list-section-title a:active,.list-section-title a:focus,.list-section-title a:hover,.page-section-title a,.page-section-title a:active,.page-section-title a:focus,.page-section-title a:hover,.table-section-title a,.table-section-title a:active,.table-section-title a:focus,.table-section-title a:hover{text-decoration:none}.list-section-title,.table-section-title{font-size:18px;font-weight:600;color:var(--color-black)}.block-label{font-family:"Roboto","FAU Chimera",sans-serif;border-radius:3px!important;width:clamp(10rem,25rem,100%)!important;padding:5px}@media (max-width:768px){#wpbody-content .wrap .contact-card{width:calc(50% - 20px)}}@media (max-width:480px){#wpbody-content .wrap .contact-card{width:100%}} \ No newline at end of file +.block-classname{padding:20px;background-color:#eaeaea}body{--border-color:var(--color-branding-primary, var(--faudir-color-border))}#wpbody-content .wrap .contacts-wrapper,.shortcode-contacts-wrapper{display:flex;flex-wrap:wrap;gap:20px;padding:20px}#wpbody-content .wrap .contact-card{border-radius:10px;box-shadow:0 4px 6px var(--color-ContentBorders);width:calc(33.333% - 20px);box-sizing:border-box;transition:transform .2s ease-in-out}#wpbody-content .wrap .contact-card:hover{transform:translateY(-5px)}#wpbody-content .wrap .contact-card h2.contact-name{font-size:1.5em;margin-bottom:10px;color:var(--color-KontrastDunkel)}#wpbody-content .wrap .contact-card p{margin:5px 0;color:var(--color-MetaTextDefault)}#wpbody-content .wrap .contact-card p strong{color:var(--color-black)}#wpbody-content .wrap .contact-card h3{font-size:1.2em;margin-top:15px;color:var(--color-MetaTextDefault)}#wpbody-content .wrap .contact-card,.contact-page,.shortcode-contact-card{padding:20px;background-color:var(--color-white)}.shortcode-contact-card{width:calc(33.333% - 40px);box-sizing:border-box;transition:transform .2s ease-in-out;text-align:center}.shortcode-contact-card img{border-radius:50%;max-width:70%}.shortcode-contact-card h2{display:block;font-size:18px;margin-bottom:10px}.shortcode-contact-card h3{display:block;font-size:16px;color:var(--color-MetaTextDefault)}.contact-page{align-items:center;gap:20px;box-shadow:0 4px 8px var(--color-ContentBorders);border-radius:8px;margin:10px}.contact-page-img-container{display:flex}.shortcode-contact-kompakt{display:flex;gap:20px;padding:20px;background-color:var(--color-white);box-shadow:0 4px 8px var(--color-ContentBorders);margin-bottom:20px;border-radius:8px}.contact-page-img-container img,.shortcode-contact-kompakt img{width:20%;object-fit:cover}.card-section-title,.kompakt-section-title,.page-section-title{font-size:24px;font-weight:600;color:var(--color-black)}.card-section-title a,.card-section-title a:active,.card-section-title a:focus,.card-section-title a:hover,.kompakt-section-title a,.kompakt-section-title a:active,.kompakt-section-title a:focus,.kompakt-section-title a:hover,.list-section-title a,.list-section-title a:active,.list-section-title a:focus,.list-section-title a:hover,.page-section-title a,.page-section-title a:active,.page-section-title a:focus,.page-section-title a:hover,.table-section-title a,.table-section-title a:active,.table-section-title a:focus,.table-section-title a:hover{text-decoration:none}.list-section-title,.table-section-title{font-size:18px;font-weight:600;color:var(--color-black)}.block-label{font-family:"Roboto","FAU Chimera",sans-serif;border-radius:3px!important;width:clamp(10rem,25rem,100%)!important;padding:5px}@media (max-width:768px){#wpbody-content .wrap .contact-card{width:calc(50% - 20px)}}@media (max-width:480px){#wpbody-content .wrap .contact-card{width:100%}} \ No newline at end of file diff --git a/includes/custom-post-type/custom-post-type.php b/includes/custom-post-type/custom-post-type.php index 95deb6a..b36d99b 100644 --- a/includes/custom-post-type/custom-post-type.php +++ b/includes/custom-post-type/custom-post-type.php @@ -43,8 +43,9 @@ function render_person_additional_fields($post) { wp_nonce_field('save_person_additional_fields', 'person_additional_fields_nonce'); $fields = [ - '_content_lang' => __('Content (Second Language)', 'text-domain'), - '_teasertext_lang' => __('Teaser Text (Second Language)', 'text-domain'), + '_content_en' => __('Content (Second Language)', 'text-domain'), + '_teasertext_en' => __('Teaser Text (English)', 'text-domain'), + '_teasertext_de' => __('Teaser Text (German)', 'text-domain'), 'person_id' => __('Person ID', 'text-domain'), 'person_name' => __('Name', 'text-domain'), 'person_email' => __('Email', 'text-domain'), @@ -52,15 +53,24 @@ function render_person_additional_fields($post) { 'person_given_name' => __('Given Name', 'text-domain'), 'person_family_name' => __('Family Name', 'text-domain'), 'person_title' => __('Title', 'text-domain'), - 'person_pronoun' => __('Pronoun', 'text-domain'), + 'person_suffix' => __('Suffix', 'text-domain'), + 'person_nobility_name' => __('Nobility Name', 'text-domain'), + 'person_organization' => __('Organization', 'text-domain'), 'person_function' => __('Function', 'text-domain'), ]; foreach ($fields as $meta_key => $label) { $value = get_post_meta($post->ID, $meta_key, true); - echo ""; - echo "

"; - } + // Check if the field should be rendered as a textarea + if ($meta_key === '_content_en' || $meta_key === '_teasertext_en' || $meta_key === '_teasertext_de') { + echo ""; + echo "

"; + } else { + // Render as a regular text input field + echo ""; + echo "

"; + } + } } function save_person_additional_fields($post_id) { @@ -111,8 +121,9 @@ function save_person_additional_fields($post_id) { // List of fields to save from the form $fields = [ - '_content_lang', - '_teasertext_lang', + '_content_en', + '_teasertext_en', + '_teasertext_de', 'person_id', 'person_name', 'person_email', @@ -120,7 +131,9 @@ function save_person_additional_fields($post_id) { 'person_given_name', 'person_family_name', 'person_title', - 'person_pronoun', + 'person_suffix', + 'person_nobility_name', + 'person_organization', 'person_function', ]; diff --git a/src/scss/rrze-faudir.scss b/src/scss/rrze-faudir.scss index 0a61ffd..d1b188a 100644 --- a/src/scss/rrze-faudir.scss +++ b/src/scss/rrze-faudir.scss @@ -85,6 +85,7 @@ body { background-color: var(--color-white); box-shadow: 0 4px 8px var(--color-ContentBorders); margin-bottom: 20px; border-radius: 8px; + margin:10px; } .contact-page-img-container{ display: flex; diff --git a/templates/single-custom_person.php b/templates/single-custom_person.php index 8ddcdb8..fac9c91 100644 --- a/templates/single-custom_person.php +++ b/templates/single-custom_person.php @@ -3,71 +3,95 @@ ?>
- -
> -
-

-
-
- +
> +
+
+
+
+ + -
    - __('Person ID', 'text-domain'), - 'person_name' => __('Name', 'text-domain'), - 'person_email' => __('Email', 'text-domain'), - 'person_telephone' => __('Telephone', 'text-domain'), - 'person_given_name' => __('Given Name', 'text-domain'), - 'person_family_name' => __('Family Name', 'text-domain'), - 'person_title' => __('Title', 'text-domain'), - 'person_pronoun' => __('Pronoun', 'text-domain'), - 'person_function' => __('Function', 'text-domain'), - ]; + $fields = [ + 'person_id' => __('Person ID', 'text-domain'), + 'person_name' => __('Name', 'text-domain'), + 'person_email' => __('Email', 'text-domain'), + 'person_telephone' => __('Telephone', 'text-domain'), + 'person_given_name' => __('Given Name', 'text-domain'), + 'person_family_name' => __('Family Name', 'text-domain'), + 'person_title' => __('Title', 'text-domain'), + 'person_suffix' => __('Suffix', 'text-domain'), + 'person_nobility_name' => __('Nobility Name', 'text-domain'), + 'person_organization' => __('Organization', 'text-domain'), + 'person_function' => __('Function', 'text-domain'), + ]; + $personal_title = get_post_meta(get_the_ID(), 'person_title', true); + $first_name = get_post_meta(get_the_ID(), 'person_given_name', true); + $nobility_title = get_post_meta(get_the_ID(), 'person_nobility_name', true); + $last_name = get_post_meta(get_the_ID(), 'person_family_name', true); + $title_suffix = get_post_meta(get_the_ID(), 'person_suffix', true); - foreach ($fields as $meta_key => $label) : - $value = get_post_meta(get_the_ID(), $meta_key, true); - if (!empty($value)) : - ?> -
  • :
  • - -
+ $fullName = trim( $personal_title . ' ' . $first_name. ' '. $nobility_title . ' ' . $last_name . ' ' . $title_suffix); + ?> + +
+ +

' . __('Email:', 'rrze-faudir') .''. esc_html($email_output) .'

'; + echo $phone_output = '

' . __('Phone:', 'rrze-faudir') . ''. esc_html($phone_output) .'

'; - -

-
- -
- - $teaser_lang = get_post_meta(get_the_ID(), '_teasertext_lang', true); - if (!empty($teaser_lang)) : - ?> -

-
- +

+

+ + +

+
+ +
+ +

+
+ +
+
- + ID, 'full'); // You can specify the size ('full', 'medium', 'thumbnail', etc.) + + ?> + + Person Image + +
-
+
+