Skip to content

Commit

Permalink
11-16-2021
Browse files Browse the repository at this point in the history
  • Loading branch information
midkiffaries committed Nov 17, 2021
1 parent 1a85b33 commit a324a36
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 32 deletions.
6 changes: 1 addition & 5 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@
<span class="entry-date">on <a href="<?php echo get_day_link(get_the_date('Y'), get_the_date('m'), get_the_date('d')); ?>"><time datetime="<?php echo get_the_date('c'); ?>" itemprop="datePublished"><?php the_date(); ?></time></a> <span class="entry-last-updated"><?php if (get_the_modified_date('Y-m-d') != get_the_date('Y-m-d')) printf( __( '(Updated <time>%s</time>)', 'textdomain' ), get_the_modified_date() ); ?></span></span>
</div>
</header>
<?php // Enlarge font in entry is short
$largerFont = 'entry-defaultfont';
if (strlen(wp_strip_all_tags($post->post_content)) < 430) $largerFont = 'entry-largefont';
?>
<div class="entry-content <?php echo $largerFont; ?>">
<div class="entry-content <?php echo ResizeFontClass($post->post_content); ?>">
<?php the_content('<p>Continue Reading &raquo;</p>'); ?>
</div>
<div class="entry-overflow"></div>
Expand Down
15 changes: 10 additions & 5 deletions assets/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -836,22 +836,27 @@ Page Specific Styling
text-align: center;
}

/* Image Viewer Page */
/* Attachment/Image Page */
.page-image .attachment {
text-align: center;
font-size: 1.2em;
}

.page-image .image-info {
opacity: 0.7;
}

.page-image .attachment img {
background-color: rgba(0,0,0,0.14);
border: 1px solid #fff;
box-shadow: 0 10px 10px -6px rgba(0,0,0,0.6), 0 5px 10px -2px rgba(0,0,0,0.1);
}

.page-image .image-info {
opacity: 0.7;
font-size: 0.8em;
}

.page-image .image-nav a {
margin: 14px;
}

/* Comment Block */
.list-comments {
list-style: none;
Expand Down
2 changes: 1 addition & 1 deletion attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<span class="image-date">Uploaded on <time datetime="<?php printf(get_the_date('c')); ?>" itemprop="datePublished"><?php the_date(); ?></time></span>
<span class="image-author">by <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>" itemprop="author" rel="author"><?php the_author(); ?></a></span>
</p>
<p><a href="<?php echo wp_get_attachment_url(get_the_ID()); ?>">View the full image</a></p>
<p class="image-download"><a href="<?php echo wp_get_attachment_url(get_the_ID()); ?>">View the full image</a></p>
</div>
</article>
<?php endwhile; ?>
Expand Down
25 changes: 20 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ function numberToRoman($variable) {
return $result;
}

// Swaps some special characters with words
function CharSwap($string) {
$string = preg_replace('/\%/', 'percent', $string);
$string = preg_replace('/\&/', 'and', $string);
return $string;
}


/////////////////////////////
// WordPress Functions
Expand Down Expand Up @@ -95,13 +102,21 @@ function SearchCount($query) {
return $search_count;
}

// Swaps some special characters with words
function CharSwap($string) {
$string = preg_replace('/\%/', 'percent', $string);
$string = preg_replace('/\&/', 'and', $string);
return $string;
// Get WordPress page content for select special pages
function GetPageContent($id) {
$page_for_posts_id = get_option( $id );
$page_for_posts_obj = get_post( $page_for_posts_id );
return apply_filters( 'the_content', $page_for_posts_obj->post_content );
}

// Enlarge blog post text for short blog posts
function ResizeFontClass($content) {
if (strlen(wp_strip_all_tags($content)) < 430) {
return 'entry-largefont'; // Larger font size
} else {
return 'entry-defaultfont'; // Default font size
}
}

// Add featured image to posts and pages
//add_theme_support( 'post-thumbnails' );
Expand Down
13 changes: 2 additions & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@

<section class="blog-page-title">
<h2 class="page-title" itemprop="title">The Blog</h2>
<?php
// Get blog page content
$page_for_posts_id = get_option( 'page_for_posts' );
$page_for_posts_obj = get_post( $page_for_posts_id );
echo apply_filters( 'the_content', $page_for_posts_obj->post_content );
?>
<?php echo GetPageContent('page_for_posts'); // Get blog page content ?>
</section>

<?php if (have_posts()) : ?>
Expand All @@ -31,11 +26,7 @@
<span class="entry-date"><time datetime="<?php echo get_the_date('c'); ?>" itemprop="datePublished"><?php the_date(); ?></time> <span class="entry-last-updated"><?php if (get_the_modified_date('Y-m-d') != get_the_date('Y-m-d')) printf( __( '(Updated <time>%s</time>)', 'textdomain' ), get_the_modified_date() ); ?></span></span>
</div>
</header>
<?php // Enlarge font in entry is short
$largerFont = 'entry-defaultfont';
if (strlen(wp_strip_all_tags($post->post_content)) < 430) $largerFont = 'entry-largefont';
?>
<div class="entry-content <?php echo $largerFont; ?>">
<div class="entry-content <?php echo ResizeFontClass($post->post_content); ?>">
<?php the_content('<p>Continue Reading &raquo;</p>'); ?>
</div>
<div class="entry-overflow"></div>
Expand Down
6 changes: 1 addition & 5 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
<div class="single-entry-author">By <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>" itemprop="author" rel="author"><?php the_author(); ?></a></div>
<!--div class="single-entry-comments"><a href="#Comments"><?php //comments_number('No comments', 'One comment', '% comments'); ?></a></div-->
</header>
<?php // Enlarge font in entry is short
$largerFont = 'entry-defaultfont';
if (strlen(wp_strip_all_tags($post->post_content)) < 430) $largerFont = 'entry-largefont';
?>
<div class="single-entry-content <?php echo $largerFont; ?>">
<div class="single-entry-content <?php echo ResizeFontClass($post->post_content); ?>">
<?php the_content('<p>Continue Reading &raquo;</p>'); ?>
</div>
<footer class="single-entry-footer">
Expand Down

0 comments on commit a324a36

Please sign in to comment.