Refactor notes

This commit is contained in:
Ben Goldsworthy 2021-02-14 13:27:53 +00:00
parent d92a493315
commit 23aab0f59e
1 changed files with 26 additions and 11 deletions

View File

@ -28,6 +28,7 @@
<main id="post-body" class="body">
<!-- Post Notes -->
<?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 ) ) : ?>
@ -72,20 +73,34 @@
}
?>
<?php if ( $date1 < $date2 - 31557600 ) : ?>
<?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; ?>
<?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;
?>
<?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
$notes = get_post_meta( get_the_ID(), 'Note(s)', true );
$notes = get_post_meta( get_the_ID(), 'Note', false );
if ( $notes ) :
foreach ( $notes as $note ) :
?>
<li><?php echo wp_kses_post( $note ); ?></li>
<?php
endforeach;
endif;
?>
<li><?php echo wp_kses_post( $notes ); ?></li>
<?php endif; ?>
<?php
$license = get_post_meta( get_the_ID(), 'License', true );
@ -97,6 +112,7 @@
</ul>
</div>
<?php endif; ?>
<!-- /Post Notes -->
<?php
if ( get_the_content() ) :
@ -138,7 +154,6 @@
<?php endif; ?>
</section>
<section id="post-links">
<?php
$int_links = get_post_meta( get_the_ID(), 'Internal_Link', false );