Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@
</p>
</div>

<nav class="navbar navbar-top navbar-expand-md footermenu-1">
<div class="footermenu-1">

<?php if ( is_active_sidebar( 'footer-center' ) ) : ?>
<div class="footer-widget-area footer-widget-area--center">
<?php dynamic_sidebar( 'footer-center' ); ?>
</div>
<?php endif; ?>

<nav class="navbar navbar-top navbar-expand-md">
<div class="text-center ">
<?php
wp_nav_menu(
Expand All @@ -45,8 +53,16 @@
?>
</div>
</nav>
</div>

<nav class="navbar navbar-top navbar-expand-md footermenu-2">
<div class="footermenu-2">

<?php if ( is_active_sidebar( 'footer-right' ) ) : ?>
<div class="footer-widget-area footer-widget-area--right">
<?php dynamic_sidebar( 'footer-right' ); ?>
</div>
<?php endif; ?>
<nav class="navbar navbar-top navbar-expand-md">
<div class="text-center ">
<?php
wp_nav_menu(
Expand All @@ -64,6 +80,7 @@
?>
</div>
</nav>
</div>

</div>

Expand Down
2 changes: 2 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
require_once __DIR__ . '/functions/theme.php';
require_once __DIR__ . '/functions/latest-posts.php';
require_once __DIR__ . '/functions/media.php';
require_once __DIR__ . '/functions/class-sunflower-contact-widget.php';
require_once __DIR__ . '/functions/widgets.php';


/**
Expand Down
2 changes: 1 addition & 1 deletion functions/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function sunflower_enqueue_block_icon_picker() {
array(
'wp-blocks',
'wp-element',
'wp-editor',
'wp-block-editor',
'wp-components',
'wp-i18n',
'wp-compose',
Expand Down
53 changes: 30 additions & 23 deletions functions/class-sunflower-contact-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,36 @@ public function widget( $args, $instance ) {
)
);

// Widget wrapper HTML comes from register_sidebar() – safe to output with kses.
echo wp_kses_post( $args['before_widget'] );

$fields = array();

if ( ! empty( $instance['title'] ) ) {
echo wp_kses_post( $args['before_title'] ) . esc_html( $instance['title'] ) . wp_kses_post( $args['after_title'] );
$fields['title'] = array(
'class' => 'contact-title',
);
}

$fields = array(
'address' => array(
'icon' => 'fa-solid fa-location-dot',
'class' => 'contact-address',
'multiline' => true,
),
'phone' => array(
'icon' => 'fa-solid fa-phone',
'class' => 'contact-phone',
'link' => 'tel',
),
'email' => array(
'icon' => 'fa-solid fa-envelope',
'class' => 'contact-email',
'link' => 'mailto',
),
'opening_hours' => array(
'icon' => 'fa-solid fa-clock',
'class' => 'contact-hours',
'multiline' => true,
),
$fields['address'] = array(
'icon' => 'fa-solid fa-location-dot',
'class' => 'contact-address',
'multiline' => true,
);
$fields['phone'] = array(
'icon' => 'fa-solid fa-phone',
'class' => 'contact-phone',
'link' => 'tel',
);
$fields['email'] = array(
'icon' => 'fa-solid fa-envelope',
'class' => 'contact-email',
'link' => 'mailto',
);
$fields['opening_hours'] = array(
'icon' => 'fa-solid fa-clock',
'class' => 'contact-hours',
'multiline' => true,
);

echo '<ul class="sunflower-contact-list">';
Expand All @@ -83,7 +86,11 @@ public function widget( $args, $instance ) {
}

echo '<li class="' . esc_attr( $field['class'] ) . '">';
echo '<i class="' . esc_attr( $field['icon'] ) . '"></i>';

if ( ! empty( $field['icon'] ) ) {
echo '<i class="' . esc_attr( $field['icon'] ) . '"></i>';
}

echo '<span>';

if ( ! empty( $field['link'] ) && 'tel' === $field['link'] ) {
Expand Down
30 changes: 24 additions & 6 deletions functions/widgets.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Widget areas for Sunflower 26.
* Widget areas and custom widgets for Sunflower 26.
*
* @package Sunflower 26
*/
Expand All @@ -9,8 +9,6 @@
exit;
}

require_once get_template_directory() . '/functions/class-sunflower-contact-widget.php';

/**
* Register widget areas and custom widgets.
*/
Expand All @@ -20,7 +18,7 @@ function sunflower_widgets_init() {
array(
'name' => __( 'Footer Mitte', 'sunflower' ),
'id' => 'footer-center',
'description' => __( 'Widget-Bereich in der Footer-Mitte (z.B. Kontaktdaten).', 'sunflower' ),
'description' => __( 'Bereich in der Footer-Mitte für Kontakt-Widget', 'sunflower' ),
'before_widget' => '<div id="%1$s" class="widget footer-widget footer-widget--center %2$s">',
'after_widget' => '</div>',
'before_title' => '<h4 class="widget-title">',
Expand All @@ -32,7 +30,7 @@ function sunflower_widgets_init() {
array(
'name' => __( 'Footer Rechts', 'sunflower' ),
'id' => 'footer-right',
'description' => __( 'Widget-Bereich rechts im Footer (z.B. Suche).', 'sunflower' ),
'description' => __( 'Bereich rechts im Footer für die Suche', 'sunflower' ),
'before_widget' => '<div id="%1$s" class="widget footer-widget footer-widget--right %2$s">',
'after_widget' => '</div>',
'before_title' => '<h4 class="widget-title">',
Expand All @@ -44,7 +42,7 @@ function sunflower_widgets_init() {
array(
'name' => __( 'Header (nach Logo)', 'sunflower' ),
'id' => 'header-after-brand',
'description' => __( 'Widget-Bereich im Header nach dem Brand-Link (z.B. Suche).', 'sunflower' ),
'description' => __( 'Bereich im Header für die Suche', 'sunflower' ),
'before_widget' => '<div id="%1$s" class="widget header-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '',
Expand Down Expand Up @@ -82,3 +80,23 @@ function sunflower_widgets_init() {
add_action( 'widgets_init', 'sunflower_widgets_init' );

add_filter( 'use_widgets_block_editor', '__return_false' );

/**
* Use the search widget title as the search field placeholder instead of
* displaying it as a heading. The title is stored in a global that
* searchform.php picks up.
*
* @param string $title The widget title.
* @param array $instance The widget instance settings.
* @param string $id_base The widget ID base.
* @return string Empty string to suppress the heading output.
*/
function sunflower_search_title_to_placeholder( $title, $instance = array(), $id_base = '' ) {
if ( 'search' === $id_base && ! empty( $title ) ) {
global $sunflower_search_placeholder;
$sunflower_search_placeholder = $title;
return '';
}
return $title;
}
add_filter( 'widget_title', 'sunflower_search_title_to_placeholder', 10, 3 );
82 changes: 77 additions & 5 deletions sass/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
color: map.get($custom-colors, "tanne");

> div {
gap: var(--grid-margin);
gap: var(--double-grid-margin);

@include media-breakpoint-down(md) {
gap: var(--double-grid-margin);
Expand Down Expand Up @@ -151,20 +151,26 @@
.footermenu-1 {
width: 33.3%;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
gap: var(--grid-margin);

@include media-breakpoint-down(md) {
justify-content: flex-start;
align-items: flex-start;
width: 100%;
}
}

.footermenu-2 {
width: 33.3%;
display: flex;
justify-content: flex-end;
flex-direction: column;
align-items: flex-end;
gap: var(--grid-margin);

@include media-breakpoint-down(md) {
justify-content: flex-start;
align-items: flex-start;
width: 100%;
}
}

Expand Down Expand Up @@ -216,4 +222,70 @@
hr {
opacity: 0.6;
}

.footer-widget {
margin-bottom: 0;

.widget-title {
color: map.get($custom-colors, "tanne");
font-weight: 700;
font-size: 1.1rem;
letter-spacing: 0.3px;
margin-bottom: 0.5rem;
}

a {
color: map.get($custom-colors, "klee");

&:hover {
color: map.get($custom-colors, "tanne");
}
}

.sunflower-contact-list li {
border-bottom: none;
color: map.get($custom-colors, "tanne");

i {
color: map.get($custom-colors, "klee");
}
}

&--right {

.widget_search {

.search-form {
position: relative;
}

input[type="search"],
input[type="search"]:focus {
border: 1px solid map.get($custom-colors, "klee");
padding: 4px 30px 4px 8px;
border-radius: var(--border-radius-tiny);
background: none;
color: map.get($custom-colors, "tanne");
font-style: italic;
width: 100%;
}

.search-submit {
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 30px;
border: none;
background: transparent;
cursor: pointer;
padding: 0;

i {
color: map.get($custom-colors, "klee");
}
}
}
}
}
}
22 changes: 22 additions & 0 deletions sass/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,25 @@ body #content .wp-block-cover {
}

}

.search-no-results .page-content p {
text-align: center;
}

form[role="search"] {

input[type="search"] {
outline: none !important;
padding-left: 20px;
border-radius: 23px;
}

button[type="submit"] {
padding: 0;
width: 46px;

&:hover {
border: 2px solid map.get($custom-colors, "schwarzwald");
}
}
}
Loading