diff --git a/README.md b/README.md
index eb7885d..504f598 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@
[](https://codeclimate.com/github/chemiker/e.nigma-2015/maintainability) [](https://travis-ci.com/chemiker/e.nigma-2015)
+
+
## 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 '' . $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 ) :
?>
-