cleanup inc folder and add wordpress.com stuff

This commit is contained in:
koenemann 2017-02-07 15:30:03 +01:00
parent d553448a75
commit 8c3ada14a6
2 changed files with 44 additions and 0 deletions

View File

@ -74,3 +74,40 @@ if ( ! function_exists( 'change_logo_class' ) ) {
return $html;
}
}
/**
* 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;
}
?>
<div class="row">
<div class="col-md-12">
<nav class="navigation post-navigation">
<h2 class="sr-only"><?php _e( 'Post navigation', 'understrap' ); ?></h2>
<div class="nav-links">
<?php
if ( get_previous_post_link() ) {
previous_post_link( '<span class="nav-previous float-xs-left">%link</span>', _x( '<i class="fa fa-angle-left"></i>&nbsp;%title', 'Previous post link', 'understrap' ) );
}
if ( get_next_post_link() ) {
next_post_link( '<span class="nav-next float-xs-right">%link</span>', _x( '%title&nbsp;<i class="fa fa-angle-right"></i>', 'Next post link', 'understrap' ) );
}
?>
</div><!-- .nav-links -->
</nav><!-- .navigation -->
</div>
</div>
<?php
}
endif;

7
inc/style-wpcom.css Normal file
View File

@ -0,0 +1,7 @@
/*
* Theme Name: Components
*
* Add any WordPress.com-specific CSS here
*
* This file is enqueued in /inc/wpcom.php
*/