Only show excerpts on frontpage, compacts view

This commit is contained in:
nikolark committed 2014-09-02 21:35:32 +02:00
1 parent 33ec99a003
commit fa28669eb3
6 files changed
+93 -43

No files matched your search

+20 -7
View File
@@ -8,15 +8,28 @@ $args = array(
$posts = new WP_Query( $args );
if( $posts->have_posts() ) : while( $posts->have_posts() ) : $posts->the_post(); ?>
if( $posts->have_posts() ) : while( $posts->have_posts() ) : $posts->the_post();
$post_category = "";
if( count(get_the_category()) >= 1 ) {
$cat = get_the_category()[0];
$post_category = '<a href="'. get_category_link($cat->term_id) .'" class="label-category"><span class="dashicons dashicons-tag"></span>'. $cat->name .'</a>';
}
?>
<article <?php post_class(); ?>>
<div class="text-body">
<h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><div class="entry-category"><?php the_category(); ?></div> <!-- .entry-category --></h3>
<div class="entry-meta byline"><span class="meta-prep meta-prep-author">av </span><span class="author vcard"><?php the_author_link(); ?></span>, <span class="entry-date"><?php the_time( get_option( 'date_format' ) ." ". get_option( 'time_format' ) ); ?></span></div>
<?php the_post_thumbnail(); ?>
<div class="entry-content"><?php the_content(); ?></div> <!-- .entry-content -->
<span class="comments-link"><?php comments_popup_link(); ?></span>
<h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="entry-meta byline">
<span class="meta-prep meta-prep-author">av </span>
<span class="author vcard"><?php the_author_link(); ?></span>,
<span class="entry-date"><?php the_time( get_option( 'date_format' ) ." ". get_option( 'time_format' ) ); ?></span>
</div>
<span class="entry-category"><?php echo $post_category; ?></span> <!-- .entry-category -->
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('feed'); ?></a>
<div class="entry-content excerpt"><?php the_excerpt(); ?></div> <!-- .entry-content -->
<div class="actions-container">
<a class="button radius read-more" href="<?php get_permalink( get_the_ID() ) ?>'">Les hele innlegget</a>
<span class="comments-link"><?php comments_popup_link(); ?></span>
</div>
</div>
</article> <!-- .post -->
@@ -9,9 +9,10 @@ $header-font-color: #000;
$primary-color: darken(#E99835, 5%);
$secondary-color: #008CBA;
$label-bg-color: #FF1F00;
$label-bg-color: lighten(#FF1F00, 10%);
$site-header-bg-color: #333;
@import "foundation/components/global";
/* Misc */
@@ -21,6 +22,8 @@ $table-row-padding: rem-calc(12 16);
$row-width: rem-calc(1250);
$column-gutter: rem-calc(30);
$padding-base: rem-calc(16);
@import "foundation/components/grid";
@import "foundation/components/block-grid";
@import "foundation/components/visibility";
@@ -279,44 +282,62 @@ $menu-padding: rem-calc(18);
/* Single */
.text-body {
@extend .card;
padding-left: rem-calc(16);
padding-right: rem-calc(16);
padding-left: $padding-base;
padding-right: $padding-base;
margin-bottom: rem-calc(32);
position: relative;
}
.entry-title {
display: inline-block;
}
.entry-meta {
display: inline-block;
margin-bottom: rem-calc(10);
font-weight: 300;
color: #666;
clear: both;
}
.entry-content {
margin-top: rem-calc(20);
&.excerpt p {
margin-bottom: 8px;
}
}
.entry-category {
padding-bottom: rem-calc(30);
font-weight: 300;
color: #666;
.post-categories {
list-style: none;
padding: 0;
margin: 0;
.dashicons-tag {
font-size: rem-calc(18);
vertical-align: baseline;
position: relative;
top: 3px;
left: -2px;
}
li {
display: block;
float: left;
padding-right: rem-calc(6);
&:last-child {
padding-right: 0;
}
}
a {
.label-category {
@include label(
$padding: 0.5em 0.7em,
$padding: 2px 7px 7px,
$text-size: rem-calc(14),
$bg: $label-bg-color,
$radius:4px
);
margin-bottom: 8px;
}
}
.read-more {
padding: 10px 16px;
margin-bottom: 8px;
}
.actions-container {
text-align: right;
@include clearfix();
}
.comments-link {
float: left;
padding-top: rem-calc(20);
}
/* Login */
.page-login {
#content {
+1 -1
View File
@@ -1 +1 @@
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}dfn{font-style:italic}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-size:1em}kbd,pre,samp{font-family:monospace,monospace}button{font:inherit}input,optgroup{margin:0}input,optgroup,select,textarea{color:inherit;font:inherit}button{overflow:visible}button,select{text-transform:none}html input[type="button"],input[type="reset"]{-webkit-appearance:button;cursor:pointer}input[type="submit"]{cursor:pointer}html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;box-sizing:border-box;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:23px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url('../images/chosen-sprite.png') -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover,.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url('../images/chosen-sprite.png') no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type="text"]{box-sizing:border-box;margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url('../images/chosen-sprite.png') no-repeat 100% -20px;background:url('../images/chosen-sprite.png') no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-resultLine truncated
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}dfn{font-style:italic}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-size:1em}kbd,pre,samp{font-family:monospace,monospace}button{font:inherit}input,optgroup{margin:0}input,optgroup,select,textarea{color:inherit;font:inherit}button{overflow:visible}button,select{text-transform:none}html input[type="button"],input[type="reset"]{-webkit-appearance:button;cursor:pointer}input[type="submit"]{cursor:pointer}html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;box-sizing:border-box;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:23px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url('../images/chosen-sprite.png') -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover,.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url('../images/chosen-sprite.png') no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type="text"]{box-sizing:border-box;margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url('../images/chosen-sprite.png') no-repeat 100% -20px;background:url('../images/chosen-sprite.png') no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-resultLine truncated
+9 -4
View File
@@ -5,10 +5,8 @@ add_theme_support( 'automatic-feed-links' );
$content_width = 770;
add_image_size( 'cover-photo' , 1440, 480, true );
add_image_size( 'six-column-promo' , 570 , 322 , true );
add_image_size( 'six-column-slim' , 570 , 161 , true );
add_image_size( 'cover-photo' , 1440, 810, true );
add_image_size( 'feed' , 770, 433, true, 'center', 'top' );
/**
* Register navigation menus.
*/
@@ -397,4 +395,11 @@ add_action( 'wp_enqueue_scripts', 'neuf_load_dashicons' );
function neuf_load_dashicons() {
wp_enqueue_style( 'dashicons' );
}
/* Read more link */
function neuf_excerpt_more( $more ) {
return '...';
}
add_filter( 'excerpt_more', 'neuf_excerpt_more' );
?>
+3 -2
View File
@@ -25,9 +25,10 @@ gulp.task('styles', function () {
//.pipe($.plumber(onError))
.pipe($.sass({
includePaths: ['app/bower_components/foundation/scss'],
errLogToConsole: true
errLogToConsole: true,
sourceComments: 'map'
}))
.pipe($.autoprefixer('last 1 version'))
//.pipe($.autoprefixer('last 1 version'))
.pipe($.plumber.stop())
.pipe(gulp.dest('dist/styles'))
.pipe($.size());
+20 -10
View File
@@ -2,36 +2,46 @@
<div class="container">
<div id="content">
<h1 class="page-title"><?php wp_title("", true); ?></h1>
<?php if( have_posts() ) : while( have_posts() ) : the_post(); ?>
<?php if( !is_single() ): ?>
<h1 class="page-title"><?php wp_title("", true); ?></h1>
<?php endif; ?>
<?php if( have_posts() ) : while( have_posts() ) : the_post();
$post_category = "";
if( count(get_the_category()) >= 1 ) {
$post_category = get_the_category()[0]->name;
$post_category = "<span class=\"label-category\"><span class=\"dashicons dashicons-tag\"></span>$post_category</span>";
} ?>
<article <?php post_class(); ?>>
<div class="text-body">
<?php if( !is_single() && !is_page() ): ?>
<?php if( !is_page() ): ?>
<h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php endif; ?>
<?php if( !is_page() ): ?>
<div class="entry-category"><?php the_category(); ?></div>
<?php endif; ?>
<?php if( !is_page() ): ?>
<div class="entry-meta byline"><span class="meta-prep meta-prep-author">av </span><span class="author vcard"><?php the_author_link(); ?></span>, <span class="entry-date"><?php the_time( get_option( 'date_format' ) ." ". get_option( 'time_format' ) ); ?></span></div>
<?php endif; ?>
<?php the_post_thumbnail(); ?>
<?php if( !is_page() ): ?>
<span class="entry-category"><?php echo $post_category; ?></span>
<?php endif; ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('feed'); ?></a>
<?php if( is_single() || is_page() || is_home() ): ?>
<div class="entry-content"><?php the_content(); ?></div> <!-- .entry-content -->
<?php else: ?>
<div class="entry-content"><?php the_excerpt(); ?></div> <!-- .entry-content -->
<div class="entry-content excerpt"><?php the_excerpt(); ?></div> <!-- .entry-content -->
<?php endif; ?>
<?php if( is_single() ): ?>
<?php comments_template(); ?>
<?php elseif( !is_page() ): ?>
<span class="comments-link"><?php comments_popup_link(); ?></span>
<div class="actions-container">
<a class="button radius read-more" href="<?php get_permalink( get_the_ID() ) ?>'">Les hele innlegget</a>
<span class="comments-link"><?php comments_popup_link(); ?></span>
</div>
<?php endif; ?>