Skip to content

Commit

Permalink
update frontpage
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjorn Zschernack committed Nov 3, 2023
1 parent f246522 commit 004b352
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 96 deletions.
7 changes: 6 additions & 1 deletion front-page.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<?php get_header(); ?>

<div class="container-fluid p-0" id="main">
<div class="container p-0" id="main">

<div class="row">
<div class="col-12">
<?php get_template_part('template-parts/posts/postgrid'); ?>
</div>
</div>

</div>

Expand Down
15 changes: 15 additions & 0 deletions scss/includes/_content.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.posts-grid {
display: grid;
font-size: 20px;
padding: 25px;
grid-template-columns: repeat(3, 1fr );
padding-top: 40px;

.single-post {
min-height: 100px;
box-shadow: 0 33px 36px 0 rgba(93, 108, 123, 0.08);
background-color: #fff;
margin-right: 20px;
margin-bottom: 20px;
}
}
2 changes: 2 additions & 0 deletions scss/includes/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ body {
font-family: 'BarlowBold';
}



#page-wrap {
max-width: 1320px;
height:100%;
Expand Down
15 changes: 15 additions & 0 deletions scss/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,19 @@ body header .contact .clock:before {
}
#menucontainer ul li.blue a {
border-bottom: 8px solid #245861;
}

.posts-grid {
display: grid;
font-size: 20px;
padding: 25px;
grid-template-columns: repeat(3, 1fr);
padding-top: 40px;
}
.posts-grid .single-post {
min-height: 100px;
box-shadow: 0 33px 36px 0 rgba(93, 108, 123, 0.08);
background-color: #fff;
margin-right: 20px;
margin-bottom: 20px;
}
1 change: 1 addition & 0 deletions scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
@import 'includes/variables';
@import 'includes/main';
@import 'includes/menu';
@import 'includes/content';


51 changes: 0 additions & 51 deletions template-parts/posts/postgrid-large.php

This file was deleted.

72 changes: 28 additions & 44 deletions template-parts/posts/postgrid.php
Original file line number Diff line number Diff line change
@@ -1,52 +1,36 @@
<?php
$arguments = array(
'posts_per_page' => 4,
'orderby' => 'date',
'order' => 'DESC',
'post_status' => 'publish',
'post_type' => 'post',
'page' => 1,
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'kardanwelle',
)
)
);
$title = "Produkte und Services";
$bg = "bg-2";
<h1 class="text-center m-5">Das Fahrzeugzentrum Olpe ist Ihr Spezialist rund um
Fahrzeuge, Felgenreparaturen, Fahrzeugaufbereitung, Beschichtungen, Service und vieles mehr.</h1>

if(isset($args['category'])) :
$arguments['tax_query'][0]['terms'] = $args['category'];
endif;
if(isset($args['title'])) :
$title = $args['title'];
endif;
if(isset($args['bg'])) :
$bg = $args['bg'];
endif;
$posts = get_posts($arguments);
<div class="posts-grid">


?>
<div class="w-100 text-center <?php echo $bg; ?>">
<h2 class="category-headline"><?php echo $title; ?></h2>
<hr class="yellow-line" />
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="posts-grid <?php echo $bg; ?>">
<?php foreach($posts as $post): ?>
<div class="single-post">
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<?php
$image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'catlist')[0];
$readmore_text = get_post_meta( $post->ID, 'readmore-text', true );
?>
<div class="single-post">
<img src="<?php echo $image; ?>" alt="<?php echo $post->post_title; ?>" class="img-fluid"/>
<h2> <a href="<?php echo get_permalink($post->ID); ?>"><?php echo $post->post_title; ?></a></h2>
<p><?php echo $post->post_excerpt; ?></p>
<a href="<?php echo get_permalink($post->ID); ?>" class="readmore"><?php echo $readmore_text; ?></a>
</div>
<div class="single-post">
</div>
<div class="single-post">
</div>
<?php endforeach; ?>
</div>

0 comments on commit 004b352

Please sign in to comment.