Pagination on front page, minor
This commit is contained in:
1 parent
12a64228b0
commit
029fdbd32d
8 files changed
+108
-288
No files matched your search
@@ -56,7 +56,7 @@ body {
|
||||
}
|
||||
|
||||
/* Front page */
|
||||
.front-page {
|
||||
.home {
|
||||
.introduction {
|
||||
position: relative;
|
||||
@extend .card;
|
||||
@@ -65,7 +65,7 @@ body {
|
||||
.introduction {
|
||||
padding-left: rem-calc(16);
|
||||
}
|
||||
.activities-wrap .post {
|
||||
.post {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
@@ -142,6 +142,9 @@ body {
|
||||
float: left;
|
||||
padding-top: rem-calc(20);
|
||||
}
|
||||
.navigation {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Login */
|
||||
.page-login {
|
||||
@@ -493,6 +496,21 @@ input[type=submit]{
|
||||
}
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer {
|
||||
@include grid-row();
|
||||
.footer-wrap {
|
||||
@include grid-column(12);
|
||||
}
|
||||
.credits {
|
||||
margin-top: 25px;
|
||||
margin-bottom: 25px;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
font-size: rem-calc(12);
|
||||
}
|
||||
}
|
||||
|
||||
/* Reusable styles */
|
||||
.card {
|
||||
padding-top: rem-calc(10);
|
||||
@@ -511,18 +529,6 @@ input[type=submit]{
|
||||
.love {
|
||||
color: #faafba;
|
||||
}
|
||||
.credits-wrap {
|
||||
@include grid-row();
|
||||
|
||||
.credits {
|
||||
margin-top: 25px;
|
||||
margin-bottom: 25px;
|
||||
@include grid-column(12);
|
||||
text-align: center;
|
||||
color: #666;
|
||||
font-size: rem-calc(12);
|
||||
}
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
.fadein {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
/*! normalize.css v3.0.2 | 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,menu,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-color:transparent}a:active,a:hover{outline:0}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-results li.group-option{Line truncated
|
||||
/*! normalize.css v3.0.2 | 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,menu,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-color:transparent}a:active,a:hover{outline:0}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-results li.group-option{Line truncated
|
||||
@@ -4,20 +4,20 @@
|
||||
|
||||
<article <?php post_class(); ?>>
|
||||
<div class="text-body">
|
||||
<div>
|
||||
<?php if( !is_page() ): ?>
|
||||
<h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
|
||||
<?php endif; ?>
|
||||
<div>
|
||||
<?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-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 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 if( !is_page() ): ?>
|
||||
<span class="entry-category"><?php echo $post_category; ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if( !is_page() ): ?>
|
||||
<span class="entry-category"><?php echo $post_category; ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('feed'); ?></a>
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php $footer_about_text = get_theme_mod( 'footer_about_text',""); ?>
|
||||
<footer id="site-footer">
|
||||
<?php echo $footer_about_text; ?>
|
||||
</footer> <!-- #site-footer -->
|
||||
<div class="footer-wrap">
|
||||
<?php echo $footer_about_text; ?>
|
||||
|
||||
<div class="credits-wrap">
|
||||
<div class="credits">Laget med <span class="love" title="kærlighed">♥</span> av <a href="http://kak.studentersamfundet.no/" title="Kommunikasjonsavdelingen">KAK</a></div>
|
||||
</div>
|
||||
<div class="credits">Laget med <span class="love" title="kærlighed">♥</span> av <a href="http://kak.studentersamfundet.no/" title="Kommunikasjonsavdelingen">KAK</a></div>
|
||||
</div>
|
||||
</footer> <!-- #site-footer -->
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
|
||||
@@ -61,21 +61,6 @@ function neuf_handle_upload_prefilter( $file ) {
|
||||
}
|
||||
add_filter( 'wp_handle_upload_prefilter' , 'neuf_handle_upload_prefilter' );
|
||||
|
||||
/* Gets nicely the regular and member price nicely formated */
|
||||
function neuf_get_price( $neuf_event ) {
|
||||
$price_regular = get_post_meta( $neuf_event->ID , '_neuf_events_price_regular' , true );
|
||||
$price_member = get_post_meta( $neuf_event->ID , '_neuf_events_price_member' , true );
|
||||
if ( $price_regular ) {
|
||||
if ( $price_member )
|
||||
$cc = "$price_regular/$price_member";
|
||||
else
|
||||
$cc = $price_regular;
|
||||
} else
|
||||
$cc = '';
|
||||
|
||||
return $cc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds more semantic classes to WP's body_class.
|
||||
*
|
||||
@@ -94,129 +79,6 @@ function neuf_body_class( $classes = '' ) {
|
||||
body_class( $classes );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines what to display in our title element.
|
||||
*
|
||||
* Most of this borrowed from the Thematic theme framework.
|
||||
*/
|
||||
function neuf_doctitle() {
|
||||
$site_name = get_bloginfo( 'name' );
|
||||
$separator = '|';
|
||||
|
||||
if ( is_single() ) {
|
||||
$content = single_post_title( '' , false );
|
||||
|
||||
} elseif ( is_home() || is_front_page() ) {
|
||||
$content = get_bloginfo( 'description' );
|
||||
|
||||
} elseif ( is_page() ) {
|
||||
$content = single_post_title( '' , false );
|
||||
|
||||
} elseif ( is_search() ) {
|
||||
$content = __( 'Søkeresultater for', 'neuf-web' );
|
||||
$content .= ' ' . esc_html(stripslashes(get_search_query()));
|
||||
|
||||
} elseif ( is_category() ) {
|
||||
$content = __( 'Arkiv for kategorien' , 'neuf-web' );
|
||||
$content .= ' ' . single_cat_title( "" , false );;
|
||||
|
||||
} elseif ( is_tag() ) {
|
||||
$content = __( 'Arkiv for stikkordet' , 'neuf-web' );
|
||||
$content .= ' ' . neuf-web_tag_query();
|
||||
|
||||
} elseif ( is_404() ) {
|
||||
$content = __( 'Ikke funnet', 'neuf-web' );
|
||||
|
||||
} else {
|
||||
$content = get_bloginfo( 'description' );
|
||||
}
|
||||
|
||||
if ( get_query_var( 'paged' ) ) {
|
||||
$content .= ' ' .$separator. ' ';
|
||||
$content .= 'side';
|
||||
$content .= ' ';
|
||||
$content .= get_query_var('paged');
|
||||
}
|
||||
|
||||
if($content) {
|
||||
if ( is_home() || is_front_page() ) {
|
||||
$elements = array(
|
||||
'site_name' => $site_name,
|
||||
'separator' => $separator,
|
||||
'content' => $content
|
||||
);
|
||||
} else {
|
||||
$elements = array(
|
||||
'content' => $content,
|
||||
'separator' => $separator,
|
||||
'site_name' => $site_name
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$elements = array(
|
||||
'site_name' => $site_name
|
||||
);
|
||||
}
|
||||
|
||||
$doctitle = implode(' ', $elements);
|
||||
|
||||
$doctitle = "\t" . "<title>" . $doctitle . "</title>" . "\n\n";
|
||||
|
||||
echo $doctitle;
|
||||
} // end neuf_doctitle
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display social sharing buttons
|
||||
*/
|
||||
function display_social_sharing_buttons() { ?>
|
||||
<div id="social-sharing">
|
||||
<div class="share-twitter">
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-lang="no">Tweet</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
||||
</div> <!-- .share-twitter -->
|
||||
<div class="share-facebook">
|
||||
<div class="fb-like" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true" data-action="recommend"></div>
|
||||
</div> <!-- .share-facebook -->
|
||||
</div> <!-- #social-sharing -->
|
||||
<?php }
|
||||
|
||||
/**
|
||||
* Count attachments to a post.
|
||||
*
|
||||
* Stolen from misund's blog theme.
|
||||
*
|
||||
* @author misund
|
||||
*/
|
||||
function neuf_get_attachment_count() {
|
||||
global $post;
|
||||
|
||||
$attachments = get_children( array(
|
||||
'post_parent' => $post->ID,
|
||||
'post_type' => 'any',
|
||||
'numberposts' => -1,
|
||||
'post_status' => 'any'
|
||||
) );
|
||||
|
||||
return count( $attachments );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a gallery if suitable (Template Tag).
|
||||
*
|
||||
* If a post has more than two attachments, we should probably display them in
|
||||
* single view. This particularly applies to events. Photos of concerts etc.
|
||||
* can this way easily be added after the event, without much hassle.
|
||||
*
|
||||
* @author misund
|
||||
*/
|
||||
function neuf_maybe_display_gallery() {
|
||||
if ( 2 < neuf_get_attachment_count() )
|
||||
echo do_shortcode( '[gallery]' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Trims $text down to $length words.
|
||||
* If $text is truncated, then "[..]" is appended.
|
||||
@@ -239,110 +101,6 @@ function linkify($subject, $pattern, $link) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds and displays suitable page titles.
|
||||
*
|
||||
* Original author: Ian Stewart (theme Thematic).
|
||||
*/
|
||||
function neuf_page_title() {
|
||||
|
||||
global $post;
|
||||
|
||||
$content = '';
|
||||
if (is_attachment()) {
|
||||
$content .= '<h1 class="page-title"><a href="';
|
||||
$content .= apply_filters('the_permalink',get_permalink($post->post_parent));
|
||||
$content .= '" rev="attachment"><span class="meta-nav">Tilbake til </span>';
|
||||
$content .= get_the_title($post->post_parent);
|
||||
$content .= '</a></h1>';
|
||||
} elseif (is_author()) {
|
||||
$content .= '<h1 class="page-title author">';
|
||||
$author = get_the_author_meta( 'display_name' );
|
||||
$content .= __('Innhold skrevet av', 'neuf');
|
||||
$content .= ' <span>';
|
||||
$content .= $author;
|
||||
$content .= '</span></h1>';
|
||||
} elseif (is_category()) {
|
||||
$content .= '<h1 class="page-title">';
|
||||
$content .= __('Innhold i kategorien', 'neuf');
|
||||
$content .= ' <span>';
|
||||
$content .= single_cat_title('', FALSE);
|
||||
$content .= '</span></h1>' . "\n";
|
||||
$content .= '<div class="archive-meta">';
|
||||
if ( !(''== category_description()) ) : $content .= apply_filters('archive_meta', category_description()); endif;
|
||||
$content .= '</div>';
|
||||
} elseif (is_search()) {
|
||||
$content .= '<h1 class="page-title">';
|
||||
$content .= __('Søkeresultater for:', 'neuf');
|
||||
$content .= ' <span id="search-terms">';
|
||||
$content .= esc_html(stripslashes($_GET['s']));
|
||||
$content .= '</span></h1>';
|
||||
} elseif (is_tag()) {
|
||||
$content .= '<h1 class="page-title">';
|
||||
$content .= __('Innhold merket med', 'neuf');
|
||||
$content .= ' <span>';
|
||||
$content .= __(neuf_tag_query());
|
||||
$content .= '</span></h1>';
|
||||
} elseif (is_tax()) {
|
||||
global $taxonomy;
|
||||
$content .= '<h1 class="page-title">';
|
||||
$tax = get_taxonomy($taxonomy);
|
||||
$content .= $tax->labels->name . ' ';
|
||||
$content .= __('Arkiv:', 'neuf');
|
||||
$content .= ' <span>';
|
||||
$content .= neuf_get_term_name();
|
||||
$content .= '</span></h1>';
|
||||
} elseif (is_day()) {
|
||||
$content .= '<h1 class="page-title">';
|
||||
$content .= sprintf(__('Innhold fra dagen <span>%s</span>', 'neuf'), get_the_time(get_option('date_format')));
|
||||
$content .= '</h1>';
|
||||
} elseif (is_month()) {
|
||||
$content .= '<h1 class="page-title">';
|
||||
$content .= sprintf(__('Innhold fra måneden <span>%s</span>', 'neuf'), get_the_time('F Y'));
|
||||
$content .= '</h1>';
|
||||
} elseif (is_year()) {
|
||||
$content .= '<h1 class="page-title">';
|
||||
$content .= sprintf(__('Innhold fra året <span>%s</span>', 'neuf'), get_the_time('Y'));
|
||||
$content .= '</h1>';
|
||||
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
|
||||
$content .= '<h1 class="page-title">';
|
||||
$content .= __('Arkiv', 'neuf');
|
||||
$content .= '</h1>';
|
||||
}
|
||||
$content .= "\n";
|
||||
echo( $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates nice multi_tag_title.
|
||||
*
|
||||
* Original author: Martin Kopischke.
|
||||
*/
|
||||
|
||||
function neuf_tag_query() {
|
||||
$nice_tag_query = get_query_var('tag'); // tags in current query
|
||||
$nice_tag_query = str_replace(' ', '+', $nice_tag_query); // get_query_var returns ' ' for AND, replace by +
|
||||
$tag_slugs = preg_split('%[,+]%', $nice_tag_query, -1, PREG_SPLIT_NO_EMPTY); // create array of tag slugs
|
||||
$tag_ops = preg_split('%[^,+]*%', $nice_tag_query, -1, PREG_SPLIT_NO_EMPTY); // create array of operators
|
||||
|
||||
$tag_ops_counter = 0;
|
||||
$nice_tag_query = '';
|
||||
|
||||
foreach ($tag_slugs as $tag_slug) {
|
||||
$tag = get_term_by('slug', $tag_slug ,'post_tag');
|
||||
// prettify tag operator, if any
|
||||
if ($tag_ops[$tag_ops_counter] == ',') {
|
||||
$tag_ops[$tag_ops_counter] = ', ';
|
||||
} elseif ($tag_ops[$tag_ops_counter] == '+') {
|
||||
$tag_ops[$tag_ops_counter] = ' + ';
|
||||
}
|
||||
// concatenate display name and prettified operators
|
||||
$nice_tag_query = $nice_tag_query.$tag->name.$tag_ops[$tag_ops_counter];
|
||||
$tag_ops_counter += 1;
|
||||
}
|
||||
return $nice_tag_query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of a term.
|
||||
*
|
||||
@@ -499,4 +257,52 @@ function get_category_formatted() {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/* Customize theme options
|
||||
* Ref: http://ottopress.com/2012/making-a-custom-control-for-the-theme-customizer/
|
||||
*/
|
||||
if (class_exists('WP_Customize_Control')) {
|
||||
class Customize_Textarea_Control extends WP_Customize_Control {
|
||||
public $type = 'textarea';
|
||||
|
||||
public function render_content() {
|
||||
?>
|
||||
<label>
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<textarea rows="5" style="width:100%;" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function neuf_customize_register( $wp_customize ) {
|
||||
/* Introduction */
|
||||
$wp_customize->add_setting( 'home_introduction_text' , array('default' => '') );
|
||||
$wp_customize->add_control(
|
||||
new Customize_Textarea_Control( $wp_customize, 'home_introduction_text', array(
|
||||
'label' => __( 'Introduksjonstekst', 'neuf-web' ),
|
||||
'section' => 'static_front_page',
|
||||
'settings' => 'home_introduction_text',
|
||||
) )
|
||||
);
|
||||
|
||||
|
||||
/* Footer Section */
|
||||
$wp_customize->add_section( 'footer_section' , array(
|
||||
'title' => __( 'Footer', 'neuf-web' ),
|
||||
'priority' => 30,
|
||||
) );
|
||||
$wp_customize->add_setting( 'footer_about_text' , array('default' => '') );
|
||||
$wp_customize->add_control(
|
||||
new Customize_Textarea_Control( $wp_customize, 'footer_about_text', array(
|
||||
'label' => __( 'Footer-tekst', 'neuf-web' ),
|
||||
'section' => 'footer_section',
|
||||
'settings' => 'footer_about_text',
|
||||
) )
|
||||
);
|
||||
}
|
||||
add_action( 'customize_register', 'neuf_customize_register' );
|
||||
|
||||
|
||||
?>
|
||||
@@ -11,7 +11,7 @@
|
||||
<meta name="x-user-id" content="<?php echo $user->ID; ?>" />
|
||||
|
||||
<meta name="x-siteurl" content="<?php echo get_option('siteurl'); ?>" />
|
||||
<?php neuf_doctitle(); ?>
|
||||
<title><?php wp_title(); ?></title>
|
||||
<link rel="icon" type="image/png" href="favicon.ico" />
|
||||
<link rel="alternate" type="application/rss+xml" href="<?php echo get_feed_url(); ?>" title="aktiv.neuf.no - Nyheter" />
|
||||
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
<?php get_header(); ?>
|
||||
<div class="container">
|
||||
<div id="content">
|
||||
|
||||
<div id="content">
|
||||
<?php if( !is_single() ): ?>
|
||||
<h1 class="page-title"><?php wp_title("", true); ?></h1>
|
||||
<?php endif; ?>
|
||||
<?php get_template_part('entries'); ?>
|
||||
</div> <!-- #content -->
|
||||
<?php if( is_home()): ?>
|
||||
<div class="introduction" style="display: none;">
|
||||
<?php echo get_theme_mod( 'home_introduction_text',""); ?>
|
||||
<a href="#dismiss-introduction" data-toggle-introduction class="button dismiss-button" title="Lukk">Oki doki!</a>
|
||||
</div>
|
||||
<h2>Siste nytt</h2>
|
||||
<?php elseif( !is_single() ): ?>
|
||||
<h1 class="page-title"><?php wp_title("", true); ?></h1>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if( !is_page() ) {
|
||||
get_template_part( 'sidebar' );
|
||||
// TODO Level 2 navigation
|
||||
} ?>
|
||||
<?php get_template_part('entries'); ?>
|
||||
|
||||
<div class="navigation"><p><?php posts_nav_link(); ?></p></div>
|
||||
|
||||
</div> <!-- #content -->
|
||||
|
||||
<?php if( !is_page() ) {
|
||||
get_template_part( 'sidebar' );
|
||||
// TODO Level 2 navigation
|
||||
} ?>
|
||||
|
||||
</div> <!-- .container-->
|
||||
|
||||
|
||||
<?php get_footer(); ?>
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<div id="content">
|
||||
<div class="introduction" style="display: none;">
|
||||
<?php the_post(); the_content(); ?>
|
||||
<?php echo get_theme_mod( 'home_introduction_text',""); ?>
|
||||
<a href="#dismiss-introduction" data-toggle-introduction class="button dismiss-button" title="Lukk">Oki doki!</a>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// Load up some posts
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 25,
|
||||
'posts_per_page' => 10,
|
||||
'order' => 'DESC'
|
||||
);
|
||||
query_posts($args);
|
||||
|
||||
Reference in new issue
Block a user