Adding changes from d24b66f56c

From @Thomas-A-Reinert
This commit is contained in:
koenemann 2016-11-22 09:19:08 +01:00
parent c9a002f640
commit 33adc3f6a7
5 changed files with 117 additions and 65 deletions

View File

@ -5024,6 +5024,16 @@ a.skip-link {
margin-right: .425rem; margin-right: .425rem;
margin-left: .425rem; } margin-left: .425rem; }
.post-navigation {
padding-top: 1rem;
margin-top: 1rem;
border-top: 1px solid #373a3c; }
.nav-previous a,
.nav-next a {
text-decoration: none;
color: #373a3c; }
.dropdown-menu .dropdown-menu { .dropdown-menu .dropdown-menu {
position: relative; position: relative;
display: block; display: block;

2
css/theme.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,15 +7,15 @@
* @package understrap * @package understrap
*/ */
if ( ! function_exists( 'understrap_posted_on' ) ) : if ( ! function_exists( 'understrap_posted_on' ) ) :
/** /**
* Prints HTML with meta information for the current post-date/time and author. * Prints HTML with meta information for the current post-date/time and author.
*/ */
function understrap_posted_on() { function understrap_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>, <time class="updated" datetime="%3$s">' . __( ' Edited %4$s', $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>, <time class="updated" datetime="%3$s">' . __( ' Edited %4$s', 'understrap' ) . '</time>';
'understrap' ) . '</time>';
} }
$time_string = sprintf( $time_string, $time_string = sprintf( $time_string,
@ -37,21 +37,20 @@ if ( ! function_exists( 'understrap_posted_on' ) ) :
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
} }
endif; endif;
if ( ! function_exists( 'understrap_entry_footer' ) ) : if ( ! function_exists( 'understrap_entry_footer' ) ) :
/** /**
* Prints HTML with meta information for the categories, tags and comments. * Prints HTML with meta information for the categories, tags and comments.
*/ */
function understrap_entry_footer() { function understrap_entry_footer() {
// Hide category and tag text for pages. // Hide category and tag text for pages.
if ( 'post' == get_post_type() ) { if ( 'post' == get_post_type() ) {
/* translators: used between list items, there is a space after the comma */ /* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'understrap' ) ); $categories_list = get_the_category_list( __( ', ', 'understrap' ) );
if ( $categories_list && understrap_categorized_blog() ) { if ( $categories_list && understrap_categorized_blog() ) {
printf( '<span class="cat-links">' . __( 'Posted in %1$s', 'understrap' ) . '</span>', printf( '<span class="cat-links">' . __( 'Posted in %1$s', 'understrap' ) . '</span>', $categories_list );
$categories_list );
} }
/* translators: used between list items, there is a space after the comma */ /* translators: used between list items, there is a space after the comma */
@ -63,8 +62,7 @@ if ( ! function_exists( 'understrap_entry_footer' ) ) :
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">'; echo '<span class="comments-link">';
comments_popup_link( __( 'Leave a comment', 'understrap' ), __( '1 Comment', 'understrap' ), comments_popup_link( __( 'Leave a comment', 'understrap' ), __( '1 Comment', 'understrap' ), __( '% Comments', 'understrap' ) );
__( '% Comments', 'understrap' ) );
echo '</span>'; echo '</span>';
} }
@ -77,7 +75,7 @@ if ( ! function_exists( 'understrap_entry_footer' ) ) :
'<span class="edit-link">', '<span class="edit-link">',
'</span>' '</span>'
); );
} }
endif; endif;
/** /**
@ -121,6 +119,38 @@ function understrap_category_transient_flusher() {
// Like, beat it. Dig? // Like, beat it. Dig?
delete_transient( 'understrap_categories' ); delete_transient( 'understrap_categories' );
} }
add_action( 'edit_category', 'understrap_category_transient_flusher' ); add_action( 'edit_category', 'understrap_category_transient_flusher' );
add_action( 'save_post', 'understrap_category_transient_flusher' ); add_action( 'save_post', 'understrap_category_transient_flusher' );
/**
* Display navigation to next/previous post when applicable.
*/
if ( ! function_exists( 'understrap_post_nav' ) ) :
function understrap_post_nav() {
// Don't print empty markup if there's nowhere to navigate.
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {
return;
}
?>
<nav class="navigation post-navigation">
<h1 class="sr-only"><?php _e( 'Post navigation', 'understrap' ); ?></h1>
<div class="nav-links">
<?php
if ( get_previous_post_link() ) {
previous_post_link( '<span class="nav-previous float-xs-left btn btn-sm btn-secondary">%link</span>', _x( '<span class="fa fa-backward"></span>&nbsp;%title', 'Previous post link', 'understrap' ) );
}
if ( get_next_post_link() ) {
next_post_link( '<span class="nav-next float-xs-right btn btn-sm btn-secondary">%link</span>', _x( '%title&nbsp;<span class="fa fa-forward"></span>', 'Next post link', 'understrap' ) );
}
?>
</div><!-- .nav-links -->
</nav><!-- .navigation -->
<?php
}
endif;

View File

@ -130,6 +130,18 @@ a.skip-link {
margin-left: .425rem; margin-left: .425rem;
} }
.post-navigation {
padding-top: 1rem;
margin-top: 1rem;
border-top: 1px solid $gray-dark;
}
.nav-previous a,
.nav-next a {
text-decoration: none;
color: $gray-dark;
}
// Fixing BS dropdown in a dropdown // Fixing BS dropdown in a dropdown
.dropdown-menu .dropdown-menu { .dropdown-menu .dropdown-menu {
position: relative; position: relative;