Skip to content

Commit

Permalink
Version 1.8.1: Adds estimated reading time to articles and reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
markbarnes committed Aug 5, 2019
1 parent 5318751 commit 315b13e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
11 changes: 7 additions & 4 deletions classes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,16 @@ public static function add_author_issue_banner ($post_info) {
if ($post && $post->post_type == 'em_article') {
$article = new evangelical_magazine_article($post);
$authors = $article->get_authors();
$output = '';
$output = '<span class="authors">';
if ($authors) {
foreach ($authors as $author) {
$output .= "<a href=\"{$author->get_link()}\">{$author->get_image_html('author_tiny', false, '', $author->get_name(), 'author-image')}</a>";
}
$output .= $article->get_author_names(true, true);
}
$output .= "<span style=\"height:37px;vertical-align:middle\">{$article->get_author_names(true, true)}</span>";
$output .= "<span style=\"float:right;vertical-align:middle\">{$article->get_issue_name(true)}";
$output .= '</span>';
$output .= "<span class=\"reading-time\">{$article->get_reading_time()} minute read</span>";
$output .= "<span class=\"issue\">{$article->get_issue_name(true)}";
if ($page_num = $article->get_page_num()) {
$output .= ", page <span itemprop=\"pageStart\">{$page_num}</span>";
}
Expand Down Expand Up @@ -401,7 +403,8 @@ public static function add_review_metadata_to_page ($post_info) {
$a = $review->get_price();
$output .= $review->get_price('<span class="metadata-item"><span class="metadata-name">Retail Price:</span> ', $review->get_purchase_url(' (<a href="', '" target="_blank">'.(($review->get_price() == 'free') ? 'get' : 'buy now').'</a>)').'</span>');
$output .= "</span>{$image}<br/>";
$output .= "<span class=\"review-metadata\">{$review->get_author_names(true, true, 'Review by ')}";
$output .= "<span class=\"review-metadata\"><span class=\"reviewer\">{$review->get_author_names(true, true, 'Review by ')}</span>";
$output .= "<span class=\"reading-time\">{$review->get_reading_time()} minute read</span>";
$output .= "<span style=\"float:right\">{$review->get_issue_name(true)}";
if ($page_num = $review->get_page_num()) {
$output .= ", page {$page_num}";
Expand Down
4 changes: 4 additions & 0 deletions css/style-0-369.css
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ body.home #sections .article-list-box-title a {
font-size: 32px;
}

.entry-meta .reading-time {
display: none;
}

.entry-content {
padding: 20px;
}
Expand Down
4 changes: 4 additions & 0 deletions css/style-370-469.css
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ body.home #sections .article-list-box-title a {
font-size: 32px;
}

.entry-meta .reading-time {
display: none;
}

.entry-content {
padding: 20px;
}
Expand Down
4 changes: 4 additions & 0 deletions css/style-470-559.css
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ body.home #sections .article-list-box-title a {
font-size: 40px;
}

.entry-meta .reading-time {
display: none;
}

.entry-content {
padding: 35px;
}
Expand Down
4 changes: 4 additions & 0 deletions css/style-560-734.css
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ body.home #sections .article-list-box-title a {
font-size: 44px;
}

.entry-meta .reading-time {
display: none;
}

.entry-content {
padding: 35px;
}
Expand Down
22 changes: 16 additions & 6 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: http://www.evangelicalmagazine.com
Description: Custom theme for the Evangelical Magazine
Author: Mark Barnes
Author URI: http://www.markbarnes.net/
Version: 1.8
Version: 1.8.1
Template: genesis
Template Version: 3.0.0
Tags: one-column, two-columns, three-columns, left-sidebar, right-sidebar, responsive-layout, custom-menu, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments
Expand Down Expand Up @@ -1678,15 +1678,20 @@ img.size-half-post-width.alignright {
/* ## Entry Meta
--------------------------------------------- */

p.entry-meta {
.entry-meta {
font-size: 16px;
margin-bottom: 0;
padding: 10px 20px;
background-color: #086788;
color: white;
font-family: Lato, Tahoma, sans-serif;
overflow: hidden;
vertical-align: middle;
}

.single-em_article .entry-meta {
display: flex;
justify-content: space-between;
align-items: center;
}

.entry-meta a {
Expand All @@ -1701,6 +1706,11 @@ p.entry-meta {
text-decoration: underline;
}

.entry-meta .authors {
display: flex;
align-items: center;
}

.entry-meta .author-image {
float:left;
height: 37px;
Expand Down Expand Up @@ -2027,11 +2037,11 @@ body.single-em_review .entry-meta {
}

body.single-em_review .review-metadata {
float:left;
width: 100%;
clear: both;
display: flex;
background-color: #086788;
padding: 5px 20px 10px 20px;
justify-content: space-between;
align-items: center;
}

body.single-em_review .media-metadata {
Expand Down

0 comments on commit 315b13e

Please sign in to comment.