Commit afed6773 authored by Benthe Kuijpers's avatar Benthe Kuijpers
Browse files

setup of 404, single, and event pages

parent 7e885ba3
......@@ -2,18 +2,20 @@
<main id="primary" class="site-main">
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'makeitopen' ); ?></h1>
</header><!-- .page-header -->
<div class="container">
<section class="error-404 not-found">
<header class="page-header">
<h1>404</h1>
<h4><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'makeitopen' ); ?></h4>
</header>
<div class="page-content">
<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'makeitopen' ); ?></p>
</div><!-- .page-content -->
</section><!-- .error-404 -->
<div class="page-content">
<p><?php esc_html_e( 'It looks like this page doesn\'t exist (anymore).', 'makeitopen' ); ?></p>
<a href="<?php echo home_url(); ?>" class="btn"><?php _e('go to the homepage'); ?></a>
</div>
</section>
</div>
</main><!-- #main -->
<?php
get_footer();
<?php get_footer(); ?>
\ No newline at end of file
......@@ -155,5 +155,5 @@
"hide_on_screen": "",
"active": true,
"description": "",
"modified": 1614584465
"modified": 1614683424
}
\ No newline at end of file
{
"key": "group_603e1bf568219",
"title": "Event",
"fields": [
{
"key": "field_603e1bf9a9bb5",
"label": "Date",
"name": "date",
"type": "date_picker",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"display_format": "j F, Y",
"return_format": "m\/d\/Y",
"first_day": 1
},
{
"key": "field_603e1c03aec18",
"label": "Time (start)",
"name": "time_start",
"type": "time_picker",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "50",
"class": "",
"id": ""
},
"display_format": "g:i a",
"return_format": "g:i a"
},
{
"key": "field_603e1c16aec19",
"label": "Time (end)",
"name": "time_end",
"type": "time_picker",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "50",
"class": "",
"id": ""
},
"display_format": "g:i a",
"return_format": "g:i a"
}
],
"location": [
[
{
"param": "post_type",
"operator": "==",
"value": "events"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": true,
"description": "",
"modified": 1614683905
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
}
&:before {
z-index: -1;
content: "";
position: absolute;
top: 0;
......
......@@ -3,6 +3,16 @@ h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
h2 {
font-size: 36px;
line-height: 36px;
}
h3 {
font-size: 32px;
line-height: 36px;
}
h4 {
font-size: 22px;
line-height: 28px;
......@@ -10,12 +20,23 @@ h4 {
p, ul, ol {
font-family: 'IBM Plex Sans', sans-serif;
font-size: 14px;
line-height: 22px;
font-size: 20px;
line-height: 32px;
margin: 0 0 20px;
color: black;
}
p.small {
font-size: 14px;
line-height: 22px;
}
p.introduction {
font-size: 24px;
line-height: 38px;
font-family: $font-header;
}
a {
color: black;
}
......
a.btn {
color: white;
font-weight: bold;
font-family: $font-header;
text-decoration: none;
background: $blue;
padding: 10px 20px;
position: relative;
margin: 0;
display: inline-block;
mix-blend-mode: multiply;
font-size: 18px;
@include colourBg($bg-red, 2deg);
&:after {
margin-left: 5px;
content: "\2192";
transition: all 0.25s ease-out;
display: inline-block;
}
&:hover {
&:after {
transform: translateX(2px);
}
}
}
\ No newline at end of file
.events-teaser {
margin: 10px 0;
a {
display: flex;
flex-wrap: wrap;
align-items: center;
text-decoration: none;
}
&__date {
background: $blue;
flex: 0 0 60px;
margin: 0 20px 0 0;
font-family: $font-header;
color: white;
font-weight: bold;
text-align: center;
font-size: 20px;
line-height: 22px;
padding: 10px;
}
&__text {
flex: 1;
h4 {
margin: 0;
}
}
}
\ No newline at end of file
@import "buttons";
@import "events-teaser";
@import "news-teaser";
\ No newline at end of file
.error-404 {
padding: 50px 0;
@media only screen and (min-width: $large) {
padding: 200px 0;
}
h1 {
font-size: 200px;
line-height: 180px;
margin: 0;
color: $bg-red;
}
}
\ No newline at end of file
.single {
&__content {
display: block;
padding: 30px 0 200px;
h1 {
font-size: 56px;
}
}
&__image {
margin: 0 0 60px;
@include colourBg($bg-yellow, -1deg);
img {
transform: rotate(0.5deg);
}
}
}
\ No newline at end of file
@import "error";
@import "single";
\ No newline at end of file
......@@ -31,7 +31,7 @@
if ($eu_text) { ?>
<div class="footer__europe">
<img src="<?php echo get_template_directory_uri(); ?>/assets/img/europe.svg">
<p><?php echo $eu_text; ?></p>
<p class="small"><?php echo $eu_text; ?></p>
</div>
<?php } ?>
</div>
......
......@@ -10,10 +10,11 @@ function mio_custom_post_types() {
'add_new' => __('New resource'),
'edit_item' => __( 'Edit resource' ),
'all_items' => __( 'All resources' ),
'view_item' => __( 'View resource' )
'view_item' => __( 'View resource' ),
'view_items' => __( 'View all resources' )
),
'hierarchical' => true,
'has_archive' => false,
'has_archive' => true,
'supports' => array( 'title', 'editor', 'author' )
);
register_post_type( 'resources', $args );
......
......@@ -2,15 +2,23 @@
<main id="primary" class="site-main">
<?php
while ( have_posts() ) :
the_post();
<div class="container container--small">
<div class="single__content">
<?php
while ( have_posts() ) :
the_post();
the_title();
the_content();
if (has_post_thumbnail()) {
echo '<div class="single__image">' . get_the_post_thumbnail($post, 'large') . '</div>';
}
endwhile;
?>
echo '<h1>' . get_the_title() . '</h1>';
the_content();
endwhile;
?>
</div>
</div>
</main>
......
<article class="events-teaser">
<a href="<?php echo get_the_permalink($event_post); ?>">
<div class="events-teaser__date">
<?php
$terms = get_the_terms( $event_post, 'event-categories' );
$dateformat = date_format(date_create(get_field('date', $event_post)), 'j M');
$date = explode(' ', $dateformat, 2);
echo $date[0] . '<br>' . $date[1];
?>
</div>
<div class="events-teaser__text">
<?php if (!empty($terms)) {
$terms_string = join(', ', wp_list_pluck($terms, 'name'));
echo '<span class="label">' . $terms_string . '</span>';
} ?>
<h4><?php echo get_the_title($event_post); ?></h4>
</div>
</a>
</article>
\ No newline at end of file
<div class="content-row">
<div class="container">
<h3>Events</h3>
<?php
// Get max. 5 future events
$today = date('Ymd');
$events = new WP_Query( array (
'posts_per_page' => 5,
'post_type' => 'events',
'meta_query' => array(
array(
'key' => 'date',
'value' => $today,
'compare' => '>=',
),
),
'orderby' => 'meta_value_num',
'order' => 'ASC',
'fields' => 'ID'
));
$event_items = $events->posts;
foreach ($event_items as $event) {
$event_post = get_post($event);
include(locate_template('template-parts/elements/events-teaser.php'));
} ?>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment