Commit 160399e1 authored by Benthe Kuijpers's avatar Benthe Kuijpers
Browse files

Resource changes

parent b8335b93
......@@ -3,7 +3,7 @@ $post_type_obj = get_post_type_object( $post_type ); ?>
<main id="primary" class="site-main">
<div class="container container--small">
<div class="container">
<div class="page-header">
<h1>
......@@ -35,7 +35,7 @@ $post_type_obj = get_post_type_object( $post_type ); ?>
<a href="javascript:window.location.reload();" class="text-link"><?php _e('Reset filters', 'makeitopen'); ?></a>
</div>
<div class="list">
<div class="grid grid--masonry">
<?php
$query = new WP_query(array(
'post_type' => $post_type_obj->name,
......
......@@ -62,9 +62,9 @@
button.addClass('filter-button--active');
$('.archive__no-results').hide();
$('.list').isotope({ filter: filter });
$('.grid').isotope({ filter: filter });
if (!$('.list').data('isotope').filteredItems.length ) {
if (!$('.grid').data('isotope').filteredItems.length ) {
$('.archive__no-results').show();
}
});
......
!function(e){e(document).ready(function(){function t(e){var t={g:!0,j:!0,p:!0,q:!0,y:!0},s=e.html().split("");for(i=0,i=0;i<s.length;i+=1)t[s[i]]&&(s[i]='<span class="descender descender--'+s[i]+'">'+s[i]+"</span>");e.html(s.join(""))}e(window).scroll(function(t){e(window).scrollTop()>200?e(".site-header").addClass("site-header--scrolling"):e(".site-header").removeClass("site-header--scrolling")}),e(".js-toggle-hamburger").click(function(){e(this).toggleClass("hamburger--active"),e(".site-header").toggleClass("site-header--nav-active"),e(".navigation").toggleClass("navigation--shown")}),e(".menu-item a").each(function(){t(e(this))}),e(".page-header h1").each(function(){t(e(this))}),e("blockquote strong").each(function(){t(e(this))}),e(".menu-item.osn a").append('<span class="arrow">↗</span>'),e(".archive__filters").on("click",".filter-button",function(){var t=e(this),i=t.attr("data-filter");t.parent().addClass("archive__filters--active"),e(".filter-button").removeClass("filter-button--active"),t.addClass("filter-button--active"),e(".archive__no-results").hide(),e(".list").isotope({filter:i}),e(".list").data("isotope").filteredItems.length||e(".archive__no-results").show()})})}(jQuery);
\ No newline at end of file
!function(e){e(document).ready(function(){function t(e){var t={g:!0,j:!0,p:!0,q:!0,y:!0},a=e.html().split("");for(i=0,i=0;i<a.length;i+=1)t[a[i]]&&(a[i]='<span class="descender descender--'+a[i]+'">'+a[i]+"</span>");e.html(a.join(""))}e(window).scroll(function(t){e(window).scrollTop()>200?e(".site-header").addClass("site-header--scrolling"):e(".site-header").removeClass("site-header--scrolling")}),e(".js-toggle-hamburger").click(function(){e(this).toggleClass("hamburger--active"),e(".site-header").toggleClass("site-header--nav-active"),e(".navigation").toggleClass("navigation--shown")}),e(".menu-item a").each(function(){t(e(this))}),e(".page-header h1").each(function(){t(e(this))}),e("blockquote strong").each(function(){t(e(this))}),e(".menu-item.osn a").append('<span class="arrow">↗</span>'),e(".archive__filters").on("click",".filter-button",function(){var t=e(this),i=t.attr("data-filter");t.parent().addClass("archive__filters--active"),e(".filter-button").removeClass("filter-button--active"),t.addClass("filter-button--active"),e(".archive__no-results").hide(),e(".grid").isotope({filter:i}),e(".grid").data("isotope").filteredItems.length||e(".archive__no-results").show()})})}(jQuery);
\ No newline at end of file
......@@ -54,4 +54,20 @@
}
}
}
&--masonry {
margin: 0 -20px;
margin-bottom: 300px;
>* {
margin: 20px;
flex: 0 0 calc(100% - 40px);
width: calc(100% - 40px);
@media only screen and (min-width: $medium) {
flex: 0 0 calc(50% - 40px);
width: calc(50% - 40px);
}
}
}
}
\ No newline at end of file
.list {
margin: 0 0 100px;
min-height: 90vh;
&__item {
a {
......@@ -35,3 +34,15 @@
}
}
}
// Resource list to grid: smaller titles
.grid .list__item a {
padding: 0;
h2 {
@media only screen and (min-width: $smallmedium) {
font-size: 23px;
line-height: 26px;
}
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@ function mio_custom_post_types() {
),
'hierarchical' => true,
'has_archive' => true,
'supports' => array( 'title', 'editor', 'author' )
'supports' => array( 'title', 'excerpt', 'editor', 'author' )
);
register_post_type( 'resources', $args );
......
......@@ -15,6 +15,11 @@ $url = ($type === 'url') ? get_field('url', $resource_post) : get_field('file',
}
} ?>
<h2><?php echo get_the_title($resource_post); ?></h2>
<p><?php echo excerpt(get_the_excerpt($resource_post), 100); ?></p>
<p><?php
if (is_post_type_archive('resources')) {
echo get_the_content();
} else {
echo excerpt(get_the_excerpt($resource_post), 100);
} ?></p>
</a>
</div>
\ No newline at end of file
......@@ -38,6 +38,7 @@
$resource_items = get_sub_field('resources');
foreach ($resource_items as $resource) {
$filterclass = '';
$resource_post = get_post($resource);
$resource_filters = get_the_terms($resource_post, 'resource-types' );
include(locate_template('template-parts/elements/resource-teaser.php'));
......
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