2018-03-21 18:19:20 +00:00
|
|
|
<?php
|
2021-01-22 16:19:51 +00:00
|
|
|
/**
|
|
|
|
* The template part for displaying single Posts.
|
|
|
|
*
|
|
|
|
* @package Omphaloskepsis
|
|
|
|
* @since Omphaloskepsis 1.0
|
|
|
|
*/
|
|
|
|
|
2018-03-21 18:19:20 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<article id="wrapper" <?php post_class(); ?>>
|
2021-01-22 16:19:51 +00:00
|
|
|
<header style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
|
|
|
|
<div>
|
|
|
|
<h1 id="post-title">
|
2021-01-23 13:26:25 +00:00
|
|
|
<?php echo wp_kses_post( get_the_title() ); ?>
|
2021-01-22 16:19:51 +00:00
|
|
|
</h1>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$subtitle = get_post_meta( get_the_ID(), 'Subtitle', true );
|
|
|
|
if ( $subtitle ) :
|
|
|
|
?>
|
|
|
|
<h2 id="post-subtitle">
|
|
|
|
<?php echo wp_kses_post( $subtitle ); ?>
|
|
|
|
</h2>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
</header><!-- .entry-header -->
|
|
|
|
|
|
|
|
<main id="post-body" class="body">
|
|
|
|
|
2021-02-14 13:27:53 +00:00
|
|
|
<!-- Post Notes -->
|
2021-01-22 16:19:51 +00:00
|
|
|
<?php $date1 = strtotime( get_the_date( 'Y-m-d' ) ); ?>
|
|
|
|
<?php $date2 = strtotime( gmdate( 'Y-m-d' ) ); ?>
|
|
|
|
<?php if ( has_category( 'series' ) || has_tag( 'ohwhatohjeez' ) || get_post_meta( get_the_ID(), 'Note(s)', true ) || get_post_meta( get_the_ID(), 'License', true ) || ( $date1 < $date2 - 31557600 ) ) : ?>
|
|
|
|
<div id="details">
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<?php
|
2021-01-09 11:13:06 +00:00
|
|
|
if ( has_category( 'thoughts' ) ) {
|
2021-01-22 16:19:51 +00:00
|
|
|
$post_category = 'thought';
|
|
|
|
} elseif ( has_category( 'reports' ) ) {
|
|
|
|
$post_category = 'report';
|
|
|
|
} elseif ( has_category( 'review' ) ) {
|
|
|
|
$post_category = 'review';
|
2021-01-09 11:13:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( has_category( 'series' ) ) {
|
2021-01-22 16:19:51 +00:00
|
|
|
$category_text = 'is a part of the following series';
|
|
|
|
$series = array();
|
|
|
|
$series_item = get_category_by_slug( 'series' );
|
|
|
|
$series_ids = get_term_children( $series_item->term_id, 'category' );
|
|
|
|
|
|
|
|
foreach ( $series_ids as $this_series_id ) {
|
|
|
|
if ( has_category( $this_series_id ) ) {
|
|
|
|
array_push( $series, get_category( $this_series_id ) );
|
2021-01-09 11:13:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( count( $series ) > 1 ) {
|
2021-01-22 16:19:51 +00:00
|
|
|
$category_text .= '’';
|
2021-01-09 11:13:06 +00:00
|
|
|
}
|
|
|
|
$punct = ':';
|
2021-01-22 16:19:51 +00:00
|
|
|
foreach ( $series as $this_series ) {
|
|
|
|
$category_text .= $punct . ' ';
|
|
|
|
if ( ':' === $punct ) {
|
2021-01-09 11:13:06 +00:00
|
|
|
$punct = ';';
|
|
|
|
}
|
2021-01-22 16:19:51 +00:00
|
|
|
$category_text .= '<a href="/category/series/' . $this_series->slug . '">' . $this_series->name . '</a>';
|
2021-01-09 11:13:06 +00:00
|
|
|
}
|
2021-01-22 16:19:51 +00:00
|
|
|
$category_text .= '.';
|
|
|
|
echo '<li>';
|
|
|
|
echo wp_kses_post( "This <a href='/category/$post_category'>$post_category</a> $category_text" );
|
|
|
|
echo '</li>';
|
2021-01-09 11:13:06 +00:00
|
|
|
}
|
|
|
|
?>
|
2021-02-14 13:27:53 +00:00
|
|
|
|
|
|
|
<?php
|
|
|
|
if ( 'quotes' != get_post_type( get_the_ID() ) ) :
|
|
|
|
if ( $date1 < $date2 - 31557600 ) :
|
|
|
|
?>
|
|
|
|
<li>This piece was written over a year ago. It may no longer accurately reflect my views now, or may be factually outdated.</li>
|
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
else :
|
|
|
|
?>
|
|
|
|
<li>This is a collection of quotes that I have highlighted as interesting or potentially useful for a future write-up. No further context is provided at this stage, so readers are advised not to read too much into the content below.</li>
|
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
?>
|
2021-01-22 16:19:51 +00:00
|
|
|
|
|
|
|
<?php if ( has_tag( 'ohwhatohjeez' ) ) : ?>
|
|
|
|
<li>This piece was originally written for my old site, Oh What? Oh Jeez! As such, it may not have transferred over properly and some images and links might be broken (and, to a lesser extent, my writing from years ago is about 80% run-on sentences).</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php
|
2021-02-14 13:27:53 +00:00
|
|
|
$notes = get_post_meta( get_the_ID(), 'Note', false );
|
2021-01-22 16:19:51 +00:00
|
|
|
if ( $notes ) :
|
2021-02-14 13:27:53 +00:00
|
|
|
foreach ( $notes as $note ) :
|
|
|
|
?>
|
|
|
|
<li><?php echo wp_kses_post( $note ); ?></li>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
endif;
|
|
|
|
?>
|
2021-01-22 16:19:51 +00:00
|
|
|
|
|
|
|
<?php
|
2021-02-14 13:27:53 +00:00
|
|
|
$license = get_post_meta( get_the_ID(), 'License', true );
|
2021-01-22 16:19:51 +00:00
|
|
|
if ( $license ) :
|
|
|
|
?>
|
|
|
|
<li>This work is licensed under <?php echo esc_html( $license ); ?>. <a href="/2018/03/copywrong/">Sorry about that</a>.</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2021-02-14 13:27:53 +00:00
|
|
|
<!-- /Post Notes -->
|
|
|
|
|
2021-01-22 16:19:51 +00:00
|
|
|
<?php
|
2021-01-09 11:13:06 +00:00
|
|
|
if ( get_the_content() ) :
|
|
|
|
the_content();
|
2021-01-22 16:19:51 +00:00
|
|
|
else :
|
|
|
|
echo esc_html( get_the_excerpt() );
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
|
|
|
|
</main><!-- .entry-content -->
|
|
|
|
|
|
|
|
<footer id="post-meta">
|
|
|
|
|
|
|
|
<h1>Post Meta</h1>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$date_format_holocene = 'F j\<\s\u\p\>S\</\s\u\p\>, 1Y \<\a\b\b\r \t\i\t\l\e\=\"\H\o\l\o\c\e\n\e \E\r\a\"\>\H\.\E\.\</\a\b\b\r\>';
|
|
|
|
$date_format_gregorian = 'F jS, Y \C\.\E\. \(\G\r\e\g\o\r\i\a\n\)';
|
|
|
|
|
|
|
|
$date_holocene = get_the_date( $date_format_holocene );
|
|
|
|
$date_gregorian = get_the_date( $date_format_gregorian );
|
2021-01-09 11:13:06 +00:00
|
|
|
?>
|
2021-01-22 16:19:51 +00:00
|
|
|
<section id="post-dates">
|
|
|
|
<p><strong>Published:</strong>
|
|
|
|
<span title="<?php echo esc_html( $date_gregorian ); ?>">
|
|
|
|
<?php echo wp_kses_post( $date_holocene ); ?>
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<?php
|
|
|
|
$modified_date_holocene = get_the_modified_date( $date_format_holocene );
|
|
|
|
$modified_date_gregorian = get_the_modified_date( $date_format_gregorian );
|
|
|
|
if ( $modified_date_holocene ) :
|
|
|
|
?>
|
|
|
|
<p><strong>Last Modified:</strong>
|
|
|
|
<span title="<?php echo esc_html( $modified_date_gregorian ); ?>">
|
|
|
|
<?php echo wp_kses_post( $modified_date_holocene ); ?>
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<?php endif; ?>
|
|
|
|
</section>
|
|
|
|
|
2021-02-11 14:23:58 +00:00
|
|
|
<section id="post-links">
|
2021-01-22 16:19:51 +00:00
|
|
|
<?php
|
2021-02-11 14:23:58 +00:00
|
|
|
$int_links = get_post_meta( get_the_ID(), 'Internal_Link', false );
|
|
|
|
if ( $int_links ) :
|
2021-01-22 16:19:51 +00:00
|
|
|
?>
|
2021-02-11 14:23:58 +00:00
|
|
|
<h2>Internal Link<?php echo ( count( $int_links ) > 1 ) ? 's' : ''; ?></h2>
|
|
|
|
<?php foreach ( $int_links as $int_link ) : ?>
|
|
|
|
<?php
|
|
|
|
$split_link = explode( ';;', $int_link );
|
|
|
|
$link_title = ( count( $split_link ) > 1 ) ? wp_kses_post( $split_link[0] ) : 'Link';
|
|
|
|
$link_href = ( count( $split_link ) > 1 ) ? $split_link[1] : $split_link[0];
|
|
|
|
?>
|
|
|
|
<a href="<?php echo esc_url( $link_href ); ?>" target="_blank" rel="noopener noreferrer">
|
|
|
|
<?php echo wp_kses_post( $link_title ); ?>
|
|
|
|
</a>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$ext_links = get_post_meta( get_the_ID(), 'External_Link', false );
|
|
|
|
if ( $ext_links ) :
|
|
|
|
?>
|
|
|
|
<h2>External Link<?php echo ( count( $ext_links ) > 1 ) ? 's' : ''; ?></h2>
|
|
|
|
<?php foreach ( $ext_links as $ext_link ) : ?>
|
2021-01-22 16:19:51 +00:00
|
|
|
<?php
|
|
|
|
$split_link = explode( ';;', $ext_link );
|
|
|
|
$link_title = ( count( $split_link ) > 1 ) ? wp_kses_post( $split_link[0] ) : 'Link';
|
|
|
|
$link_href = ( count( $split_link ) > 1 ) ? $split_link[1] : $split_link[0];
|
|
|
|
?>
|
|
|
|
<a href="<?php echo esc_url( $link_href ); ?>" target="_blank" rel="noopener noreferrer">
|
|
|
|
<?php echo wp_kses_post( $link_title ); ?>
|
|
|
|
</a>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php endif; ?>
|
2021-02-11 14:23:58 +00:00
|
|
|
</section>
|
2021-01-22 16:19:51 +00:00
|
|
|
|
|
|
|
<?php
|
|
|
|
$has_table_of_contents = ! ! get_post_meta( get_the_ID(), 'ToC1', true );
|
|
|
|
if ( $has_table_of_contents ) :
|
|
|
|
?>
|
|
|
|
<section id="post-contents">
|
|
|
|
<h2>Contents</h2>
|
|
|
|
<ol>
|
|
|
|
<?php
|
|
|
|
// phpcs:disable WordPress.CodeAnalysis.AssignmentInCondition
|
|
|
|
$i = 1;
|
|
|
|
while ( $section_title = get_post_meta( get_the_ID(), 'ToC' . $i, true ) ) :
|
2021-01-23 13:26:37 +00:00
|
|
|
?>
|
2021-01-22 16:19:51 +00:00
|
|
|
<li>
|
|
|
|
<a href="#section-<?php echo esc_attr( $i++ ); ?>">
|
2021-01-23 13:26:25 +00:00
|
|
|
<?php echo wp_kses_post( $section_title ); ?>
|
2021-01-22 16:19:51 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
2021-01-23 13:26:37 +00:00
|
|
|
<?php
|
2021-01-22 16:19:51 +00:00
|
|
|
endwhile;
|
|
|
|
// phpcs:enable
|
|
|
|
?>
|
|
|
|
</ol>
|
|
|
|
</section>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$tags = get_the_tags( get_the_ID() );
|
|
|
|
if ( $tags ) :
|
|
|
|
?>
|
|
|
|
<section id="post-tags">
|
|
|
|
<h2>Tags</h2>
|
2021-01-24 12:59:32 +00:00
|
|
|
<ul>
|
2021-01-22 16:19:51 +00:00
|
|
|
<?php foreach ( $tags as $post_tag ) : ?>
|
2021-01-24 12:59:32 +00:00
|
|
|
<li>
|
|
|
|
<a href="<?php echo esc_url( get_tag_link( $post_tag->term_id ) ); ?>" title="<?php echo esc_attr( $post_tag->name ); ?> Tag" class="tag-link">
|
|
|
|
<?php echo wp_kses_post( $post_tag->name ); ?>
|
|
|
|
</a>
|
|
|
|
</li>
|
2021-01-22 16:19:51 +00:00
|
|
|
<?php endforeach; ?>
|
2021-01-24 12:59:32 +00:00
|
|
|
</ul>
|
2021-01-22 16:19:51 +00:00
|
|
|
</section>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
</footer>
|
|
|
|
|
2018-03-21 18:19:20 +00:00
|
|
|
</article><!-- #post-## -->
|