parent
c9a002f640
commit
33adc3f6a7
|
@ -5024,6 +5024,16 @@ a.skip-link {
|
|||
margin-right: .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 {
|
||||
position: relative;
|
||||
display: block;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,6 +7,7 @@
|
|||
* @package understrap
|
||||
*/
|
||||
|
||||
|
||||
if ( ! function_exists( 'understrap_posted_on' ) ) :
|
||||
/**
|
||||
* Prints HTML with meta information for the current post-date/time and author.
|
||||
|
@ -14,8 +15,7 @@ if ( ! function_exists( 'understrap_posted_on' ) ) :
|
|||
function understrap_posted_on() {
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
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',
|
||||
'understrap' ) . '</time>';
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>, <time class="updated" datetime="%3$s">' . __( ' Edited %4$s', 'understrap' ) . '</time>';
|
||||
}
|
||||
|
||||
$time_string = sprintf( $time_string,
|
||||
|
@ -50,8 +50,7 @@ if ( ! function_exists( 'understrap_entry_footer' ) ) :
|
|||
/* translators: used between list items, there is a space after the comma */
|
||||
$categories_list = get_the_category_list( __( ', ', 'understrap' ) );
|
||||
if ( $categories_list && understrap_categorized_blog() ) {
|
||||
printf( '<span class="cat-links">' . __( 'Posted in %1$s', 'understrap' ) . '</span>',
|
||||
$categories_list );
|
||||
printf( '<span class="cat-links">' . __( 'Posted in %1$s', 'understrap' ) . '</span>', $categories_list );
|
||||
}
|
||||
|
||||
/* 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() ) ) {
|
||||
echo '<span class="comments-link">';
|
||||
comments_popup_link( __( 'Leave a comment', 'understrap' ), __( '1 Comment', 'understrap' ),
|
||||
__( '% Comments', 'understrap' ) );
|
||||
comments_popup_link( __( 'Leave a comment', 'understrap' ), __( '1 Comment', 'understrap' ), __( '% Comments', 'understrap' ) );
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
|
@ -121,6 +119,38 @@ function understrap_category_transient_flusher() {
|
|||
// Like, beat it. Dig?
|
||||
delete_transient( 'understrap_categories' );
|
||||
}
|
||||
|
||||
add_action( 'edit_category', '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> %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 <span class="fa fa-forward"></span>', 'Next post link', 'understrap' ) );
|
||||
}
|
||||
?>
|
||||
</div><!-- .nav-links -->
|
||||
</nav><!-- .navigation -->
|
||||
<?php
|
||||
}
|
||||
endif;
|
||||
|
|
|
@ -130,6 +130,18 @@ a.skip-link {
|
|||
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
|
||||
.dropdown-menu .dropdown-menu {
|
||||
position: relative;
|
||||
|
|
Reference in New Issue