Skip to content

Commit

Permalink
update on frontpage boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjorn Zschernack committed Nov 4, 2023
1 parent e75636c commit a273855
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 30 deletions.
25 changes: 24 additions & 1 deletion scss/includes/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,36 @@
&:nth-child(1n) {
margin-right: 20px;
}
&:nth-child(2n) {
&:nth-child(2n) {
margin-right: 0;
}
}
@media (max-width: 768px) {
margin-right: 0 !important;
}


.single-post-image{
width: 100%;
height: 240px;
background-color: $lightgrey;

&.bg-contain{
background-size: auto;
background-repeat: no-repeat;
background-position: center;
}
&.bg-cover{
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
}
.single-post-content{
width: 100%;
height: 240px;
background-color: #fff;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions scss/includes/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ $orange:#e8a422;
$green:#89b459;
$red:#ea612e;
$blue:#245861;
$lightgrey:#f7f8f8;
20 changes: 20 additions & 0 deletions scss/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,26 @@ body header .contact .clock:before {
margin-right: 0 !important;
}
}
.posts-grid .single-post .single-post-image {
width: 100%;
height: 240px;
background-color: #f7f8f8;
}
.posts-grid .single-post .single-post-image.bg-contain {
background-size: auto;
background-repeat: no-repeat;
background-position: center;
}
.posts-grid .single-post .single-post-image.bg-cover {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.posts-grid .single-post .single-post-content {
width: 100%;
height: 240px;
background-color: #fff;
}

#about-banner {
min-height: 100px;
Expand Down
35 changes: 6 additions & 29 deletions template-parts/posts/postgrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,11 @@

<div class="posts-grid p-0 w-100">

<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<?php get_template_part('template-parts/posts/single','', get_field('box_1', 'options')); ?>
<?php get_template_part('template-parts/posts/single','', get_field('box_2', 'options')); ?>
<?php get_template_part('template-parts/posts/single','', get_field('box_3', 'options')); ?>
<?php get_template_part('template-parts/posts/single','', get_field('box_4', 'options')); ?>
<?php get_template_part('template-parts/posts/single','', get_field('box_5', 'options')); ?>
<?php get_template_part('template-parts/posts/single','', get_field('box_6', 'options')); ?>

</div>
27 changes: 27 additions & 0 deletions template-parts/posts/single.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@


<div class="single-post bg-white">

<?php if(isset($args['bild'])): ?>

<?php $image = wp_get_attachment_image_src($args['bild'],'full'); ?>


<?php if($args['bild_volle_breite']): ?>
<div class="single-post-image d-flex flex-column justify-content-center align-items-cente bg-cover" style="background-image:url('<?php echo $image[0]; ?>');"></div>
<?php else: ?>
<div class="single-post-image d-flex flex-column justify-content-center align-items-center bg-contain" style="background-image:url('<?php echo $image[0]; ?>');"></div>
<?php endif; ?>

<?php endif; ?>

<div class="single-post-content d-flex flex-column justify-content-center align-items-center">
<?php if(isset($args['headline'])): ?>
<h2><?php echo $args['headline']; ?></h2>
<?php endif; ?>

<?php if(isset($args['subline'])): ?>
<p class="single-post-content-p"><?php echo $args['subline']; ?></p>
<?php endif; ?>
</div>
</div>

0 comments on commit a273855

Please sign in to comment.