diff --git a/README.md b/README.md index eb7885d..504f598 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [![Maintainability](https://api.codeclimate.com/v1/badges/767420930abd5ede9110/maintainability)](https://codeclimate.com/github/chemiker/e.nigma-2015/maintainability) [![Build Status](https://travis-ci.com/chemiker/e.nigma-2015.svg?branch=master)](https://travis-ci.com/chemiker/e.nigma-2015) +![e.nigma 2015](https://github.com/chemiker/e.nigma-2015/raw/master/src/theme/screenshot.png) + ## Installation 1. Download or clone the repository @@ -21,6 +23,9 @@ ## Changelog +### 1.2.5 +* Further improvements in the codebase (replaced custom functions with WordPress build-in alternatives) + ### 1.2.4 * Improved support for WordPress/Gutenberg blocks * Improved sanitizing outputs diff --git a/src/sass/form.scss b/src/sass/form.scss index ad11275..75af106 100644 --- a/src/sass/form.scss +++ b/src/sass/form.scss @@ -1,7 +1,8 @@ /* -------------------------------- Search & Form Elements */ input, -textarea { +textarea, +button { font: 20px/1.5 $sans; color: $darkbeige; padding: 5px 10px 5px 10px; @@ -31,7 +32,8 @@ input[type=search] { -webkit-appearance: none; } -input[type=submit] { +input[type=submit], +button { cursor: pointer; color: #7a7a7a; diff --git a/src/sass/navigation.scss b/src/sass/navigation.scss index b172518..3a7d1c2 100644 --- a/src/sass/navigation.scss +++ b/src/sass/navigation.scss @@ -90,14 +90,18 @@ header { } } -div.pagebar { +div.nav-links { + margin-top: -66px; +} + +div.pagebar, +div.nav-links { color: $darkbeige; text-align: center; padding: 80px 0 100px 0; font-size: 0.8em; border-top: 7px solid $darkbeige; background-color: $beige; - margin-top: -66px; &.sitepages { margin-top: 0px; @@ -119,16 +123,14 @@ div.pagebar { display: inline-block; } - span.page-numbers, - a.page-numbers { - font-size: 1.3em; - margin-right: 5px; - } - span.page-numbers { color: $navigationbackground; - background-color: $darkbeige; + background-color: $beige; border: 3px solid $navigationbackground; + + &.dots { + border-width: 0px; + } } &.comment { @@ -154,11 +156,17 @@ div.pagebar { color: $beige; background-color: $navigationbackground; border: 3px solid $beige; + + &:hover { + color: $navigationbackground; + border-color: $navigationbackground; + background-color: $beige; + } } &:hover, - &.active, - &.active:visited, + .active, + .active:visited, &.page:hover, &.page:focus, &.next.page-numbers, @@ -168,26 +176,19 @@ div.pagebar { background-color: $beige; } - &.page-numbers, - &.page-numbers:visited { - margin-right: 5px; - background-color: $darkbeige; - } - &.next.page-numbers, &.prev.page-numbers { - font-size: 1.3em; border: none; display: inline; font-weight: normal; - color: $beige; - background-color: $darkbeige; + color: $darkbeige; + background-color: none; } } } span.pagebar-category { - top: -30px !important; + top: 5px !important; } span.pagebar-category, diff --git a/src/theme/comments.php b/src/theme/comments.php index 05cfa2f..dca111a 100644 --- a/src/theme/comments.php +++ b/src/theme/comments.php @@ -28,4 +28,5 @@ -max_num_pages; - - if ( $max_num_pages <= 1 ) { - return; - } - - $page = (int) get_query_var( 'paged' ); - $roundedrange = ceil( $displayedpages / 2 ); - - if ( ! $page ) { - $page = 1; - } - - if ( $max_num_pages > $displayedpages ) { - if ( $page <= $displayedpages ) { - $min = 1; - $max = $displayedpages + 1; - } elseif ( $page >= ( $max_num_pages - $roundedrange ) ) { - $min = $max_num_pages - $displayedpages; - $max = $max_num_pages; - } elseif ( $page >= $displayedpages && $page < ( $max_num_pages - $roundedrange ) ) { - $min = $page - $roundedrange; - $max = $page + $roundedrange; - } - } else { - $min = 1; - $max = $max_num_pages; - } - - if ( ! empty( $min ) && ! empty( $max ) ) { - for ( $i = $min; $i <= $max; $i++ ) { - echo sprintf( - ' %d', - get_pagenum_link( $i ), - ( $i === $page ? 'class="page active"' : 'class="page"' ), - $i - ); - } - } - } - /** * Get_categories() fetches the post categories and provides them to the theme templates. */ public static function get_categories() { - $thecategories = get_the_category(); - $numberofcategories = count( $thecategories ); - $categories = ''; - - foreach ( $thecategories as $categorienumber => $category ) { - if ( $categorienumber === $numberofcategories - 1 ) { - $spacer = ''; - } else { - $spacer = ', '; - } - $categories .= sprintf( - '%s%s', - get_category_link( $category->term_id ), - $category->name, - $spacer - ); - } + $categories = get_the_category_list( ', ' ); if ( ! empty( $categories ) ) { $categories = sprintf( @@ -228,7 +164,9 @@ private static function get_content( $format ) { return ( $oembed ? $oembed : get_post_meta( get_the_ID(), '_format_' . $format . '_embed', true ) ) . $content; } - if ( 'image' === $format && $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ) ) { + $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ); + + if ( $featured_image && 'image' === $format ) { return '' . get_the_title() . '' . $content; } @@ -258,7 +196,9 @@ private static function get_class( $format, $class = '' ) { * @return string */ private static function get_css( $format, $css = '' ) { - if ( 'image' === $format && $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ) ) { + $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ); + + if ( $featured_image && 'image' === $format ) { $css = "style=\"background-image: url( '" . $featured_image[0] . "' )\""; } diff --git a/src/theme/functions/class-customizer.php b/src/theme/functions/class-customizer.php index 534fe6f..7e9443a 100644 --- a/src/theme/functions/class-customizer.php +++ b/src/theme/functions/class-customizer.php @@ -60,7 +60,9 @@ public static function register( $wp_customize ) { array( 'default' => __( 'Welcome to my blog', 'e.nigma-2015' ), 'type' => 'theme_mod', - 'sanitize_callback' => function ( $input ) { return wp_kses_post( $input ); } + 'sanitize_callback' => function ( $input ) { + return wp_kses_post( $input ); + }, ) ); diff --git a/src/theme/functions/class-helper.php b/src/theme/functions/class-helper.php deleted file mode 100644 index 5257719..0000000 --- a/src/theme/functions/class-helper.php +++ /dev/null @@ -1,49 +0,0 @@ -'; - - $i = $page + 1; - if ( $i <= $numpages ) { - $next .= _wp_link_page( $i ); - $next .= $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . ''; - } - - $args['before'] = $args['before'] . ( 1 === $page ? '' : $prev ); - $args['after'] = $next . $args['after']; - - return $args; - } -} diff --git a/src/theme/index.php b/src/theme/index.php index 393f8fd..f6820b8 100755 --- a/src/theme/index.php +++ b/src/theme/index.php @@ -48,13 +48,15 @@ if ( $wp_query->max_num_pages > 1 ) : ?> -
- -
+ 'plain', + 'prev_text' => '« ' . esc_html__( 'Previous page', 'e.nigma-2015' ), + 'next_text' => esc_html__( 'Next page', 'e.nigma-2015' ) . ' »', + ) + ); + ?> diff --git a/src/theme/readme.txt b/src/theme/readme.txt index cb991f3..88dff21 100644 --- a/src/theme/readme.txt +++ b/src/theme/readme.txt @@ -24,6 +24,9 @@ If using the "image" post-type it is recommended to set the image you want to sh ## Changelog +### 1.2.5 +* Further improvements in the codebase (replaced custom functions with WordPress build-in alternatives) + ### 1.2.4 * Improved support for WordPress/Gutenberg blocks * Improved sanitizing outputs diff --git a/src/theme/single.php b/src/theme/single.php index 599ef95..58e77c5 100755 --- a/src/theme/single.php +++ b/src/theme/single.php @@ -26,19 +26,7 @@ 1 ) : ?>
- '', - 'after' => '', - 'nextpagelink' => esc_html__( 'Next Page »', 'e.nigma-2015' ), - 'previouspagelink' => esc_html__( '« Previous Page', 'e.nigma-2015' ), - 'next_or_number' => 'next_and_number', - 'pagelink' => '%', - 'echo' => 1, - ) - ); - ?> +
diff --git a/src/theme/style.css b/src/theme/style.css index 916f38c..26ff935 100755 --- a/src/theme/style.css +++ b/src/theme/style.css @@ -2,7 +2,7 @@ Theme Name: e.nigma 2015 Description: e.nigma 2015 is a light-weight, modern and simple WordPress theme. It is thought to be used with WordPress posts formats. Author: Alexander Lüken -Version: 1.2.4 +Version: 1.2.5 Theme URI: https://sciolism.de/projects/e.nigma-2015/ Author URI: https://sciolism.de Tested up to: 5.6