Compare commits

...

51 Commits
v1.0 ... master

Author SHA1 Message Date
Ben Goldsworthy b137bc87de Add closing H1 tag 2023-04-07 23:03:37 +00:00
Ben Goldsworthy eb48bb1cda style: update styling 2022-04-12 22:35:29 +01:00
Ben Goldsworthy 13e9dcda79 feat: update header links 2022-04-12 22:35:14 +01:00
Ben Goldsworthy a9c17dbfc2 chore: indenting 2022-04-12 22:34:33 +01:00
Ben Goldsworthy 2f3ed12adf fix: hide private parent/child orgs 2021-04-08 14:40:11 +01:00
Ben Goldsworthy 8234da161e fix: remove on 404 2021-04-07 07:28:21 +01:00
Ben Goldsworthy 19c863b007 fix: add software citation style 2021-04-01 12:30:50 +01:00
Ben Goldsworthy a593a14b8f fix: conditionally render footer links 2021-04-01 12:30:31 +01:00
Ben Goldsworthy 1f3edda399 Fix note display 2021-03-16 09:32:44 +00:00
Ben Goldsworthy 9b52bc4a50 Add margin to figure captions 2021-03-13 14:12:17 +00:00
Ben Goldsworthy 1ae8977f52 Fix top of articles disappearing under header 2021-03-13 13:44:37 +00:00
Ben Goldsworthy 967a1ea2e0 Add all post types to experience view 2021-02-28 09:33:40 +00:00
Ben Goldsworthy 53fe8a42fb Fix styling of content in archive (bug introduced in previous commit) 2021-02-22 12:28:03 +00:00
Ben Goldsworthy 0e44f46e52 Align grid items at start 2021-02-22 12:12:54 +00:00
Ben Goldsworthy 65e5c15f4d Add sources to writings 2021-02-14 14:46:26 +00:00
Ben Goldsworthy 23aab0f59e Refactor notes 2021-02-14 13:27:53 +00:00
Ben Goldsworthy d92a493315 Add project status banners, re-style blockquotes 2021-02-14 13:26:05 +00:00
Ben Goldsworthy 5d4d85a69f Add internal links to post meta 2021-02-11 14:23:58 +00:00
Ben Goldsworthy da746d3e10 Tweak 2021-02-06 15:20:58 +00:00
Ben Goldsworthy 0a2e902c89 Add basic list archive template 2021-02-06 15:09:22 +00:00
Ben Goldsworthy dd6e4932f3 Fix width<1024px styling 2021-01-24 12:59:54 +00:00
Ben Goldsworthy 65f346796f Wrap tags in unordered list 2021-01-24 12:59:32 +00:00
Ben Goldsworthy 7cea365fb2 Fix timeline height rendering 2021-01-23 16:32:48 +00:00
Ben Goldsworthy 19fdc17cce Hide old CSS files 2021-01-23 16:32:31 +00:00
Ben Goldsworthy 42ba13de1b Fix indentations 2021-01-23 14:41:19 +00:00
Ben Goldsworthy f650e53d9b Lint 2021-01-23 13:54:14 +00:00
Ben Goldsworthy aba542d60d Beautify 2021-01-23 13:41:03 +00:00
Ben Goldsworthy d80cbb4c32 Fix 2021-01-23 13:26:37 +00:00
Ben Goldsworthy abd8c65ee7 Validate form input 2021-01-23 13:26:25 +00:00
Ben Goldsworthy 3a97551bf1
Merge pull request #27 from Rumperuu/feature/post-meta
Add post meta, styling tweaks, massive linting
2021-01-22 16:22:55 +00:00
Ben Goldsworthy 428552848f Add post meta, styling tweaks, massive linting 2021-01-22 16:19:51 +00:00
Ben Goldsworthy 25e0067f05 Styling tweaks 2021-01-22 09:41:53 +00:00
Ben Goldsworthy 7a27b2e2d9 Fix grid alignment 2021-01-21 15:51:11 +00:00
Ben Goldsworthy 93122a867c
Merge pull request #20 from Rumperuu/fix/pre-commit-linting
Add pre-commit linting
2021-01-21 12:53:19 +00:00
Ben Goldsworthy 0480c77fae Update PHPCS 2021-01-21 12:52:19 +00:00
Ben Goldsworthy 0b577b9caf
Merge pull request #18 from Rumperuu/feature/footer
Add footer links, honour DNT
2021-01-21 12:23:51 +00:00
Ben Goldsworthy 41bb3e7ddb Add footer links, honour DNT 2021-01-21 12:22:41 +00:00
Ben Goldsworthy a730fd73ee
Merge pull request #17 from Rumperuu/fix/timelines
Fix timelines, disable taxonomy description HTML tag stripping
2021-01-21 12:05:19 +00:00
Ben Goldsworthy 06c5a67872 Disable taxonomy description HTML stripping 2021-01-21 12:03:31 +00:00
Ben Goldsworthy 877aa0efc0 Fix timeline date coercion, styling, add external/empty href styling 2021-01-21 12:03:14 +00:00
Ben Goldsworthy 60fe2b6e6f
Merge pull request #13 from Rumperuu/fix/experience-page-styling
Fix ‘Experience’ page styling
2021-01-21 10:25:29 +00:00
Ben Goldsworthy be5853376c Fix margin-top styling 2021-01-21 10:24:10 +00:00
Ben Goldsworthy 8af9d37ac7 Hide experience-by-locations template 2021-01-21 10:23:47 +00:00
Ben Goldsworthy 9704bdb41b
Merge pull request #10 from Rumperuu/feature/experience-timeline
Add experience timeline Page Template
2021-01-09 13:06:56 +00:00
Ben Goldsworthy 213ea4a7af Lint 2021-01-09 13:05:24 +00:00
Ben Goldsworthy f36252f563 Add experience Page Template 2021-01-09 13:04:43 +00:00
Ben Goldsworthy 4b75ea244b Update gitignore 2021-01-09 13:03:32 +00:00
Ben Goldsworthy 2de885796b
Merge pull request #7 from Rumperuu/fix/linting
Add code linting to ensure WordPress Coding Standards compliance
2021-01-09 11:18:22 +00:00
Ben Goldsworthy c5a41ae9ea Add PHPCS config, lint files 2021-01-09 11:13:06 +00:00
Ben Goldsworthy 3c30f664b8 Add Post Tag display 2021-01-09 10:35:19 +00:00
Ben Goldsworthy bb9dc6816e Update screenshot 2021-01-09 10:27:51 +00:00
38 changed files with 2253 additions and 2926 deletions

18
.gitignore vendored
View File

@ -1,18 +1,2 @@
*.log
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/wp-cache-config.php
wp-content/plugins/hello.php
/.htaccess
/license.txt
/readme.html
/sitemap.xml
/sitemap.xml.gz
plugins/

View File

@ -0,0 +1,126 @@
<?php
/**
* The template for displaying archive pages.
*
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<?php get_header(); ?>
<?php $loop = new WP_Query( $args ); ?>
<header class="entry-content tile location-block">
<div class="post-header-title">
<h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">by location</h2>
<?php
while ( have_posts() ) :
the_post();
?>
<div class="entry-content" id="taxonomy-description">
<?php the_content(); ?>
<div>
<a class="hyperlink-button" href="?view=countries">Countries</a>
<!--<a class="hyperlink-button" href="?view=regions">Regions</a>-->
<a class="hyperlink-button" href="?view=locations">Locations</a>
</div>
</div>
<?php endwhile; ?>
</div>
</header>
<?php
$locations = get_terms( 'location', array( 'hide_empty' => 0 ) );
// Gets all of the top-level location terms.
$terms = get_terms(
array(
'taxonomy' => 'location',
'term_args' => array( 'parent' => 0 ),
)
);
?>
<div id="primary" class="content-area">
<main id="company-main" class="site-main" role="main">
<div class="row">
<div id="map" style="height:100vh; width:100%;"></div>
</div>
<?php if ( ! empty( $locations ) ) : ?>
<?php if ( $_GET['view'] == 'countries' ) : ?>
<?php
$locationsSubset = array_filter(
$locations,
function ( $t ) {
return $t->parent != 0 && get_term( $t->parent, 'location' )->parent == 0;
}
);
?>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['geochart']});
google.charts.setOnLoadCallback(drawMap);
function drawMap() {
var data = google.visualization.arrayToDataTable([
['Country'],
<?php foreach ( (array) $locationsSubset as $term ) : ?>
['<?php echo $term->description; ?>'],
<?php endforeach; ?>
]);
var options = {};
var chart = new google.visualization.GeoChart(document.getElementById('map'));
chart.draw(data, options);
}
</script>
<?php elseif ( $_GET['view'] == 'locations' ) : ?>
<?php
$locationsSubset = array_filter(
$locations,
function ( $t ) {
return $t->parent != 0 && get_term( $t->parent, 'location' )->parent != 0 && get_term( get_term( $t->parent, 'location' )->parent, 'location' )->parent != 0 && get_term( get_term( get_term( $t->parent, 'location' )->parent, 'location' )->parent, 'location' )->parent == 0;
}
);
?>
<script type="text/javascript">
var locations = [
<?php foreach ( (array) $locationsSubset as $term ) : ?>
{<?php echo $term->description; ?>},
<?php endforeach; ?>
]
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: {lat: 51.483462, lng: 0.0586198}
});
// Create an array of alphabetical characters used to label the markers.
var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// Add some markers to the map.
// Note: The code uses the JavaScript Array.prototype.map() method to
// create an array of markers based on a given "locations" array.
// The map() method here has nothing to do with the Google Maps API.
var markers = locations.map(function(location, i) {
return new google.maps.Marker({
position: location,
label: labels[i % labels.length]
});
});
// Add a marker clusterer to manage the markers.
var markerCluster = new MarkerClusterer(map, markers, {
imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'
});
}
</script>
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsMPnuCM59sC_n11CGxbpbqNY7FRUXnD0&callback=initMap"></script>
<?php endif; ?>
<?php endif; ?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php get_footer(); ?>

View File

@ -2,8 +2,7 @@
/**
* The template for displaying search results pages
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @package Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
@ -15,12 +14,13 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentysixteen' ), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h1>
<!-- TODO: Add header -->
</header><!-- .page-header -->
<?php
// Start the loop.
while ( have_posts() ) : the_post();
while ( have_posts() ) :
the_post();
/**
* Run the loop for the search to output the results.
@ -29,17 +29,19 @@ get_header(); ?>
*/
get_template_part( 'template-parts/content', 'search' );
// End the loop.
// End the loop.
endwhile;
// Previous/next page navigation.
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
) );
the_posts_pagination(
array(
'prev_text' => __( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
)
);
// If no content, include the "No posts found" template.
// If no content, include the "No posts found" template.
else :
get_template_part( 'template-parts/content', 'none' );

20
404.php
View File

@ -1,18 +1,16 @@
<?php
/**
* The template for displaying 404 (not found) errors.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
/**
* The template for displaying 404 (not found) errors.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
<?php get_header(); ?>
get_header(); ?>
<main id="centred-page" role="main">
<h1>404.</h1>
<h2>That's &lsquo;computer&rsquo; for <q>Oops! Something went wrong!</q></h2>
<h1>404.</h1>
<h2>That's <q>computer</q> for <q>Oops! Something went wrong!</q></h2>
</main><!-- .site-main -->
<?php get_footer(); ?>

68
archive-quotes.php Normal file
View File

@ -0,0 +1,68 @@
<?php
/**
* The template for displaying portfolio archives.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
get_header(); ?>
<main id="list-page" class="col-10 col-m-12" role="main">
<header>
<h1>Quotes.</h1>
<?php
echo wp_kses_post(
get_the_posts_pagination(
array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
)
)
);
?>
</header>
<section class="row">
<ul>
<?php
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) :
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', 'list-simple' );
// End the loop.
endwhile;
// If no content, include the "No posts found" template.
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</ul>
</section><!-- .site-main -->
<footer>
<?php
echo wp_kses_post(
get_the_posts_pagination(
array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
)
)
);
?>
</footer>
</main><!-- .content-area -->
<?php get_footer(); ?>

View File

@ -1,58 +1,66 @@
<?php
/**
* The template for displaying portfolio archives.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
/**
* The template for displaying portfolio archives.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
<?php get_header(); ?>
get_header(); ?>
<main id="list-page" class="col-10 col-m-12" role="main">
<header>
<h1><?php echo (get_post_type() == "post") ? single_cat_title() : ucfirst(get_post_type())."s"; ?>.</h1>
<?php
echo get_the_posts_pagination( array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
));
?>
</header>
<section id="grid" class="row">
<?php
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) : the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
// End the loop.
endwhile;
// If no content, include the "No posts found" template.
else:
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</section><!-- .site-main -->
<footer>
<?php
echo get_the_posts_pagination( array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
));
?>
</footer>
<header>
<h1><?php echo wp_kses_post( ( 'post' === get_post_type() ) ? single_cat_title() : ucfirst( get_post_type() ) . 's' ); ?>.</h1>
<?php
echo wp_kses_post(
get_the_posts_pagination(
array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
)
)
);
?>
</header>
<section id="grid" class="row">
<?php
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) :
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
// End the loop.
endwhile;
// If no content, include the "No posts found" template.
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</section><!-- .site-main -->
<footer>
<?php
echo wp_kses_post(
get_the_posts_pagination(
array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
)
)
);
?>
</footer>
</main><!-- .content-area -->
<?php get_footer(); ?>

View File

@ -1,25 +1,22 @@
<?php
/*
* Template Name: Centred Page
*/
/**
*
*
* Displays a full-screen page with content in the center.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
/**
* Template Name: Centred Page
*
* Displays a full-screen page with content in the center.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
<?php get_header(); ?>
get_header(); ?>
<main id="centred-page" role="main">
<?php while (have_posts()): the_post(); ?>
<h1><?php echo get_the_title(); ?></h1>
<h2><?php the_content(); ?></h2>
<?php
while ( have_posts() ) :
the_post();
?>
<h1><?php echo wp_kses_post( get_the_title() ); ?></h1>
<h2><?php the_content(); ?></h2>
<?php endwhile; ?>
</main>

View File

@ -1,53 +1,58 @@
<?php
/**
* The template for displaying comments.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template for displaying comments.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if (post_password_required()) return;
/**
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area">
<div class="row">
<div class="col-7" id="comments-list">
<h3 id="comments-list-title">Replies</h3>
<?php if ( have_comments() ) : ?>
<?php the_comments_navigation(); ?>
<div class="row">
<div class="col-7" id="comments-list">
<h3 id="comments-list-title">Replies</h3>
<?php if ( have_comments() ) : ?>
<?php the_comments_navigation(); ?>
<ol class="comment-list">
<?php
wp_list_comments( array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 42,
));
?>
</ol><!-- .comment-list -->
<ol class="comment-list">
<?php
wp_list_comments(
array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 42,
)
);
?>
</ol><!-- .comment-list -->
<?php the_comments_navigation(); ?>
<?php else: ?>
<p id="no-comments">No comments yet.</p>
<?php endif; ?>
<?php if (!comments_open() && get_comments_number() && post_type_supports(get_post_type(), 'comments')): ?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p>
<?php endif; ?>
</div>
<div class="col-5" id="comments-reply">
<?php
comment_form( array(
'title_reply_before' => '<h3 id="comments-reply-title">',
'title_reply_after' => '</h3>',
));
?>
</div>
</div>
<?php the_comments_navigation(); ?>
<?php else : ?>
<p id="no-comments">No comments yet.</p>
<?php endif; ?>
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<p class="no-comments"><?php wp_kses_post_e( 'Comments are closed.', 'twentysixteen' ); ?></p>
<?php endif; ?>
</div>
<div class="col-5" id="comments-reply">
<?php
comment_form(
array(
'title_reply_before' => '<h3 id="comments-reply-title">',
'title_reply_after' => '</h3>',
)
);
?>
</div>
</div>
</div><!-- .comments-area -->

View File

@ -1,13 +1,16 @@
<?php
/**
* The template for displaying the footer
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template for displaying the footer
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<footer id="site-footer" class="show">
<p>By <a href="/">Ben</a> | <?php if ( ! is_page('Hi.') && ! is_page('privacy-policy') && ! is_404() ): ?><a href="https://github.com/Rumperuu/Omphaloskepsis/issues" target="_blank" rel="noopener noreferrer">Report an Issue</a> | <?php endif; ?><a href="/privacy-policy">Privacy Policy</a></p>
</footer>
<script type="text/javascript">
// Displays and hides the top header bar on page scroll.
jQuery(document).ready(function($) {
@ -15,32 +18,32 @@
var fromTop = $(window).scrollTop();
$('body > header').toggleClass("show", (fromTop > 200));
});
$('blockquote').each(function() {
if ($(this).children('p').children().first().is('q')) {
$(this).addClass('no-first-quote');
}
if ($(this).children('p').children().last().is('q')) {
$(this).addClass('no-last-quote');
}
});
});
function toggleCommentary() {
var linkText = ["Click here to hide all commentary and leave only reportage.", "Click here to show commentary."];
var commentaries = document.getElementsByClassName("article__text--commentary");
var link = document.getElementById("toggleCommentary");
for (var i = 0; i < commentaries.length; i++) {
commentaries[i].style.display = (commentaries[i].style.display == 'none') ? 'inline' : 'none';
}
link.innerHTML = (link.innerHTML == linkText[0]) ? linkText[1] : linkText[0];
}
</script>
function toggleCommentary() {
var linkText = ["Click here to hide all commentary and leave only reportage.", "Click here to show commentary."];
var commentaries = document.getElementsByClassName("article__text--commentary");
var link = document.getElementById("toggleCommentary");
for (var i = 0; i < commentaries.length; i++) {
commentaries[i].style.display = (commentaries[i].style.display == 'none') ? 'inline' : 'none';
}
link.innerHTML = (link.innerHTML == linkText[0]) ? linkText[1] : linkText[0];
}
</script>
<?php wp_footer(); ?>
</body>
</html>

View File

@ -6,35 +6,13 @@
* theme as custom template tags. Others are attached to action and filter
* hooks in WordPress to change core functionality.
*
* When using a child theme you can override certain functions (those wrapped
* in a function_exists() call) by defining them first in your child theme's
* functions.php file. The child theme's functions.php file is included before
* the parent theme's file, so the child theme functions would be used.
*
* @link https://codex.wordpress.org/Theme_Development
* @link https://codex.wordpress.org/Child_Themes
*
* Functions that are not pluggable (not wrapped in function_exists()) are
* instead attached to a filter or action hook.
*
* For more information on hooks, actions, and filters,
* {@link https://codex.wordpress.org/Plugin_API}
*
* @package WordPress
* @subpackage omphaloskepsis
* @package omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* Omphaloskepsis only works in WordPress 4.4 or later.
*/
if ( version_compare( $GLOBALS['wp_version'], '4.4-alpha', '<' ) ) {
require get_template_directory() . '/inc/back-compat.php';
}
// This sets the correct background colour for any LaTeX.
global $themecolors;
$themecolors['bg'] = 'FFFFF0';
$themecolors['bg'] = 'FFFFF0';
$themecolors['text'] = '020202';
if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
@ -49,111 +27,104 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
*/
function omphaloskepsis_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Omphaloskepsis, use a find and replace
* to change 'omphaloskepsis' to the name of your theme in all the template files
*/
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Omphaloskepsis, use a find and replace
* to change 'omphaloskepsis' to the name of your theme in all the template files
*/
load_theme_textdomain( 'omphaloskepsis', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for custom logo.
*
* @since Omphaloskepsis 1.2
*/
add_theme_support( 'custom-logo', array(
'height' => 2256,
'width' => 1622,
'flex-height' => true,
) );
* Enable support for custom logo.
*
* @since Omphaloskepsis 1.2
*/
add_theme_support(
'custom-logo',
array(
'height' => 2256,
'width' => 1622,
'flex-height' => true,
)
);
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1200, 9999 );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'omphaloskepsis' ),
'social' => __( 'Social Links Menu', 'omphaloskepsis' ),
) );
function omphaloskepsis_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array(
'container' => 'main',
'render' => 'omphaloskepsis_infinite_scroll_render',
'footer' => 'colophon',
) );
}
add_action( 'init', 'omphaloskepsis_infinite_scroll_init' );
/**
* Custom render function for Infinite Scroll.
*/
function omphaloskepsis_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) {
get_template_part( 'template-parts/content', 'search' );
} else {
get_template_part( 'template-parts/content', get_post_format() );
}
}
}
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'omphaloskepsis' ),
'social' => __( 'Social Links Menu', 'omphaloskepsis' ),
)
);
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
/*
* Enable support for Post Formats.
*
* See: https://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
'gallery',
'status',
'audio',
'chat',
) );
* Enable support for Post Formats.
*
* See: https://codex.wordpress.org/Post_Formats
*/
add_theme_support(
'post-formats',
array(
'aside',
'image',
'video',
'quote',
'link',
'gallery',
'status',
'audio',
'chat',
)
);
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', omphaloskepsis_fonts_url() ) );
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style(
array(
'css/editor-style.css',
omphaloskepsis_fonts_url(),
)
);
// Indicate widget sidebars can use selective refresh in the Customizer.
add_theme_support( 'customize-selective-refresh-widgets' );
}
endif; // omphaloskepsis_setup
endif;
add_action( 'after_setup_theme', 'omphaloskepsis_setup' );
/**
@ -178,35 +149,41 @@ add_action( 'after_setup_theme', 'omphaloskepsis_content_width', 0 );
* @since Omphaloskepsis 1.0
*/
function omphaloskepsis_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'omphaloskepsis' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar.', 'omphaloskepsis' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'Sidebar', 'omphaloskepsis' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar.', 'omphaloskepsis' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => __( 'Content Bottom 1', 'omphaloskepsis' ),
'id' => 'sidebar-2',
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'Content Bottom 1', 'omphaloskepsis' ),
'id' => 'sidebar-2',
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => __( 'Content Bottom 2', 'omphaloskepsis' ),
'id' => 'sidebar-3',
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'Content Bottom 2', 'omphaloskepsis' ),
'id' => 'sidebar-3',
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'omphaloskepsis_widgets_init' );
@ -241,10 +218,13 @@ if ( ! function_exists( 'omphaloskepsis_fonts_url' ) ) :
}
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' );
$fonts_url = add_query_arg(
array(
'family' => rawurlencode( implode( '|', $fonts ) ),
'subset' => rawurlencode( $subsets ),
),
'https://fonts.googleapis.com/css'
);
}
return $fonts_url;
@ -268,34 +248,55 @@ add_action( 'wp_head', 'omphaloskepsis_javascript_detection', 0 );
*
* @since Omphaloskepsis 1.0
*/
function omphaloskepsis_scripts() {
function omphaloskepsis_scripts() { // phpcs:disable WordPress.WP.EnqueuedResourceParameters
// Load the normalisation stylesheet.
wp_enqueue_style( 'omphaloskepsis-reset', get_template_directory_uri() . '/css/reset.css', array( ), null );
wp_enqueue_style( 'omphaloskepsis-reset', get_template_directory_uri() . '/css/reset.css', array() );
wp_style_add_data( 'omphaloskepsis-ie', 'conditional', 'lt IE 10' );
// Add custom fonts, used in the main stylesheet.
wp_enqueue_style( 'omphaloskepsis-fonts', omphaloskepsis_fonts_url(), array(), null );
wp_enqueue_style( 'omphaloskepsis-fonts', omphaloskepsis_fonts_url(), array() );
// Add Genericons, used in the main stylesheet.
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' );
// Theme stylesheet.
wp_enqueue_style( 'omphaloskepsis-style', get_stylesheet_uri() );
wp_enqueue_style('font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
wp_enqueue_style( 'montserrat', "https://fonts.googleapis.com/css?family=Montserrat" );
wp_enqueue_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' );
wp_enqueue_style( 'montserrat', 'https://fonts.googleapis.com/css?family=Montserrat' );
// Load the Internet Explorer specific stylesheet.
wp_enqueue_style( 'omphaloskepsis-ie', get_template_directory_uri() . '/css/ie.css', array( 'omphaloskepsis-style' ), '20160412' );
wp_enqueue_style(
'omphaloskepsis-ie',
get_template_directory_uri() . '/css/ie.css',
array(
'omphaloskepsis-style',
),
'20160412'
);
wp_style_add_data( 'omphaloskepsis-ie', 'conditional', 'lt IE 10' );
// Load the Internet Explorer 8 specific stylesheet.
wp_enqueue_style( 'omphaloskepsis-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'omphaloskepsis-style' ), '20160412' );
wp_enqueue_style(
'omphaloskepsis-ie8',
get_template_directory_uri() . '/css/ie8.css',
array(
'omphaloskepsis-style',
),
'20160412'
);
wp_style_add_data( 'omphaloskepsis-ie8', 'conditional', 'lt IE 9' );
// Load the Internet Explorer 7 specific stylesheet.
wp_enqueue_style( 'omphaloskepsis-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'omphaloskepsis-style' ), '20160412' );
wp_enqueue_style(
'omphaloskepsis-ie7',
get_template_directory_uri() . '/css/ie7.css',
array(
'omphaloskepsis-style',
),
'20160412'
);
wp_style_add_data( 'omphaloskepsis-ie7', 'conditional', 'lt IE 8' );
// Load the html5 shiv.
@ -309,15 +310,36 @@ function omphaloskepsis_scripts() {
}
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'omphaloskepsis-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20160412' );
wp_enqueue_script(
'omphaloskepsis-keyboard-image-navigation',
get_template_directory_uri() . '/js/keyboard-image-navigation.js',
array(
'jquery',
),
'20160412'
);
}
wp_enqueue_script( 'omphaloskepsis-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160412', true );
wp_enqueue_script(
'omphaloskepsis-script',
get_template_directory_uri() . '/js/functions.js',
array(
'jquery',
),
'20160412',
true
);
wp_localize_script(
'omphaloskepsis-script',
'screenReaderText',
array(
'expand' => __( 'expand child menu', 'omphaloskepsis' ),
'collapse' => __( 'collapse child menu', 'omphaloskepsis' ),
)
);
// phpcs:enable
wp_localize_script( 'omphaloskepsis-script', 'screenReaderText', array(
'expand' => __( 'expand child menu', 'omphaloskepsis' ),
'collapse' => __( 'collapse child menu', 'omphaloskepsis' ),
) );
}
add_action( 'wp_enqueue_scripts', 'omphaloskepsis_scripts' );
@ -367,10 +389,10 @@ function omphaloskepsis_hex2rgb( $color ) {
$color = trim( $color, '#' );
if ( strlen( $color ) === 3 ) {
$r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) );
$g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) );
$b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) );
} else if ( strlen( $color ) === 6 ) {
$r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) );
$g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) );
$b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) );
} elseif ( strlen( $color ) === 6 ) {
$r = hexdec( substr( $color, 0, 2 ) );
$g = hexdec( substr( $color, 2, 2 ) );
$b = hexdec( substr( $color, 4, 2 ) );
@ -378,19 +400,13 @@ function omphaloskepsis_hex2rgb( $color ) {
return array();
}
return array( 'red' => $r, 'green' => $g, 'blue' => $b );
return array(
'red' => $r,
'green' => $g,
'blue' => $b,
);
}
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Add custom image sizes attribute to enhance responsive image functionality
* for content images
@ -405,18 +421,18 @@ require get_template_directory() . '/inc/customizer.php';
function omphaloskepsis_content_image_sizes_attr( $sizes, $size ) {
$width = $size[0];
840 <= $width && $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px';
$sizes = ( 840 <= $width ) ? '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px' : '';
if ( 'page' === get_post_type() ) {
840 > $width && $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px';
$sizes = ( 840 > $width ) ? '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px' : '';
} else {
840 > $width && 600 <= $width && $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px';
600 > $width && $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px';
$sizes = ( 840 > $width && 600 <= $width ) ? '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px' : '';
$sizes = ( 600 > $width ) ? '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px' : '';
}
return $sizes;
}
add_filter( 'wp_calculate_image_sizes', 'omphaloskepsis_content_image_sizes_attr', 10 , 2 );
add_filter( 'wp_calculate_image_sizes', 'omphaloskepsis_content_image_sizes_attr', 10, 2 );
/**
* Add custom image sizes attribute to enhance responsive image functionality
@ -431,12 +447,12 @@ add_filter( 'wp_calculate_image_sizes', 'omphaloskepsis_content_image_sizes_attr
*/
function omphaloskepsis_post_thumbnail_sizes_attr( $attr, $attachment, $size ) {
if ( 'post-thumbnail' === $size ) {
is_active_sidebar( 'sidebar-1' ) && $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 60vw, (max-width: 1362px) 62vw, 840px';
! is_active_sidebar( 'sidebar-1' ) && $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 88vw, 1200px';
$attr['sizes'] = ( is_active_sidebar( 'sidebar-1' ) ) ? '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 60vw, (max-width: 1362px) 62vw, 840px' : '';
$attr['sizes'] = ( is_active_sidebar( 'sidebar-1' ) ) ? '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 88vw, 1200px' : '';
}
return $attr;
}
add_filter( 'wp_get_attachment_image_attributes', 'omphaloskepsis_post_thumbnail_sizes_attr', 10 , 3 );
add_filter( 'wp_get_attachment_image_attributes', 'omphaloskepsis_post_thumbnail_sizes_attr', 10, 3 );
/**
* Modifies tag cloud widget arguments to have all tags in the widget same font size.
@ -447,219 +463,286 @@ add_filter( 'wp_get_attachment_image_attributes', 'omphaloskepsis_post_thumbnail
* @return array A new modified arguments.
*/
function omphaloskepsis_widget_tag_cloud_args( $args ) {
$args['largest'] = 1;
$args['smallest'] = 1;
$args['unit'] = 'em';
return $args;
$args['largest'] = 1;
$args['smallest'] = 1;
$args['unit'] = 'em';
return $args;
}
add_filter( 'widget_tag_cloud_args', 'omphaloskepsis_widget_tag_cloud_args' );
function clean_script_tag($input) {
$input = str_replace("type='text/javascript' ", '', $input);
return str_replace("'", '"', $input);
/**
* Cleans up script tags.
*
* @param string $input The script tag.
* @return sting The cleaned-up script tag.
*/
function clean_script_tag( $input ) {
$input = str_replace( "type='text/javascript' ", '', $input );
return str_replace( "'", '"', $input );
}
add_filter('script_loader_tag', 'clean_script_tag');
add_filter( 'script_loader_tag', 'clean_script_tag' );
function omphaloskepsis_the_content($content) {
global $post;
if ($post->post_type == "program") {
if ($meta = get_post_meta($post->ID, 'Link', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Download</a>';
if ($meta = get_post_meta($post->ID, 'Documentation', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Documentation</a>';
if ($meta = get_post_meta($post->ID, 'Repo', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Repo</a>';
if ($meta = get_post_meta($post->ID, 'Licence', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Licence</a>';
if ($meta = get_post_meta($post->ID, 'MD5', true))
$links = $links . '<p class="checksum">MD5 checksum: '.$meta.'</p>';
return $content . $links;
} elseif ($post->post_type == "website") {
if ($meta = get_post_meta($post->ID, 'Link', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Visit</a>';
if ($meta = get_post_meta($post->ID, 'Repo', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Repo</a>';
if ($meta = get_post_meta($post->ID, 'Licence', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Licence</a>';
return $content . $links;
} elseif ($post->post_type == "writing") {
if ($meta = get_post_meta($post->ID, 'Link', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Read</a>';
if ($meta = get_post_meta($post->ID, 'Licence', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Licence</a>';
return $content . $links;
} elseif ($post->post_type == "other") {
if ($meta = get_post_meta($post->ID, 'Link', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Download</a>';
return $content . $links;
}
return $content;
/**
* Renders the content of a post.
*
* @param string $content The post content.
* @return string The rendered post content.
*/
function omphaloskepsis_the_content( $content ) {
global $post;
if ( 'program' === $post->post_type ) {
// phpcs:disable Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
// phpcs:disable WordPress.CodeAnalysis.AssignmentInCondition.Found
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>';
}
if ( $meta = get_post_meta( $post->ID, 'Documentation', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Documentation</a>';
}
if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>';
}
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
}
if ( $meta = get_post_meta( $post->ID, 'MD5', true ) ) {
$links = $links . '<p class="checksum">MD5 checksum: ' . $meta . '</p>';
}
return $content . $links;
} elseif ( 'website' === $post->post_type ) {
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Visit</a>';
}
if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>';
}
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
}
return $content . $links;
} elseif ( 'writing' === $post->post_type ) {
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Read</a>';
}
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
}
return $content . $links;
} elseif ( 'other' === $post->post_type ) {
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>';
}
return $content . $links;
}
// phpcs:enable
return $content;
}
add_filter('the_content', 'omphaloskepsis_the_content', 10);
add_filter( 'the_content', 'omphaloskepsis_the_content', 10 );
// phpcs:disable Squiz.Commenting.FunctionComment.Missing
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'dashicons' );
}
// phpcs:enable
/**
* Display a table of all the available organisations.
*
* @return void
*/
function display_companies() {
echo '<tr>';
echo '<th colspan="2">Organisation</th>';
echo '<th>Children</th>';
echo '<th>Associated Items</th>';
echo '</tr>';
if ($_POST['toplevel'] == "true") {
// Gets all of the top-level company terms.
$terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company', 'term_args' => array('parent' => 0)));
$include = 1;
} else {
// Gets all of the company terms.
$terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company',));
$include = 0;
}
if(!empty($terms)) {
foreach($terms as $term) {
$term_children = get_term_children($term->term_id, "company");
// 0 = Jobs
// 1 = Blog Posts
// 2 = Websites
// 3 = Programs
// 4 = Writings
// 5 = Videos
// 6 = Others
// 7 = Qualifications
// 8 = Awards
$post_types = array('job', 'post', 'website', 'program', 'writing', 'video', 'other', 'qualification', 'award');
$dashicons = array('hammer', 'admin-post', 'schedule', 'desktop', 'format-aside', 'video-alt', 'archive', 'id', 'awards');
$term_items = array();
$term_item_counts = array();
echo '<tr>';
echo '<th colspan="2">Organisation</th>';
echo '<th>Children</th>';
echo '<th>Associated Items</th>';
echo '</tr>';
foreach ($post_types as $post_type) {
$args = array(
'posts_per_page' => -1,
'post_type' => $post_type,
'tax_query' => array(
array(
'taxonomy' => 'company',
'field' => 'slug',
'terms' => $term->slug,
'include_children' => $include,
),
),
'meta_query' => array(),
);
if ($_POST['currentjobs'] == "true" && $post_type == "job") {
$args['meta_query'] = array(
array(
'key' => 'end-date',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
if ($_POST['showexpired'] != "true" && $post_type == "qualification") {
$args['meta_query'] = array(
array(
'key' => 'Expired',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
if ( isset( $_SERVER['REQUEST_METHOD'] ) && ( 'POST' === $_SERVER['REQUEST_METHOD'] ) ) {
if ( ! isset( $_POST['settings_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( filter_input( INPUT_POST, 'settings_nonce' ) ), 'experience' ) ) {
echo '<tr><td>Error</td></tr>';
wp_die( 'Invalid nonce' );
}
$posts = get_posts($args);
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
if ( isset( $_POST['toplevel'] ) && 'true' === $_POST['toplevel'] ) {
// Gets all of the top-level company terms.
$terms = apply_filters(
'taxonomy-images-get-terms',
'',
array(
'having_images' => false,
'taxonomy' => 'company',
'term_args' => array(
'parent' => 0,
),
)
);
$include = 1;
} else {
// Gets all of the company terms.
$terms = apply_filters(
'taxonomy-images-get-terms',
'',
array(
'having_images' => false,
'taxonomy' => 'company',
)
);
$include = 0;
}
// phpcs:enable
if ( ! empty( $terms ) ) {
foreach ( $terms as $term ) {
$term_children = get_term_children( $term->term_id, 'company' );
array_push($term_items, $posts);
array_push($term_item_counts, count($posts));
}
if(($_POST['job'] == "true" && $term_item_counts[0] > 0) ||
($_POST['post'] == "true" && $term_item_counts[1] > 0) ||
($_POST['website'] == "true" && $term_item_counts[2] > 0) ||
($_POST['program'] == "true" && $term_item_counts[3] > 0) ||
($_POST['writing'] == "true" && $term_item_counts[4] > 0) ||
($_POST['video'] == "true" && $term_item_counts[5] > 0) ||
($_POST['other'] == "true" && $term_item_counts[6] > 0) ||
($_POST['qualification'] == "true" && $term_item_counts[7] > 0) ||
($_POST['award'] == "true" && $term_item_counts[8] > 0)) {
$imgURL = wp_get_attachment_image_src($term->image_id, 'full')[0];
$bgImg = (!$imgURL) ? "" : " background-image: url(".strtok($imgURL, '?').");";
$colour = get_term_meta($term->term_id, 'color', true);
$colour = ($colour != "") ? $colour : "transparent";
echo '<tr class="organisation">';
echo '<td class="organisation-logo">';
echo '<a href="'.esc_url(get_term_link($term, $term->taxonomy)).'">';
echo '<img style="background-color: '.$colour.';" src="'.strtok($imgURL, '?').'" alt="'.$term->name.' logo">';
echo '</a>';
echo '</td>';
echo '<td class="organisation-name">';
echo '<a href="'.esc_url(get_term_link($term, $term->taxonomy)).'">';
echo '<p>'.$term->name.'</p>';
echo '</a>';
echo '</td>';
echo '<td class="organisation-items organisation-children">';
$num = (count($term_children) > 0) ? "" : "none";
echo '<div class="organisation-item '.$num.'">';
echo '<span class="dashicons dashicons-groups"></span><br>'.count($term_children);
echo '</div>';
echo '</td>';
echo '<td class="organisation-items">';
$i = 0;
foreach ($post_types as $post_type) {
$num = ($term_item_counts[$i] > 0) ? "" : "none";
echo '<div class="organisation-item '.$num.'">';
echo '<span class="dashicons dashicons-'.$dashicons[$i].'"></span><br>'.$term_item_counts[$i];
echo '</div>';
$i++;
};
echo '</td>';
echo '</tr>';
/*
echo '<a href="'.esc_url(get_term_link($term, $term->taxonomy)).'">';
echo '<li class="col-2 col-m-4" style="background-color: '.$colour.'; '.$bgImg.'">';
echo '<div class="company-info-container left">';
if (count($term_children) > 0) {
echo '<div class="company-info children">';
echo count($term_children).'<br><span class="dashicons dashicons-groups"></span>';
echo '</div>';
}
echo '</div>';
echo '<div class="company-info-container right">';
$i = 0;
foreach ($post_types as $post_type) {
if ($_POST[$post_type] == "true") {
echo '<div class="company-info jobs">';
echo $term_item_counts[$i].'<span class="dashicons dashicons-'.$dashicons[$i].'"></span>';
echo '</div>';
}
$i++;
}
echo '</div>';
if (!$imgURL) echo '<p class="company-name">'.$term->name.'</p>';
echo '</li>';
echo '</a>';
*/
}
}
} else {
echo '<p>No companies found</p>';
}
// 0 = Jobs
// 1 = Blog Posts
// 2 = Websites
// 3 = Programs
// 4 = Writings
// 5 = Audiovisuals
// 6 = Others
// 7 = Qualifications
// 8 = Awards
// 9 = Appearances
$post_types = array(
'job',
'post',
'website',
'program',
'writing',
'audiovisual',
'other',
'qualification',
'award',
'appearance',
);
$dashicons = array(
'hammer',
'admin-post',
'schedule',
'desktop',
'format-aside',
'video-alt',
'archive',
'id',
'awards',
'id-alt',
);
$term_items = array();
$term_item_counts = array();
die();
// phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_tax_query
// phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_query
foreach ( $post_types as $post_type ) {
$args = array(
'posts_per_page' => - 1,
'post_type' => $post_type,
'tax_query' => array(
array(
'taxonomy' => 'company',
'field' => 'slug',
'terms' => $term->slug,
'include_children' => $include,
),
),
'meta_query' => array(),
);
if ( isset( $_POST['currentjobs'] ) && 'true' === $_POST['currentjobs'] && 'job' === $post_type ) {
$args['meta_query'] = array(
array(
'key' => 'end-date',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
if ( isset( $_POST['showexpired'] ) && 'true' !== $_POST['showexpired'] && 'qualification' === $post_type ) {
$args['meta_query'] = array(
array(
'key' => 'Expired',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
// phpcs:enable
$posts = get_posts( $args );
array_push( $term_items, $posts );
array_push( $term_item_counts, count( $posts ) );
}
// Oh dear.
if ( ( isset( $_POST['job'] ) && 'true' === $_POST['job'] && $term_item_counts[0] > 0 ) ||
( isset( $_POST['post'] ) && 'true' === $_POST['post'] && $term_item_counts[1] > 0 ) ||
( isset( $_POST['website'] ) && 'true' === $_POST['website'] && $term_item_counts[2] > 0 ) ||
( isset( $_POST['program'] ) && 'true' === $_POST['program'] && $term_item_counts[3] > 0 ) ||
( isset( $_POST['writing'] ) && 'true' === $_POST['writing'] && $term_item_counts[4] > 0 ) ||
( isset( $_POST['audiovisual'] ) && 'true' === $_POST['audiovisual'] && $term_item_counts[5] > 0 ) ||
( isset( $_POST['other'] ) && 'true' === $_POST['other'] && $term_item_counts[6] > 0 ) ||
( isset( $_POST['qualification'] ) && 'true' === $_POST['qualification'] && $term_item_counts[7] > 0 ) ||
( isset( $_POST['award'] ) && 'true' === $_POST['award'] && $term_item_counts[8] > 0 ) ||
( isset( $_POST['appearance'] ) && 'true' === $_POST['appearance'] && $term_item_counts[9] > 0 )
) {
$img_url = wp_get_attachment_image_src( $term->image_id, 'full' ) [0];
$bg_img = ( ! $img_url ) ? '' : ' background-image: url(' . strtok( $img_url, '?' ) . ');';
$colour = get_term_meta( $term->term_id, 'color', true );
$colour = ( '' !== $colour ) ? $colour : 'transparent';
echo '<tr class="organisation">';
echo '<td class="organisation-logo">';
echo '<a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">';
echo wp_kses_post( '<img style="background-color: ' . $colour . ';" src="' . strtok( $img_url, '?' ) . '" alt="' . $term->name . ' logo">' );
echo '</a>';
echo '</td>';
echo '<td class="organisation-name">';
echo '<a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">';
echo wp_kses_post( '<p>' . $term->name . '</p>' );
echo '</a>';
echo '</td>';
echo '<td class="organisation-items organisation-children">';
$num = ( count( $term_children ) > 0 ) ? '' : 'none';
echo '<div class="organisation-item ' . esc_attr( $num ) . '">';
echo wp_kses_post( '<span class="dashicons dashicons-groups"></span><br>' . count( $term_children ) );
echo '</div>';
echo '</td>';
echo '<td class="organisation-items">';
$i = 0;
foreach ( $post_types as $post_type ) {
$num = ( $term_item_counts[ $i ] > 0 ) ? '' : 'none';
echo '<div class="organisation-item ' . esc_attr( $num ) . '">';
echo wp_kses_post( '<span class="dashicons dashicons-' . esc_attr( $dashicons[ $i ] ) . '"></span><br>' . $term_item_counts[ $i ] );
echo '</div>';
$i++;
};
echo '</td>';
echo '</tr>';
}
}
} else {
echo '<p>No companies found</p>';
}
}
die();
}
add_action('wp_ajax_display_companies', 'display_companies');
add_action('wp_ajax_nopriv_display_companies', 'display_companies');
add_action( 'wp_ajax_display_companies', 'display_companies' );
add_action( 'wp_ajax_nopriv_display_companies', 'display_companies' );
// allow HTML in category and taxonomy descriptions.
remove_filter( 'pre_term_description', 'wp_filter_kses' );
remove_filter( 'pre_link_description', 'wp_filter_kses' );
remove_filter( 'pre_link_notes', 'wp_filter_kses' );
remove_filter( 'term_description', 'wp_kses_data' );
// honour user DNT header.
add_filter( 'jetpack_honor_dnt_header_for_stats', '__return_true' );

View File

@ -1,40 +1,36 @@
<?php
/**
* The template for displaying the header.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template for displaying the header.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $index = get_post_meta(get_the_ID(), 'Index', true); ?>
<?php if (!(is_single() && !is_page() && $index == "true")): ?>
<meta name="robots" content="noindex">
<?php endif; ?>
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php endif; ?>
<?php wp_head(); ?>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
</head>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php endif; ?>
<?php wp_head(); ?>
<?php // phpcs:disable WordPress.WP.EnqueuedResources ?>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<?php // phpcs:enable ?>
</head>
<body <?php body_class(); ?> id="site-wrapper">
<?php if (!is_page_template('centred-page.php')): ?>
<header id="site-header">
<nav id="site-header-nav">
<div class="site-header-nav-item"><a href="/"><h1>Ben Goldsworthy</a></div>
<div class="site-header-nav-item"><h2>Views my own. Do try this at home.</h2></div>
<div class="site-header-nav-item"><p>~ <a href="mailto:me+bg@bengoldsworthy.net"><i class="fa fa-envelope"></i></a> ~ <a href="bitcoin:1HApEg2robrRCx4rTKKeFj25unoaX65QUc"><i class="fa fa-btc"></i></a> ~ <a href="https://github.com/Rumperuu"><i class="fa fa-github"></i></a> ~ <a href="/0x30D22F41.asc"><i class="fa fa-key"></i></a> ~ <a href="/feed"><i class="fa fa-rss"></i></a> ~</p></div>
<div class="site-header-nav-item"><a href="/blog">Blog</a></div>
<div class="site-header-nav-item"><a href="/portfolios">Portfolios</a></div>
<div class="site-header-nav-item"><a href="/social-cataloguing">Social Cataloguing</a></div>
</nav>
</header>
<?php endif; ?>
<body <?php body_class(); ?> id="site-wrapper">
<?php if ( ! is_page_template( 'centred-page.php' ) && ! is_404() ) : ?>
<header id="site-header">
<nav id="site-header-nav">
<div class="site-header-nav-item"><a href="/"><h1>Ben Goldsworthy</h1></a></div>
<div class="site-header-nav-item"><h2>Views my own. Discussion endorsement. Do try this at home. New site in progress.</h2></div>
<div class="site-header-nav-item"><p>~ <a href="mailto:me+bg@bengoldsworthy.net"><i class="fa fa-envelope"></i></a> ~ <a href="https://github.com/Rumperuu"><i class="fa fa-github"></i></a> ~ <a href="/bengoldsworthy.asc"><i class="fa fa-key"></i></a> ~ <a href="/feed"><i class="fa fa-rss"></i></a> ~</p></div>
</nav>
</header>
<?php endif; ?>

109
home.php
View File

@ -1,61 +1,68 @@
<?php
/**
* The blogroll template file.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The blogroll template file.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<?php get_header(); ?>
<main id="list-page" class="col-10 col-m-12" role="main">
<header>
<h1>Blog.</h1>
<h2><strong>All</strong> / <a href="/category/thoughts">Thoughts</a> / <a href="/category/reports">Reports</a> / <a href="/category/reviews">Reviews</a> / <a href="/category/projects">Projects</a></h2>
<?php
echo get_the_posts_pagination( array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
));
?>
</header>
<header>
<h1>Blog.</h1>
<h2><strong>All</strong> / <a href="/category/thoughts">Thoughts</a> / <a href="/category/reports">Reports</a> / <a href="/category/reviews">Reviews</a> / <a href="/category/projects">Projects</a></h2>
<?php
echo wp_kses_post(
get_the_posts_pagination(
array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
)
)
);
?>
</header>
<section id="grid" class="row">
<?php
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) : the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
// End the loop.
endwhile;
// If no content, include the "No posts found" template.
else:
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</section><!-- .site-main -->
<footer>
<?php
echo get_the_posts_pagination( array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
));
?>
</footer>
<section id="grid" class="row">
<?php
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) :
the_post();
/**
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
// End the loop.
endwhile;
// If no content, include the "No posts found" template.
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</section><!-- .site-main -->
<footer>
<?php
echo wp_kses_post(
get_the_posts_pagination(
array(
'screen_reader_text' => ' ',
'mid_size' => 20,
'prev_text' => '',
'next_text' => '',
)
)
);
?>
</footer>
</main><!-- .content-area -->
<?php //get_sidebar(); ?>
<?php get_footer(); ?>

64
icons/extlink.svg Normal file
View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Creator: CorelDRAW X5 -->
<svg
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/2000/svg"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:ns1="http://sozi.baierouge.fr"
xmlns:cc="http://web.resource.org/cc/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
style="fill-rule:evenodd;text-rendering:geometricPrecision;image-rendering:optimizeQuality;clip-rule:evenodd;shape-rendering:geometricPrecision"
xml:space="preserve"
viewBox="0 0 1395 1395"
>
<defs
>
<style
type="text/css"
>
.fil0 {fill:black;fill-rule:nonzero}
</style
>
</defs
>
<g
id="Layer_x0020_1"
>
<path
class="fil0"
d="m848 995v-447h-549l157 157c21 21 21 54 0 75l-327 327 161 161 327-327c21-21 54-21 75 0l157 157v-102zm-442-553v-389c0-29 24-53 53-53h884c29 0 53 24 53 53v1172c0 29-24 53-53 53h-884c-9 0-17-2-24-6l-108 108c-21 21-54 21-75 0l-236-236c-21-21-21-54 0-75l327-327-210-210c-33-33-10-90 37-90h235zm106 0h405c13 4 23 15 30 26h206c70 0 70 106 0 106h-199v128h199c70 0 70 106 0 106h-199v128h199c70 0 70 106 0 106h-199v128h336v-1066h-778v336zm23 729h238l-119-119-119 119zm115-831c-70 0-70-106 0-106h503c70 0 70 106 0 106h-503z"
/>
</g
>
<metadata
><rdf:RDF
><cc:Work
><dc:format
>image/svg+xml</dc:format
><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage"
/><cc:license
rdf:resource="http://creativecommons.org/licenses/publicdomain/"
/><dc:publisher
><cc:Agent
rdf:about="http://openclipart.org/"
><dc:title
>Openclipart</dc:title
></cc:Agent
></dc:publisher
></cc:Work
><cc:License
rdf:about="http://creativecommons.org/licenses/publicdomain/"
><cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction"
/><cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution"
/><cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks"
/></cc:License
></rdf:RDF
></metadata
></svg
>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,71 +0,0 @@
<?php
/**
* Twenty Sixteen back compat functionality
*
* Prevents Twenty Sixteen from running on WordPress versions prior to 4.4,
* since this theme is not meant to be backward compatible beyond that and
* relies on many newer functions and markup changes introduced in 4.4.
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
/**
* Prevent switching to Twenty Sixteen on old versions of WordPress.
*
* Switches to the default theme.
*
* @since Twenty Sixteen 1.0
*/
function twentysixteen_switch_theme() {
switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
unset( $_GET['activated'] );
add_action( 'admin_notices', 'twentysixteen_upgrade_notice' );
}
add_action( 'after_switch_theme', 'twentysixteen_switch_theme' );
/**
* Adds a message for unsuccessful theme switch.
*
* Prints an update nag after an unsuccessful attempt to switch to
* Twenty Sixteen on WordPress versions prior to 4.4.
*
* @since Twenty Sixteen 1.0
*
* @global string $wp_version WordPress version.
*/
function twentysixteen_upgrade_notice() {
$message = sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] );
printf( '<div class="error"><p>%s</p></div>', $message );
}
/**
* Prevents the Customizer from being loaded on WordPress versions prior to 4.4.
*
* @since Twenty Sixteen 1.0
*
* @global string $wp_version WordPress version.
*/
function twentysixteen_customize() {
wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), '', array(
'back_link' => true,
) );
}
add_action( 'load-customize.php', 'twentysixteen_customize' );
/**
* Prevents the Theme Preview from being loaded on WordPress versions prior to 4.4.
*
* @since Twenty Sixteen 1.0
*
* @global string $wp_version WordPress version.
*/
function twentysixteen_preview() {
if ( isset( $_GET['preview'] ) ) {
wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ) );
}
}
add_action( 'template_redirect', 'twentysixteen_preview' );

File diff suppressed because it is too large Load Diff

View File

@ -1,262 +0,0 @@
<?php
/**
* Custom Twenty Sixteen template tags
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
if ( ! function_exists( 'twentysixteen_entry_meta' ) ) :
/**
* Prints HTML with meta information for the categories, tags.
*
* Create your own twentysixteen_entry_meta() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*/
function twentysixteen_entry_meta() {
if ( 'post' === get_post_type() ) {
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 );
printf( '<span class="byline"><span class="author">%1$s<a class="url fn n" href="%3$s">%4$s</a></span></span>',
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
_x( 'Author', 'Used before post author name.', 'twentysixteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
}
if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
twentysixteen_entry_date();
}
$format = get_post_format();
if ( current_theme_supports( 'post-formats', $format ) ) {
printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
sprintf( '<span class="screen-reader-text">%s </span></div>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ),
esc_url( get_post_format_link( $format ) ),
get_post_format_string( $format )
);
}
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit', 'twentysixteen' ),
get_the_title()
),
'<span class="edit-link">',
'</span>'
);
}
endif;
if ( ! function_exists( 'twentysixteen_entry_date' ) ) :
/**
* Prints HTML with date information for current post.
*
* Create your own twentysixteen_entry_date() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*/
function twentysixteen_entry_date() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
get_the_date(),
esc_attr( get_the_modified_date( 'c' ) ),
get_the_modified_date()
);
printf( '<span class="posted-on"><a href="%2$s" rel="bookmark">%3$s</a></span>',
_x( 'Posted on', 'Used before publish date.', 'bengoldsworthy' ),
esc_url( get_permalink() ),
$time_string
);
}
endif;
if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) :
/**
* Prints HTML with category and tags for current post.
*
* Create your own twentysixteen_entry_taxonomies() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*/
function twentysixteen_entry_taxonomies() {
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
if ( $categories_list && twentysixteen_categorized_blog() ) {
printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Categories', 'Used before category names.', 'twentysixteen' ),
$categories_list
);
}
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
if ( $tags_list ) {
printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
$tags_list
);
}
}
endif;
if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) :
/**
* Displays an optional post thumbnail.
*
* Wraps the post thumbnail in an anchor element on index views, or a div
* element when on single views.
*
* Create your own twentysixteen_post_thumbnail() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*/
function twentysixteen_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
?>
<div class="post-header-image">
<div class="post-title"><?php the_title( '<h2 class="title">', '</h2>' ); ?></div>
<?php the_post_thumbnail(); ?>
</div><!-- .post-thumbnail -->
<?php else : ?>
<!--<a class="post-thumbnail" href="<?php //the_permalink(); ?>" aria-hidden="true">
<div class="read-div">Read</div>
<?php //the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
</a>-->
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
<div class="image-thumbnail" style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<div class="read-div">Read</div>
<?php //the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
</div>
</a>
<?php endif; // End is_singular()
}
endif;
if ( ! function_exists( 'twentysixteen_excerpt' ) ) :
/**
* Displays the optional excerpt.
*
* Wraps the excerpt in a div element.
*
* Create your own twentysixteen_excerpt() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*
* @param string $class Optional. Class string of the div element. Defaults to 'entry-summary'.
*/
function twentysixteen_excerpt( $class = 'entry-summary' ) {
$class = esc_attr( $class );
if ( has_excerpt() || is_search() ) : ?>
<div class="<?php echo $class; ?>">
<?php the_excerpt(); ?>
</div><!-- .<?php echo $class; ?> -->
<?php endif;
}
endif;
if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) :
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ... and
* a 'Continue reading' link.
*
* Create your own twentysixteen_excerpt_more() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*
* @return string 'Continue reading' link prepended with an ellipsis.
*/
function twentysixteen_excerpt_more() {
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) )
);
return ' &hellip; ' . $link;
}
add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' );
endif;
/**
* Determines whether blog/site has more than one category.
*
* Create your own twentysixteen_categorized_blog() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*
* @return bool True if there is more than one category, false otherwise.
*/
function twentysixteen_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) {
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
// We only need to know if there is more than one category.
'number' => 2,
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'twentysixteen_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so twentysixteen_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so twentysixteen_categorized_blog should return false.
return false;
}
}
/**
* Flushes out the transients used in twentysixteen_categorized_blog().
*
* @since Twenty Sixteen 1.0
*/
function twentysixteen_category_transient_flusher() {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
// Like, beat it. Dig?
delete_transient( 'twentysixteen_categories' );
}
add_action( 'edit_category', 'twentysixteen_category_transient_flusher' );
add_action( 'save_post', 'twentysixteen_category_transient_flusher' );
if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) :
/**
* Displays the optional custom logo.
*
* Does nothing if the custom logo is not available.
*
* @since Twenty Sixteen 1.2
*/
function twentysixteen_the_custom_logo() {
if ( function_exists( 'the_custom_logo' ) ) {
the_custom_logo();
}
}
endif;

View File

@ -2,10 +2,10 @@
/**
* The template file for when no more specific template is found.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<?php get_header(); ?>

View File

@ -1,138 +1,144 @@
<?php
/*
* Template Name: Experience by Companies
*/
/**
* Template Name: Experience by Companies
*
* The template for displaying all items, indexed by organisation.
*
* The template for displaying all single posts and attachments
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
get_header(); ?>
<div id="experience-wrapper" class="content-area col-10 col-m-12">
<!--Page Title & Details-->
<header class="post-header-title">
<h1 style="margin-bottom: 20px;" id="page-title">Experience.</h1>
<?php while (have_posts()) : the_post(); ?>
<div class="entry-content tile" id="taxonomy-description">
<?php the_content() ?>
</div>
<div style="width: 70%; margin: auto; margin-top: 20px; border: 2px dashed #020202; padding: 20px; border-radius: 25px;" class="entry-content tile" id="settings">
<h3 style="margin-bottom: 14px;" class="subheading">Settings</h3>
<form action="/experience-by-companies" id="settings" method="GET">
<input class="checkbox" type="checkbox" id="toplevel" value="toplevel" checked="checked">
<label for="toplevel">Display only top-level organisations</label>
<br>
<fieldset>
<legend><p style="margin-top: 14px; margin-bottom: 14px;">Display only organisations with associated:</p></legend>
<div class="controlgroup" id="typestodisplay">
<label for="jobs">Roles <span class="dashicons dashicons-hammer"></span></label>
<input type="checkbox" name="jobs" id="jobs" checked="checked">
<label class="currentjobs" for="currentjobs">Display only current roles</label>
<input class="currentjobs" type="checkbox" name="currentjobs" id="currentjobs" checked="checked">
<label for="posts">Blog Posts <span class="dashicons dashicons-admin-post"></span></label>
<input type="checkbox" name="posts" id="posts">
<label for="websites">Websites <span class="dashicons dashicons-schedule"></span></label>
<input type="checkbox" name="websites" id="websites">
<label for="programs">Programs <span class="dashicons dashicons-desktop"></span></label>
<input type="checkbox" name="programs" id="programs">
<label for="writings">Writings <span class="dashicons dashicons-format-aside"></span></label>
<input type="checkbox" name="writings" id="writings">
<label for="videos">Videos <span class="dashicons dashicons-video-alt"></span></label>
<input type="checkbox" name="videos" id="videos">
<label for="other">Other <span class="dashicons dashicons-archive"></span></label>
<input type="checkbox" name="other" id="other">
<label for="qualifications">Qualifications <span class="dashicons dashicons-id"></span></label>
<input type="checkbox" name="qualifications" id="qualifications">
<label class="expired" for="expired">Show expired qualifications</label>
<input class="expired" type="checkbox" name="expired" id="expired">
<label for="awards">Awards <span class="dashicons dashicons-awards"></span></label>
<input type="checkbox" name="awards" id="awards">
</div>
</fieldset>
<br>
<input class="ui-button ui-widget ui-corner-all" id="refresh" type="submit" value="Refresh">
</form>
</div>
<?php endwhile; ?>
</header>
<main id="experience-wrapper" class="content-area col-10 col-m-12">
<!--Page Title & Details-->
<header class="post-header-title">
<h1 style="margin-bottom: 20px;" id="page-title">Experience.</h1>
<?php
while ( have_posts() ) :
the_post();
?>
<div class="entry-content tile" id="taxonomy-description">
<?php the_content(); ?>
</div>
<!--Company Grid-->
<table class="row" id="organisations-grid">
</table>
<div class="entry-content tile" id="settings">
<h3 style="margin-bottom: 14px;" class="subheading">Settings</h3>
<form action="/experience" id="settings" method="POST">
<?php echo wp_kses_post( wp_nonce_field( 'experience', 'settings_nonce' ) ); ?>
<input class="checkbox" type="checkbox" id="toplevel" value="toplevel" checked="checked">
<label for="toplevel">Display only top-level organisations</label>
<br>
<fieldset>
<legend><p style="margin-top: 14px; margin-bottom: 14px;">Display only organisations with associated:</p></legend>
<div class="controlgroup" id="typestodisplay">
<label for="jobs">Roles <span class="dashicons dashicons-hammer"></span></label>
<input type="checkbox" name="jobs" id="jobs" checked="checked">
<label class="currentjobs" for="currentjobs">Display only current roles</label>
<input class="currentjobs" type="checkbox" name="currentjobs" id="currentjobs" checked="checked">
<label for="posts">Blog Posts <span class="dashicons dashicons-admin-post"></span></label>
<input type="checkbox" name="posts" id="posts">
<label for="websites">Websites <span class="dashicons dashicons-schedule"></span></label>
<input type="checkbox" name="websites" id="websites">
<label for="programs">Programs <span class="dashicons dashicons-desktop"></span></label>
<input type="checkbox" name="programs" id="programs">
<label for="writings">Writings <span class="dashicons dashicons-format-aside"></span></label>
<input type="checkbox" name="writings" id="writings">
<label for="audiovisuals">Audiovisuals <span class="dashicons dashicons-video-alt"></span></label>
<input type="checkbox" name="audiovisuals" id="audiovisuals">
<label for="other">Other <span class="dashicons dashicons-archive"></span></label>
<input type="checkbox" name="other" id="other">
<label for="qualifications">Qualifications <span class="dashicons dashicons-id"></span></label>
<input type="checkbox" name="qualifications" id="qualifications">
<label class="expired" for="expired">Show expired qualifications</label>
<input class="expired" type="checkbox" name="expired" id="expired">
<label for="awards">Awards <span class="dashicons dashicons-awards"></span></label>
<input type="checkbox" name="awards" id="awards">
<label for="appearances">Appearances <span class="dashicons dashicons-id-alt"></span></label>
<input type="checkbox" name="appearances" id="appearances">
</div>
</fieldset>
<br>
<input class="ui-button ui-widget ui-corner-all" id="refresh" type="submit" value="Refresh">
</form>
</div>
<?php endwhile; ?>
</header>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
// Populates the organisations grid.
jQuery(document).ready(function($) {
// Sets up jQueryUI elements.
$('input:checkbox').checkboxradio();
$('.controlgroup').controlgroup();
$('.refresh').button();
<!--Company Grid-->
<table class="row" id="organisations-grid">
</table>
<?php // phpcs:disable WordPress.WP.EnqueuedResources ?>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
// Populates the organisations grid.
jQuery(document).ready(function($) {
// Sets up jQueryUI elements.
$('input:checkbox').checkboxradio();
$('.controlgroup').controlgroup();
$('.refresh').button();
// Displays the initial organisations grid.
displayCompanies();
$('#refresh').click(function(event) {
$(this).css('border-width', '1px');
event.preventDefault();
displayCompanies();
});
$('.expired').hide();
// Displays the initial organisations grid.
$('#refresh').click();
$('input[type="checkbox"]').change(function() {
$('#refresh').css('border-width', '5px');
});
$('#jobs').change(function() {
if($(this).is(":checked")) {
$('.currentjobs').fadeIn(100);
} else {
$('.currentjobs').fadeOut(100);
}
});
$('.expired').hide();
$('#qualifications').change(function() {
if($(this).is(":checked")) {
$('.expired').fadeIn(100);
} else {
$('.expired').fadeOut(100);
}
});
$('input[type="checkbox"]').change(function() {
$('#refresh').css('border-width', '5px');
});
$('#refresh').click(function(event) {
$(this).css('border-width', '1px');
event.preventDefault();
displayCompanies();
});
$('#jobs').change(function() {
if($(this).is(":checked")) {
$('.currentjobs').fadeIn(100);
} else {
$('.currentjobs').fadeOut(100);
}
});
function displayCompanies() {
$('#organisations-grid').html('<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">');
$('#qualifications').change(function() {
if($(this).is(":checked")) {
$('.expired').fadeIn(100);
} else {
$('.expired').fadeOut(100);
}
});
var settings = {
'action': 'display_companies',
'toplevel': $('#toplevel').is(':checked'),
'job': $('#jobs').is(':checked'),
'currentjobs': $('#currentjobs').is(':checked'),
'post': $('#posts').is(':checked'),
'website': $('#websites').is(':checked'),
'program': $('#programs').is(':checked'),
'writing': $('#writings').is(':checked'),
'video': $('#videos').is(':checked'),
'other': $('#other').is(':checked'),
'qualification': $('#qualifications').is(':checked'),
'showexpired': $('#expired').is(':checked'),
'award': $('#awards').is(':checked'),
};
$.post("/wp-admin/admin-ajax.php", settings, function(response) {
$('#organisations-grid').html(response);
});
}
});
</script>
</div>
function displayCompanies() {
$('#organisations-grid').html('<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">');
var settings = {
'action': 'display_companies',
'settings_nonce': $('#settings_nonce').val(),
'toplevel': $('#toplevel').is(':checked'),
'job': $('#jobs').is(':checked'),
'currentjobs': $('#currentjobs').is(':checked'),
'post': $('#posts').is(':checked'),
'website': $('#websites').is(':checked'),
'program': $('#programs').is(':checked'),
'writing': $('#writings').is(':checked'),
'audiovisual': $('#audiovisuals').is(':checked'),
'other': $('#other').is(':checked'),
'qualification': $('#qualifications').is(':checked'),
'showexpired': $('#expired').is(':checked'),
'award': $('#awards').is(':checked'),
'appearance': $('#appearances').is(':checked'),
};
$.post("/wp-admin/admin-ajax.php", settings, function(response) {
$('#organisations-grid').html(response);
});
}
});
</script>
<?php // phpcs:disable ?>
</main>
<?php get_footer(); ?>

View File

@ -1,112 +0,0 @@
<?php
/**
* The template for displaying archive pages.
*
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<?php get_header(); ?>
<?php $loop = new WP_Query( $args ); ?>
<header class="entry-content tile location-block">
<div class="post-header-title">
<h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">by location</h2>
<?php while (have_posts()) : the_post(); ?>
<div class="entry-content" id="taxonomy-description">
<?php the_content() ?>
<div>
<a class="hyperlink-button" href="?view=countries">Countries</a>
<!--<a class="hyperlink-button" href="?view=regions">Regions</a>-->
<a class="hyperlink-button" href="?view=locations">Locations</a>
</div>
</div>
<?php endwhile; ?>
</div>
</header>
<?php
$locations = get_terms('location', array('hide_empty' => 0));
// Gets all of the top-level location terms.
$terms = get_terms(array('taxonomy' => 'location', 'term_args' => array('parent' => 0)));
?>
<div id="primary" class="content-area">
<main id="company-main" class="site-main" role="main">
<div class="row">
<div id="map" style="height:100vh; width:100%;"></div>
</div>
<?php if (!empty($locations)): ?>
<?php if ($_GET['view'] == "countries"): ?>
<?php
$locationsSubset = array_filter($locations, function ($t) {
return $t->parent != 0 && get_term($t->parent, 'location')->parent == 0;
});
?>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['geochart']});
google.charts.setOnLoadCallback(drawMap);
function drawMap() {
var data = google.visualization.arrayToDataTable([
['Country'],
<?php foreach ((array)$locationsSubset as $term): ?>
['<?php echo $term->description ?>'],
<?php endforeach; ?>
]);
var options = {};
var chart = new google.visualization.GeoChart(document.getElementById('map'));
chart.draw(data, options);
}
</script>
<?php elseif ($_GET['view'] == "locations"): ?>
<?php
$locationsSubset = array_filter($locations, function ($t) {
return $t->parent != 0 && get_term($t->parent, 'location')->parent != 0 && get_term(get_term($t->parent, 'location')->parent, 'location')->parent != 0 && get_term(get_term(get_term($t->parent, 'location')->parent, 'location')->parent, 'location')->parent == 0;
});
?>
<script type="text/javascript">
var locations = [
<?php foreach((array)$locationsSubset as $term): ?>
{<?php echo $term->description ?>},
<?php endforeach; ?>
]
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: {lat: 51.483462, lng: 0.0586198}
});
// Create an array of alphabetical characters used to label the markers.
var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// Add some markers to the map.
// Note: The code uses the JavaScript Array.prototype.map() method to
// create an array of markers based on a given "locations" array.
// The map() method here has nothing to do with the Google Maps API.
var markers = locations.map(function(location, i) {
return new google.maps.Marker({
position: location,
label: labels[i % labels.length]
});
});
// Add a marker clusterer to manage the markers.
var markerCluster = new MarkerClusterer(map, markers, {
imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'
});
}
</script>
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsMPnuCM59sC_n11CGxbpbqNY7FRUXnD0&callback=initMap"></script>
<?php endif; ?>
<?php endif; ?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php get_footer(); ?>

View File

@ -0,0 +1,157 @@
<?php
/**
* Template Name: Experience Timeline
*
* The template for displaying all roles in a timeline.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
get_header(); ?>
<?php
/**
* Calculates wether a role is within the max. and min. dates
* for the timeline.
*
* @param string $role_start_date The role's start date.
* @param string $role_end_date The role's end date.
* @return bool
*/
function within_dates( $role_start_date, $role_end_date ) {
$end_year = gmdate( 'Y' );
$end_date = $end_year . '-12-31';
$start_date = ( $end_year - 2 ) . '-01-01';
$role_end_date = ( ! $role_end_date ) ? gmdate( 'Y-m-d' ) : ( ( $role_end_date > $end_date ) ? $end_date : $role_end_date );
return ( ( ( strtotime( $role_start_date ) < strtotime( $end_date ) ) && ( strtotime( $role_start_date ) > strtotime( $start_date ) ) ) && ( strtotime( $role_end_date ) > strtotime( $start_date ) ) );
}
$args = array(
'post_type' => array(
'job',
),
'posts_per_page' => -1,
);
$loop = new WP_Query( $args );
?>
<main id="experience-wrapper" class="content-area col-10 col-m-12">
<header class="post-header-title">
<h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">or, a brief history of Ben</h2>
<?php
while ( have_posts() ) :
the_post();
?>
<div class="entry-content tile" id="taxonomy-description">
<?php the_content(); ?>
</div>
<div class="entry-content tile" id="settings">
<h3 style="margin-bottom: 14px;" class="subheading">Settings</h3>
<form action="/experience-timeline" id="settings" method="GET">
<input class="checkbox" type="checkbox" id="separate" value="separate" checked="checked">
<label for="separate">Separate past and current roles</label>
<input class="ui-button ui-widget ui-corner-all" id="refresh" type="submit" value="Refresh">
</form>
</div>
<?php endwhile; ?>
</header>
<div id="primary" class="content-area">
<main id="company-main" class="site-main" role="main">
<?php // phpcs:disable WordPress.WP.EnqueuedResources ?>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('input:checkbox').checkboxradio();
$('.refresh').button();
google.charts.load('current', {'packages':['timeline']});
google.charts.setOnLoadCallback(drawChart);
$('input[type="checkbox"]').change(function() {
alert("Feature in progress");
$('#refresh').css('border-width', '5px');
});
$('#refresh').click(function(event) {
$(this).css('border-width', '1px');
event.preventDefault();
drawChart();
});
});
function drawChart() {
var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Type' });
dataTable.addColumn({ type: 'string', id: 'Role' });
dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true} });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
<?php
while ( $loop->have_posts() ) :
$loop->the_post();
?>
<?php
$end_date = get_post_meta( get_the_ID(), 'end-date', true );
$is_current = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? true : false;
$company = wp_get_object_terms(
get_the_ID(),
'company',
array(
'fields' => 'names',
)
);
$role_title = htmlspecialchars_decode( wp_strip_all_tags( get_the_title() ) );
$start = get_the_date();
$end = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? gmdate( 'Y-m-d' ) : $end_date;
?>
[
'<?php echo ( $is_current ) ? 'Current' : 'Past'; ?>',
'<?php echo esc_html( $role_title . ', ' . html_entity_decode( $company[0] ) ); ?>',
'<div style="padding: 20px"><h1 class="timeline-entry-title"><?php echo wp_kses_post( $role_title ); ?></h1><h2><?php echo wp_kses_post( html_entity_decode( $company[0] ) ); ?></h2><ul><li><?php echo esc_html( $start ); ?>&mdash;<?php echo esc_html( ( $is_current ) ? 'present' : $end ); ?></li></ul></div>',
new Date('<?php echo esc_attr( $start ); ?>'),
new Date('<?php echo esc_attr( $end ); ?>')
],
<?php endwhile; ?>
]);
var rowHeight = 15;
var chartHeight = (dataTable.getNumberOfRows() * rowHeight) + 50;
var options = {
tooltip: {isHtml: true},
timeline: {
showRowLabels: true,
},
height: chartHeight,
width: window.innerWidth - 200,
};
chart.draw(dataTable, options);
}
</script>
<?php // phpcs:disable ?>
<div id="slider-range"></div>
<section id="timeline">
<div class="row">
<div id="timeline" class="col-12">
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
</div>
</div>
</section>
</main>
</div>
</main>
<?php // get_sidebar(); ?>
<?php get_footer(); ?>

View File

@ -1,32 +1,32 @@
<?php
/**
* The template for displaying pages.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template for displaying pages.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<?php get_header(); ?>
<main id="split-page" role="main">
<?php
// Start the loop.
while (have_posts()):
the_post();
// Include the page content template.
get_template_part('template-parts/content', 'page');
<?php
// Start the loop.
while ( have_posts() ) :
the_post();
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
// Include the page content template.
get_template_part( 'template-parts/content', 'page' );
// End of the loop.
endwhile;
?>
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
// End of the loop.
endwhile;
?>
</main>
<?php get_footer(); ?>

34
phpcs.xml Normal file
View File

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>Wordpress Coding Standards</description>
<!-- Scan all files in directory -->
<file>.</file>
<!-- Exclude `plugins/` directory -->
<exclude-pattern>*/plugins/*</exclude-pattern>
<!-- Scan only PHP files -->
<arg name="extensions" value="php"/>
<!-- Show colors in console -->
<arg value="-colors"/>
<!-- Show sniff codes in all reports -->
<arg value="ns"/>
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra">
<!-- Exclude any rules here -->
<exclude name="WordPress.PHP.DisallowShortTernary"/>
</rule>
<!-- Let's also check that everything is properly documented. -->
<rule ref="WordPress-Docs"/>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<config name="minimum_supported_wp_version" value="4.9"/>
</ruleset>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 KiB

After

Width:  |  Height:  |  Size: 921 KiB

View File

@ -1,26 +1,26 @@
<?php
/**
* The template for the sidebar.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template for the sidebar.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<nav class="col-2" id="sidebar">
<ul id="sidebar-list">
<li <?php echo $wp->request == 'blog' ? 'class="current"' : ''; ?>>
<a href="/blog">Blog</a>
<a href="/feed"><i class="fa fa-rss"></i></a>
</li>
<li><p>~</p></li>
<li <?php echo $wp->request == 'website' ? 'class="current"' : ''; ?>><a href="/website">Websites</a></li>
<li <?php echo $wp->request == 'program' ? 'class="current"' : ''; ?>><a href="/program">Programs</a></li>
<li <?php echo $wp->request == 'writing' ? 'class="current"' : ''; ?>><a href="/writing">Writings</a></li>
<li <?php echo $wp->request == 'video' ? 'class="current"' : ''; ?>><a href="/video">Videos</a></li>
<li <?php echo $wp->request == 'other' ? 'class="current"' : ''; ?>><a href="/other">Other</a></li>
<li><p>~</p></li>
<li <?php echo $wp->request == 'experience' ? 'class="current"' : ''; ?>><a href="/experience">Experience (by organisation)</a></li>
</ul>
<ul id="sidebar-list">
<li <?php echo 'blog' === $wp->request ? 'class="current"' : ''; ?>>
<a href="/blog">Blog</a>
<a href="/feed"><i class="fa fa-rss"></i></a>
</li>
<li><p>~</p></li>
<li <?php echo 'website' === $wp->request ? 'class="current"' : ''; ?>><a href="/website">Websites</a></li>
<li <?php echo 'program' === $wp->request ? 'class="current"' : ''; ?>><a href="/program">Programs</a></li>
<li <?php echo 'writing' === $wp->request ? 'class="current"' : ''; ?>><a href="/writing">Writings</a></li>
<li <?php echo 'video' === $wp->request ? 'class="current"' : ''; ?>><a href="/video">Videos</a></li>
<li <?php echo 'other' === $wp->request ? 'class="current"' : ''; ?>><a href="/other">Other</a></li>
<li><p>~</p></li>
<li <?php echo 'experience' === $wp->request ? 'class="current"' : ''; ?>><a href="/experience">Experience (by organisation)</a></li>
</ul>
</nav>

View File

@ -1,29 +1,30 @@
<?php
/**
* The template for displaying all single Pages.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template for displaying all single Pages.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<?php get_header(); ?>
<main id="split-page" role="main">
<?php
// Start the loop.
while (have_posts()): the_post();
// Include the single post content template.
get_template_part( 'template-parts/content', 'single' );
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
// End of the loop.
endwhile;
?>
<?php
// Start the loop.
while ( have_posts() ) :
the_post();
// Include the single post content template.
get_template_part( 'template-parts/content', 'single' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
// End of the loop.
endwhile;
?>
</main><!-- .site-main -->
<?php get_footer(); ?>

252
style.css
View File

@ -122,8 +122,15 @@ html {
"header header header"
". page-container ."
"footer footer footer";
border: 2px solid black;
margin: 2em;
border: 2px solid black;
}
#site-wrapper {
margin: 4em 2em 2em 2em;
}
#site-wrapper.admin-bar {
margin-top: 2em;
}
}
@ -264,11 +271,36 @@ html {
article.tile > header {
grid-area: tile-details;
grid-template-columns: 5px auto 5px;
grid-template-rows: auto auto;
grid-template-rows: 0 1.3em auto auto;
grid-template-areas:
". . ."
". banner ."
". tile-title ."
". tile-subtitle .";
}
article.tile > header > .status-banner,
article.tile > header > .source-banner {
padding: 0.3em 1em;
grid-area: banner;
width: auto;
margin-left: auto;
margin-right: auto;
border-radius: 0px 0px 10px 10px;
text-align: center;
text-decoration: none !important;
}
article.tile > header > .source-banner {
background-color: #ebebeb;
}
article.tile > header > .status-banner--ongoing {
background-color: #cfea6b;
}
article.tile > header > .status-banner--on-hold {
background-color: #e8963e;
}
article.tile > header > .status-banner--cancelled {
background-color: #a54a4a;
}
article.tile > header > h1 {
grid-area: tile-title;
align-self: end;
@ -305,11 +337,12 @@ html {
#split-page > #wrapper {
grid-area: post;
grid-template-columns: 1fr;
grid-template-rows: 70vh auto;
grid-template-rows: 70vh auto auto;
justify-items: center;
align-items: center;
grid-template-areas:
"post-content-header"
"post-meta"
"post-content";
}
@media only screen and (min-width: 1024px) {
@ -320,7 +353,7 @@ html {
align-items: center;
grid-template-areas:
"post-content-header post-content"
" post-toc post-content"
" post-meta post-content"
" . post-content";
}
}
@ -378,25 +411,73 @@ html {
grid-area: post-date;
}
#split-page #post-toc {
grid-area: post-toc;
width: 100%;
text-align: left;
#split-page #post-meta {
grid-area: post-meta;
width: 85%;
text-align: center !important;
background-color: #DDDDD0;
margin: 1em 0;
padding-bottom: 1em;
border: 1px solid gray;
}
#split-page #post-toc > h1 {
@media only screen and (min-width: 1024px) {
#split-page #post-meta {
background-color: transparent;
width: 100%;
text-align: left !important;
margin: 0;
border: none;
}
}
#split-page #post-meta > h1 {
border-bottom: 2px inset var(--dark);
margin-top: 0.5em;
margin-bottom: 0.5em;
line-height: 1.2em;
text-align: center;
}
#split-page #post-toc > ol > li {
#split-page #post-meta h2 {
margin-top: 0.5em;
font-size: 1.4em;
margin-bottom: 0.5em;
line-height: 1.2em;
}
#split-page #post-meta > #post-contents > ol > li {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
#split-page #post-meta > #post-tags ul {
width: auto;
margin: auto;
list-style: none;
}
#split-page #post-meta > #post-tags li {
float: left;
}
#split-page #post-meta > #post-tags li:not(:first-of-type) {
margin-left: 1.5em;
}
@media only screen and (min-width: 1024px) {
#split-page #post-meta > #post-tags ul {
margin: none;
width: 100%;
list-style: circle;
}
#split-page #post-meta > #post-tags li {
float: none;
margin-top: 0.2em;
margin-left: 1em !important;
}
}
#split-page > #wrapper > .body {
grid-area: post-content;
display: block;
@ -418,6 +499,10 @@ html {
"quals-and-awards";
}
#organisation-body > section {
align-items: start;
}
#organisation-body > #description {
grid-area: description;
}
@ -500,6 +585,10 @@ html {
#organisation-body > .org-items .index .item:nth-child(4) {
grid-area: item4;
}
#organisation-body div.org_items {
align-items: self;
}
#split-page > #comments {
grid-area: comments;
@ -533,6 +622,7 @@ html {
justify-items: center;
align-items: start;
text-align: center;
padding-bottom: 1em;
}
.comment-body {
@ -592,6 +682,8 @@ html {
body > footer {
grid-area: footer;
margin-top: 1em;
margin-bottom: 1em;
}
}
@ -722,7 +814,7 @@ pre {
padding-left: 1em;
border-left: 2px outset var(--dark);
display: inline-block;
width: 85%;
max-width: 85%;
}
pre {
overflow: hidden;
@ -735,10 +827,8 @@ pre {
}
blockquote footer {
text-align: right;
margin-right: 10%;
font-style: normal;
display: block;
float: right;
display: inline-block;
}
blockquote footer:before {
content: '—';
@ -749,13 +839,33 @@ q, blockquote {
q.guillemets {
quotes: "«" "»" "«" "»";
}
q:before, blockquote:not(.no-first-quote) p:first-of-type::before {
q:before, blockquote:not(.no-first-quote) > p:first-of-type::before {
content: open-quote;
}
q:after, blockquote:not(.no-last-quote) p:last-of-type::after {
q:after, blockquote:not(.no-last-quote) > p:last-of-type::after {
content: close-quote;
}
blockquote.script {
display: grid;
grid-template-columns: auto 1fr;
padding-bottom: 0.4em;
}
blockquote.script > p::before,
blockquote.script > p::after {
content: none !important;
}
blockquote.script > .script-line__character {
grid-column: 1;
margin-right: 1.25em;
}
blockquote.script > .script-line__text {
grid-column: 2;
}
i, em {
font-style: italic;
}
@ -765,19 +875,27 @@ cite.book,
cite.film,
cite.tv-show,
cite.book,
cite.podcast,
cite.album,
cite.report {
font-style: italic;
}
cite.book--bible {
font-style: inherit;
}
cite.legislation,
cite.smallcite,
cite.article,
cite.episode,
cite.video,
cite.chapter,
cite.software,
cite.campaign,
cite.song,
cite.speech,
cite.course,
cite.presentation {
font-style: normal;
}
@ -787,7 +905,10 @@ cite.episode:before,
cite.video:before,
cite.chapter:before,
cite.song:before,
cite.poem:before,
cite.campaign:before,
cite.speech:before,
cite.course:before,
cite.presentation:before {
content: '“';
}
@ -797,7 +918,10 @@ cite.episode:after,
cite.video:after,
cite.chapter:after,
cite.song:after,
cite.poem:after,
cite.campaign:after,
cite.speech:after,
cite.course:after,
cite.presentation:after {
content: '”';
}
@ -974,6 +1098,10 @@ body > header h1 {
}
}
#timeline h1.timeline-entry-title {
font-size: 1.2em;
}
#comments-list-title, #comments-reply-title {
font-size: 1.6em;
margin-bottom: 0.5em;
@ -1067,10 +1195,11 @@ main#split-page > #wrapper > .body {
text-align: left;
padding: 0 2em 2em 2em;
}
main#split-page > #wrapper > .body blockquote:first-of-type:not(.no-first-blockquote) {
main#split-page > #wrapper:not(.quotes) > .body blockquote:first-of-type:not(.no-first-blockquote) {
font-size: 1.2em;
text-align: center;
margin: 0;
display: block;
margin: 0 auto;
border-left: 0;
padding-left: 0;
width: 100%;
@ -1116,10 +1245,30 @@ article.tile > header > h2 {
font-size: 0.8em;
}
a[href*="//"]:not([href*="bengoldsworthy.net"]):after {
content: url('/wp-content/uploads/Icon_External_Link.png');
margin: 0 0 0 4px;
filter: invert(0%) sepia(0%) saturate(15%) hue-rotate(246deg) brightness(104%) contrast(98%);
}
a[href*="//"].item:not([href*="bengoldsworthy.net"]):after {
position: relative;
top: -1em;
float: right;
}
a[href="#"],
a[href=""] {
color: red;
}
a {
opacity: 0.8;
text-decoration: underline !important;
}
a.item {
text-decoration: none !important;
}
.footnote_plugin_index a {
text-decoration: none !important;
}
@ -1146,14 +1295,35 @@ a:hover, a:focus {
/* TEMP */
.gallery {
float: left;
width: 100%;
display: block;
margin: 1em 0.5em;
}
.gallery .gallery-item {
float: left;
margin: 0.25em;
}
#experience-wrapper {
grid-area: page-container;
width: 100%;
}
.entry-content.tile#settings {
width: 70%;
margin: auto;
margin-top: 1em;
border: 2px dashed #020202;
padding: 1em;
border-radius: 25px;
margin-bottom: 1em;
}
#organisations-grid {
border-spacing: 1em;
margin-top: 1em;
margin-bottom: 1em;
border-radius: 10px;
}
@ -1243,7 +1413,8 @@ a:hover, a:focus {
#timeline {
display: block;
margin: auto;
min-height: 200px;
min-height: 95px;
max-width: 950%;
}
.loading {
@ -1316,6 +1487,7 @@ a:hover, a:focus {
#split-page > #wrapper > .body {
grid-area: post-content;
display: block;
align-self: start;
}
#split-page > #wrapper > .body > figure {
@ -1327,6 +1499,7 @@ a:hover, a:focus {
#split-page > #wrapper > .body > figure > figcaption {
font-size: 0.8em;
font-style: italic;
margin-top: 0.4em;
}
#split-page > #wrapper > .body img,
@ -1368,3 +1541,38 @@ table:not(.footnote-reference-container) td {
padding: 0.5em 1em;
text-align: left;
}
details {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 50%;
text-align: left;
border: none;
outline: none;
transition: 0.4s;
margin-bottom: 0.5em;
}
details[open] {
background-color: #ccc;
}
/* Style the accordion panel. Note: hidden by default */
details p:first-child {
padding-top: 1em;
}
details p {
line-height: 1em;
}
summary {
font-size: 1.1em;
font-weight: bold;
}
#list-page ul {
width: 100%;
}

View File

@ -1,243 +1,324 @@
<?php
/**
* The template for showing experience (by organisation).
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template for showing items indexed by organisation.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<?php get_header(); ?>
<?php
// Gets all of the roles attached to the given organisation.
$company = get_queried_object();
echo "<!-- ".$company->name."-->";
$args= array(
'post_type' => array( 'job' ),
'tax_query' => array(
array(
'taxonomy' => 'company',
'field' => 'slug',
'terms' => $company->slug,
),
),
'posts_per_page' => -1
);
$loop = new WP_Query( $args );
?>
// Gets all of the roles attached to the given organisation.
$company = get_queried_object();
echo '<!-- ' . wp_kses_post( $company->name ) . '-->';
// phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_tax_query
$args = array(
'post_type' => array( 'job' ),
'tax_query' => array(
array(
'taxonomy' => 'company',
'field' => 'slug',
'terms' => $company->slug,
),
),
'posts_per_page' => -1,
);
// phpcs:enable
$loop = new WP_Query( $args );
?>
<?php // phpcs:disable WordPress.WP.EnqueuedResources ?>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['timeline']});
<?php if ($loop->have_posts()): ?>
google.charts.setOnLoadCallback(drawChart);
<?php endif; ?>
function drawChart() {
var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Type' });
dataTable.addColumn({ type: 'string', id: 'Job Title' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
<?php while ($loop->have_posts()): $loop->the_post();
// Gets all of the roles associated with this organisation and its
// child organisations.
$companies = wp_get_object_terms(get_the_ID(), 'company');
$i = 0;
$currSizeOf = -1;
foreach ($companies as $company) {
if (sizeof(get_ancestors($company->term_id, 'company')) > $currSizeOf) {
$currSizeOf = sizeof(get_ancestors($company->term_id, 'company'));
$lowestDepthCompany = $i++;
}
}
google.charts.load('current', {'packages':['timeline']});
$title = html_entity_decode(get_the_title());
$start = get_the_date();
$end = (!get_post_meta(get_the_ID(), 'end-date', true)) ? date('D M d Y H:i:s O') : get_post_meta(get_the_ID(), 'end-date', true);
echo "[ '".html_entity_decode($companies[$lowestDepthCompany]->name)."', '$title', new Date('$start'), new Date('$end') ],\n";
endwhile; ?>
]);
// Draws the table, then resizes the element height and re-draws it
// to avoid needing to scroll vertically.
chart.draw(dataTable);
var realheight = parseInt(jQuery("#timeline div:first-child div:first-child div:first-child div svg").attr("height"))+70;
var options = {};
options.height = realheight;
chart.draw(dataTable, options);
}
<?php if ( $loop->have_posts() ) : ?>
google.charts.setOnLoadCallback(drawChart);
<?php endif; ?>
function drawChart() {
var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Type' });
dataTable.addColumn({ type: 'string', id: 'Job Title' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
<?php
while ( $loop->have_posts() ) :
$loop->the_post();
// Gets all of the roles associated with this organisation and its
// child organisations.
$companies = wp_get_object_terms( get_the_ID(), 'company' );
$i = 0;
$curr_size_of = -1;
foreach ( $companies as $company ) {
if ( count( get_ancestors( $company->term_id, 'company' ) ) > $curr_size_of ) {
$curr_size_of = count( get_ancestors( $company->term_id, 'company' ) );
$lowest_depth_company = $i++;
}
}
$end_date = get_post_meta( get_the_ID(), 'end-date', true );
$item_title = htmlspecialchars_decode( wp_strip_all_tags( get_the_title() ) );
$start = get_the_date();
$end = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? gmdate( 'Y-m-d' ) : $end_date;
echo wp_kses_post( "[ '" . html_entity_decode( $companies[ $lowest_depth_company ]->name ) . "', '$item_title', new Date('$start'), new Date('$end') ],\n" );
endwhile;
?>
]);
// Draws the table, then resizes the element height and re-draws it
// to avoid needing to scroll vertically.
var rowHeight = 45;
var chartHeight = (dataTable.getDistinctValues(0).length * rowHeight) + 50;
var options = {
tooltip: {isHtml: true},
timeline: {
showRowLabels: true,
},
height: chartHeight,
width: '100%',
};
chart.draw(dataTable, options);
}
</script>
<?php // phpcs:enable ?>
<main id="split-page" role="main">
<?php
$companyLogo = apply_filters('taxonomy-images-queried-term-image-url', '', array('image_size' => 'full'));
$companyName = get_queried_object()->name;
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
$company_logo = apply_filters( 'taxonomy-images-queried-term-image-url', '', array( 'image_size' => 'full' ) );
// phpcs:enable
$company_name = get_queried_object()->name;
?>
<div id="wrapper">
<header style="background-image: url('<?php echo $companyLogo ?>'); background-color: <?php echo get_term_meta(get_queried_object()->term_id, 'color')[0] ?>; background-size: contain;">
<div>
<?php
if (strlen($companyName) > 70) $small= "2em";
elseif (strlen($companyName) > 35) $small = "3em";
elseif (strlen($companyName) > 12) $small = "4em";
else $small = "5em"
?>
<h1 id="post-title" style="font-size: <?php echo $small ?>;"><?php echo $companyName; ?></h1>
</div>
</header><!-- .entry-header -->
<main id="organisation-body" class="body">
<section id="description">
<?php the_archive_description(); ?>
</section>
<?php if ($loop->have_posts()): ?>
<section id="timeline">
<div class="row">
<div id="timeline" class="col-12">
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
</div>
</div>
</section>
<?php endif; ?>
<section id="related" class="row">
<div id="parents" class="col-6 col-m-12">
<?php
if (get_queried_object()->parent != 0) {
$parents = apply_filters("taxonomy-images-get-terms", "",
array(
'having_images' => false,
'taxonomy' => 'company',
'term_args' => array(
'include' => get_term_by('id', get_queried_object()->parent, 'company')->term_id
)
)
);
}
if (count($parents) > 0): ?>
<h2 class="subheading">Parent</h2>
<ul class="index">
<?php foreach ((array) $parents as $parent):
$imgURL = wp_get_attachment_image_src($parent->image_id)[0];
$colour = get_term_meta($parent->term_id, 'color', true);
$colour = ($colour != "") ? $colour : "transparent"; ?>
<li><a href="<?php echo esc_url(get_term_link($parent, $parent->taxonomy)) ?>"><?php echo get_term($parent->term_id, 'company')->name ?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<div id="children" class="col-6 col-m-12">
<?php
$children = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company', 'term_args' => array('parent' => get_queried_object()->term_id)));
if (count($children) > 0): ?>
<h2 class="subheading">Child<?php echo (count($children) != 1) ? "ren" : ""; ?></h2>
<ul class="index">
<?php foreach ( (array) $children as $child ):
$imgURL = wp_get_attachment_image_src($child->image_id, 'detail')[0];
$colour = get_term_meta($child->term_id, 'color', true);
$colour = ($colour != "") ? $colour : "transparent"; ?>
<div id="wrapper">
<header style="background-image: url('<?php echo esc_url( $company_logo ); ?>'); background-color: <?php echo esc_attr( get_term_meta( get_queried_object()->term_id, 'color' )[0] ); ?>; background-size: contain;">
<div>
<?php
if ( strlen( $company_name ) > 70 ) {
$small = '2em';
} elseif ( strlen( $company_name ) > 35 ) {
$small = '3em';
} elseif ( strlen( $company_name ) > 12 ) {
$small = '4em';
} else {
$small = '5em';
}
?>
<h1 id="post-title" style="font-size: <?php echo esc_attr( $small ); ?>;"><?php echo wp_kses_post( $company_name ); ?></h1>
</div>
</header><!-- .entry-header -->
<li><a href="<?php echo esc_url(get_term_link($child, $child->taxonomy)) ?>"><?php echo get_term($child->term_id, 'company')->name ?></a></li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<p>No children.</p>
<?php endif; ?>
</div>
</section>
<main id="organisation-body" class="body">
<section id="description">
<?php the_archive_description(); ?>
</section>
<?php if ( $loop->have_posts() ) : ?>
<section id="timeline">
<div id="timeline" class="col-12">
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
</div>
</section>
<?php endif; ?>
<section id="related" class="row">
<div id="parents" class="col-6 col-m-12">
<?php
if ( get_queried_object()->parent !== 0 ) {
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
$parents = apply_filters(
'taxonomy-images-get-terms',
'',
array(
'having_images' => false,
'taxonomy' => 'company',
'term_args' => array(
'include' => get_term_by( 'id', get_queried_object()->parent, 'company' )->term_id,
),
)
);
// phpcs:enable
}
if ( count( $parents ) > 0 ) :
?>
<h2 class="subheading">Parent</h2>
<ul class="index">
<?php
foreach ( (array) $parents as $parent ) :
// Filter out parents with only private roles associated.
$parent_args = array(
'posts_per_page' => - 1,
'post_type' => 'job',
'tax_query' => array(
array(
'taxonomy' => 'company',
'field' => 'slug',
'terms' => get_term( $parent->term_id, 'company' )->slug,
'include_children' => 1,
),
),
);
$parent_jobs = new WP_Query( $parent_args );
if ( $parent_jobs->have_posts() ) :
$img_url = wp_get_attachment_image_src( $parent->image_id )[0];
$colour = get_term_meta( $parent->term_id, 'color', true );
$colour = ( '' !== $colour ) ? $colour : 'transparent';
?>
<li><a href="<?php echo esc_url( get_term_link( $parent, $parent->taxonomy ) ); ?>"><?php echo wp_kses_post( get_term( $parent->term_id, 'company' )->name ); ?></a></li>
<?php
endif;
endforeach;
?>
</ul>
<?php endif; ?>
</div>
<div id="children" class="col-6 col-m-12">
<?php
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
$children = apply_filters(
'taxonomy-images-get-terms',
'',
array(
'having_images' => false,
'taxonomy' => 'company',
'term_args' => array( 'parent' => get_queried_object()->term_id ),
)
);
// phpcs:enable
if ( count( $children ) > 0 ) :
?>
<h2 class="subheading">Child<?php echo ( count( $children ) !== 1 ) ? 'ren' : ''; ?></h2>
<ul class="index">
<?php
foreach ( (array) $children as $child ) :
// Filter out children with only private roles associated.
$child_args = array(
'posts_per_page' => - 1,
'post_type' => 'job',
'tax_query' => array(
array(
'taxonomy' => 'company',
'field' => 'slug',
'terms' => get_term( $child->term_id, 'company' )->slug,
'include_children' => 1,
),
),
);
$child_jobs = new WP_Query( $child_args );
if ( $child_jobs->have_posts() ) :
$img_url = wp_get_attachment_image_src( $child->image_id, 'detail' )[0];
$colour = get_term_meta( $child->term_id, 'color', true );
$colour = ( '' !== $colour ) ? $colour : 'transparent';
?>
<li><a href="<?php echo esc_url( get_term_link( $child, $child->taxonomy ) ); ?>"><?php echo wp_kses_post( get_term( $child->term_id, 'company' )->name ); ?></a></li>
<?php
endif;
endforeach;
?>
</ul>
<?php else : ?>
<p>No children.</p>
<?php endif; ?>
</div>
</section>
<?php
$pageOrder = array( 'post', 'website', 'program', 'writing', 'video', 'other');
foreach ($pageOrder as $currSec) {
$args['post_type'] = array( $currSec );
$i = 0;
$loop = new WP_Query( $args );
if ( $loop->have_posts() ):
echo '<section id="'.$currSec.'" class="org-items row">';
echo '<h2 class="subheading">'.ucwords($currSec).'s <a href="/'.($currSec != "post" ? $currSec : "blog").'?company='.get_queried_object()->slug.'">View all '.$loop->post_count.'</a></h2>';
echo '<div class="index">';
while (($loop->have_posts()) && ($i++ < 4)) : $loop->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
echo '</div>';
echo '</section>';
endif;
}
echo '<section id="quals-and-awards">';
echo '<div id="qualifications" class="org-items row">';
$args['post_type'] = 'qualification';
$loop = new WP_Query( $args );
echo '<h2 class="subheading">Qualifications</h2>';
if ( $loop->have_posts() ):
echo '<ul class="index">';
while ($loop->have_posts()) : $loop->the_post();
$url = esc_url(get_permalink());
echo '<li><a href="'.$url.'">'.get_the_title().'</a></li>';
endwhile;
echo '</ul>';
else:
echo '<p>No qualifications.</p>';
endif;
echo '</div>';
echo '<div id="awards" class="org-items row">';
$args['post_type'] = 'award';
$loop = new WP_Query( $args );
echo '<h2 class="subheading">Awards</h2>';
if ( $loop->have_posts() ):
echo '<ul class="index">';
while ($loop->have_posts()) : $loop->the_post();
$url = esc_url(get_permalink());
echo '<li><a href="'.$url.'">'.get_the_title().'</a></li>';
endwhile;
echo '</ul>';
else:
echo '<p>No awards.</p>';
endif;
echo '</div>';
echo '</section>';
$args['post_type'] = 'appearance';
$loop = new WP_Query( $args );
if ( $loop->have_posts() ):
echo '<section id="appearances" class="org-items row">';
echo '<h2 class="subheading">Appearances <a href="/appearance?company='.get_queried_object()->slug.'">View all '.$loop->post_count.'</a></h2>';
echo '<div class="index">';
while (($loop->have_posts())) : $loop->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
echo '</div>';
echo '</section>';
endif;
$args['post_type'] = 'correspondence';
$loop = new WP_Query( $args );
if ( $loop->have_posts() ):
echo '<section id="correspondence" class="org-items row">';
echo '<h2 class="subheading">Correspondence <a href="/correspondence?company='.get_queried_object()->slug.'">View all '.$loop->post_count.'</a></h2>';
echo '<div class="index">';
while (($loop->have_posts())) : $loop->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
echo '</div>';
echo '</section>';
endif;
?>
</main>
</div>
$page_order = array( 'post', 'website', 'program', 'writing', 'audiovisual', 'other' );
foreach ( $page_order as $current_section ) {
$args['post_type'] = array( $current_section );
$i = 0;
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) :
echo '<section id="' . esc_attr( $current_section ) . '" class="org-items row">';
echo '<h2 class="subheading">' . wp_kses_post( ucwords( $current_section ) ) . 's <a href="/' . esc_attr( ( 'post' !== $current_section ? $current_section : 'blog' ) ) . '?company=' . esc_attr( get_queried_object()->slug ) . '">View all ' . esc_html( $loop->post_count ) . '</a></h2>';
echo '<div class="index">';
while ( ( $loop->have_posts() ) && ( $i++ < 4 ) ) :
$loop->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
echo '</div>';
echo '</section>';
endif;
}
echo '<section id="quals-and-awards">';
echo '<div id="qualifications" class="org-items row">';
$args['post_type'] = 'qualification';
$loop = new WP_Query( $args );
echo '<h2 class="subheading">Qualifications</h2>';
if ( $loop->have_posts() ) :
echo '<ul class="index">';
while ( $loop->have_posts() ) :
$loop->the_post();
$url = get_permalink();
echo '<li><a href="' . esc_url( $url ) . '">' . wp_kses_post( get_the_title() ) . '</a></li>';
endwhile;
echo '</ul>';
else :
echo '<p>No qualifications.</p>';
endif;
echo '</div>';
echo '<div id="awards" class="org-items row">';
$args['post_type'] = 'award';
$loop = new WP_Query( $args );
echo '<h2 class="subheading">Awards</h2>';
if ( $loop->have_posts() ) :
echo '<ul class="index">';
while ( $loop->have_posts() ) :
$loop->the_post();
$url = esc_url( get_permalink() );
echo '<li><a href="' . esc_url( $url ) . '">' . wp_kses_post( get_the_title() ) . '</a></li>';
endwhile;
echo '</ul>';
else :
echo '<p>No awards.</p>';
endif;
echo '</div>';
echo '</section>';
$args['post_type'] = 'appearance';
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) :
echo '<section id="appearances" class="org-items row">';
echo '<h2 class="subheading">Appearances <a href="/appearance?company=' . esc_attr( get_queried_object()->slug ) . '">View all ' . esc_html( $loop->post_count ) . '</a></h2>';
echo '<div class="index">';
while ( ( $loop->have_posts() ) ) :
$loop->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
echo '</div>';
echo '</section>';
endif;
$args['post_type'] = 'correspondence';
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) :
echo '<section id="correspondence" class="org-items row">';
echo '<h2 class="subheading">Correspondence <a href="/correspondence?company=' . esc_attr( get_queried_object()->slug ) . '">View all ' . esc_html( $loop->post_count ) . '</a></h2>';
echo '<div class="index">';
while ( ( $loop->have_posts() ) ) :
$loop->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
echo '</div>';
echo '</section>';
endif;
?>
</main>
</div>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,23 @@
<?php
/**
* The template part for displaying lists of simple items.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<li id="<?php echo esc_attr( get_the_ID() ); ?>" <?php post_class(); ?>>
<a class="item" href="<?php echo esc_url( get_the_permalink() ); ?>">
<?php echo wp_kses_post( get_the_title() ); ?>
<?php
$subtitle = get_post_meta( get_the_ID(), 'Subtitle', true );
if ( $subtitle ) :
?>
: <?php echo wp_kses_post( $subtitle ); ?>
<?php
endif;
?>
</a>
</li>

View File

@ -1,33 +1,30 @@
<?php
/**
* The template part for displaying a message that posts cannot be found.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template part for displaying a message that posts cannot be found.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Nothing Found', 'twentysixteen' ); ?></h1>
</header><!-- .page-header -->
<header class="page-header">
<h1 class="page-title">Nothing Found</h1>
</header><!-- .page-header -->
<div class="page-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<div class="page-content">
<?php if ( is_search() ) : ?>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentysixteen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentysixteen' ); ?></p>
<?php get_search_form(); ?>
<?php elseif ( is_search() ) : ?>
<?php else : ?>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentysixteen' ); ?></p>
<?php get_search_form(); ?>
<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentysixteen' ); ?></p>
<?php get_search_form(); ?>
<?php else : ?>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentysixteen' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
</div><!-- .page-content -->
<?php endif; ?>
</div><!-- .page-content -->
</section><!-- .no-results -->

View File

@ -1,30 +1,34 @@
<?php
/**
* The template used for displaying page content.
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
/**
* The template used for displaying page content.
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
?>
<article id="wrapper" <?php post_class(); ?>>
<header style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<div>
<h1 id="post-title"><?php echo get_the_title(); ?></h1>
<?php if ($subtitle = get_post_meta(get_the_ID(), 'Subtitle', true)): ?>
<h2 id="post-subtitle"><?php echo $subtitle ?></h2>
<?php endif; ?>
</div>
</header><!-- .entry-header -->
<header style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<div>
<h1 id="post-title"><?php echo esc_html( get_the_title() ); ?></h1>
<?php
$subtitle = get_post_meta( get_the_ID(), 'Subtitle', true );
if ( $subtitle ) :
?>
<h2 id="post-subtitle"><?php echo esc_html( $subtitle ); ?></h2>
<?php endif; ?>
</div>
</header><!-- .entry-header -->
<main id="page-body" class="body">
<?php
if (get_the_content()):
the_content();
else:
echo get_the_excerpt();
endif;
?>
</main><!-- .entry-content -->
<main id="page-body" class="body">
<?php
if ( get_the_content() ) :
the_content();
else :
echo esc_html( get_the_excerpt() );
endif;
?>
</main><!-- .entry-content -->
</article><!-- #post-## -->

View File

@ -1,93 +1,238 @@
<?php
/**
* The template part for displaying single Posts.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template part for displaying single Posts.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<article id="wrapper" <?php post_class(); ?>>
<header style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<div>
<h1 id="post-title"><?php echo get_the_title(); ?></h1>
<?php if ($subtitle = get_post_meta(get_the_ID(), 'Subtitle', true)): ?>
<h2 id="post-subtitle"><?php echo $subtitle ?></h2>
<?php endif; ?>
<?php //the_date('F j\<\s\u\p\>S\<\/\s\u\p\>, 1,Y \H\.\E\.', '<h3>', '</h3>'); ?>
</div>
</header><!-- .entry-header -->
<header style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<div>
<h1 id="post-title">
<?php echo wp_kses_post( get_the_title() ); ?>
</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">
<!-- 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', true ) || get_post_meta( get_the_ID(), 'License', true ) || ( $date1 < $date2 - 31557600 ) ) : ?>
<div id="details">
<ul>
<?php
if ( has_category( 'thoughts' ) ) {
$post_category = 'thought';
} elseif ( has_category( 'reports' ) ) {
$post_category = 'report';
} elseif ( has_category( 'review' ) ) {
$post_category = 'review';
}
if ( has_category( 'series' ) ) {
$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 ) );
}
}
if ( count( $series ) > 1 ) {
$category_text .= '&rsquo;';
}
$punct = ':';
foreach ( $series as $this_series ) {
$category_text .= $punct . ' ';
if ( ':' === $punct ) {
$punct = ';';
}
$category_text .= '<a href="/category/series/' . $this_series->slug . '">' . $this_series->name . '</a>';
}
$category_text .= '.';
echo '<li>';
echo wp_kses_post( "This <a href='/category/$post_category'>$post_category</a> $category_text" );
echo '</li>';
}
?>
<?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;
?>
<?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', false );
if ( $notes ) :
foreach ( $notes as $note ) :
?>
<li><?php echo wp_kses_post( $note ); ?></li>
<?php
endforeach;
endif;
?>
<?php
$license = get_post_meta( get_the_ID(), 'License', true );
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; ?>
<!-- /Post Notes -->
<?php
if ( get_the_content() ) :
the_content();
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 );
?>
<section id="post-dates">
<p><strong>Published:</strong>&nbsp;
<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>&nbsp;
<span title="<?php echo esc_html( $modified_date_gregorian ); ?>">
<?php echo wp_kses_post( $modified_date_holocene ); ?>
</span>
</p>
<?php endif; ?>
</section>
<section id="post-links">
<?php
$int_links = get_post_meta( get_the_ID(), 'Internal_Link', false );
if ( $int_links ) :
?>
<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 ) : ?>
<?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; ?>
</section>
<?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 ) ) :
?>
<li>
<a href="#section-<?php echo esc_attr( $i++ ); ?>">
<?php echo wp_kses_post( $section_title ); ?>
</a>
</li>
<?php
endwhile;
// phpcs:enable
?>
</ol>
</section>
<?php endif; ?>
<?php
$tags = get_the_tags( get_the_ID() );
if ( $tags ) :
?>
<section id="post-tags">
<h2>Tags</h2>
<ul>
<?php foreach ( $tags as $post_tag ) : ?>
<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>
<?php endforeach; ?>
</ul>
</section>
<?php endif; ?>
</footer>
<main id="post-body" class="body">
<?php $date1 = strtotime(get_the_date('Y-m-d')); ?>
<?php $date2 = strtotime(date('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
if (has_category('thoughts')) $type = "thought";
else if (has_category('reports')) $type = "report";
else if (has_category('review')) $type = "review";
if (has_category('series')) {
$catag = "is a part of the following series";
$series = [];
$s = get_category_by_slug('series');
$seriesIDs = get_term_children($s->term_id, 'category');
foreach ($seriesIDs as $thisSeriesID) {
if (has_category($thisSeriesID)) {
array_push($series, get_category($thisSeriesID));
}
}
if (count($series) > 1) $catag .= "&rsquo;";
$punct = ":";
foreach ($series as $thisSeries) {
$catag .= $punct.' ';
if ($punct == ":") $punct = ";";
$catag .= '<a href="/category/series/'.$thisSeries->slug.'">'.$thisSeries->name.'</a>';
}
$catag .= '.';
echo "<li>This <a href='/category/{$type}s'>{$type}</a> {$catag}</li>";
}
?>
<?php 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 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 if ($notes = get_post_meta(get_the_ID(), 'Note(s)', true)): ?>
<li><?php echo $notes ?></li>
<?php endif; ?>
<?php if ($license = get_post_meta(get_the_ID(), 'License', true)): ?>
<li>This work is licensed under <?php echo $license ?>. <a href="https://bengoldsworthy.uk/2018/03/copywrong/">Sorry about that</a>.</li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
<?php
if (get_the_content()):
the_content();
else:
echo get_the_excerpt();
endif;
?>
</main><!-- .entry-content -->
<footer id="post-toc">
<?php if ($content = get_post_meta(get_the_ID(), 'ToC1', true)): ?>
<h1>Contents</h1>
<ol>
<?php $i = 1; ?>
<?php while($content = get_post_meta(get_the_ID(), 'ToC'.$i, true)): ?>
<li><a href="#section-<?php echo $i++ ?>"><?php echo $content ?></a></li>
<?php endwhile; ?>
</ol>
<?php endif; ?>
</footer>
</article><!-- #post-## -->

View File

@ -1,25 +1,62 @@
<?php
/**
* The template part for displaying content.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
/**
* The template part for displaying content.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<a class="item" href="<?php echo ($link = get_post_meta(get_the_ID(), 'External_Link', true)) ? $link : get_the_permalink(); ?>" <?php echo ($link) ? 'target="_blank"' : ''; ?>>
<article id="post-<?php the_ID(); ?>" class="tile col-m-6 col-4 col-w-3" style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<?php
if (strlen(get_the_title()) > 70) $small= "vsmall";
elseif (strlen(get_the_title()) > 35) $small = "small";
elseif (strlen(get_the_title()) > 12) $small = "qsmall";
?>
<header>
<h1 class="<?php echo $small ?> post-title"><?php echo get_the_title(); ?></h1>
<?php if ($subtitle = get_post_meta(get_the_ID(), 'Subtitle', true)): ?>
<h2><?php echo $subtitle ?></h2>
<?php endif; ?>
</header>
</article><!-- #post-## -->
</a>
<?php
// For Posts with a) a single external link and b) no body content, just make
// the item link directly to the external resource.
$has_one_external_link = count( get_post_meta( get_the_ID(), 'External_Link', false ) ) === 1;
$has_body_content = ! ! get_the_content();
$links_externally = $has_one_external_link && ! $has_body_content;
$split_link = explode( ';;', get_post_meta( get_the_ID(), 'External_Link', true ) );
$link_href = ( count( $split_link ) > 1 ) ? $split_link[1] : $split_link[0];
$post_link = ( $links_externally ) ? $link_href : get_the_permalink( get_the_ID() );
?>
<a class="item" href="<?php echo esc_url( $post_link ); ?>"<?php echo ( $links_externally ) ? ' target="_blank" rel="noopener noreferrer"' : ''; ?>>
<article id="post-<?php the_ID(); ?>" class="tile col-m-6 col-4 col-w-3" style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<?php
$title_length = strlen(get_the_title());
if ( $title_length > 70 ) {
$small = 'vsmall';
} elseif ( $title_length > 35 ) {
$small = 'small';
} elseif ( $title_length > 12 ) {
$small = 'qsmall';
}
?>
<header>
<?php
$post_status = get_post_meta( get_the_ID(), 'Status', true );
if ( $post_status ) :
?>
<span class="status-banner status-banner--<?php echo esc_attr( lcfirst( $post_status ) ); ?>"><?php echo wp_kses_post( $post_status ); ?></span>
<?php endif; ?>
<?php
$source = get_post_meta( get_the_ID(), 'Source', true );
if ( $source ) :
?>
<span class="source-banner"><?php echo wp_kses_post( $source ); ?></span>
<?php endif; ?>
<h1 class="<?php echo esc_attr( $small ); ?> post-title">
<?php echo wp_kses_post( get_the_title() ); ?>
</h1>
<?php
$subtitle = get_post_meta( get_the_ID(), 'Subtitle', true );
if ( $subtitle ) :
?>
<h2>
<?php echo wp_kses_post( $subtitle ); ?>
</h2>
<?php endif; ?>
</header>
</article><!-- #post-## -->
</a>

View File

@ -1,97 +0,0 @@
<?php
/**
* The template for displaying all single posts and attachments
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
get_header();
?>
<?php
function withinDates($jSDate, $jEDate)
{
$endYear = date("Y");
$endDate = $endYear . "-12-31";
$startDate = ($endYear - 2) . "-01-01";
$jEDate = (!$jEDate) ? date('Y-m-d') : (($jEDate > $endDate) ? $endDate : $jEDate);
return (((strtotime($jSDate) < strtotime($endDate)) && (strtotime($jSDate) > strtotime($startDate))) && (strtotime($jEDate) > strtotime($startDate)));
}
$args = array(
'post_type' => array(
'job'
),
'posts_per_page' => -1
);
$loop = new WP_Query($args);
?>
<header class="post-header-title">
<h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">or, a brief history of Ben</h2>
<?php while (have_posts()): the_post(); ?>
<div class="entry-content tile" id="taxonomy-description">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
</header>
<div id="primary" class="content-area">
<main id="company-main" class="site-main" role="main">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#timeline').height($(window).height() - $('.post-header-title').height() - 50);
});
google.charts.load('current', {'packages':['timeline']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Type' });
dataTable.addColumn({ type: 'string', id: 'Role' });
dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true} });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
<?php
while ($loop->have_posts()): $loop->the_post();
?>
<?php
$isCurrent = (get_post_meta(get_the_ID(), 'end-date', true)) ? false : true;
$company = wp_get_object_terms(get_the_ID(), 'company', array(
'fields' => 'names'
));
$title = html_entity_decode(get_the_title());
$start = get_the_date();
$end = (!get_post_meta(get_the_ID(), 'end-date', true)) ? date('D M d Y H:i:s O') : get_post_meta(get_the_ID(), 'end-date', true);
?>
[
'<?php echo ($isCurrent) ? "Current" : "Current"; ?>',
'<?php echo $title . ', ' . html_entity_decode($company[0]); ?>',
'<div style="padding: 20px"><h1><?php echo $title; ?></h1><h2><?php echo html_entity_decode($company[0]); ?></h2><ul><li><?php echo $start; ?>&mdash;<?php echo ($isCurrent) ? "present" : $end; ?></li></ul></div>',
new Date('<?php echo $start; ?>'),
new Date('<?php echo $end; ?>')
],
<?php endwhile; ?>
]);
var options = {
tooltip: {isHtml: true},
timeline: {
showRowLabels: true,
},
};
chart.draw(dataTable, options);
}
</script>
<div id="slider-range"></div>
<div id="timeline"></div>
</main>
</div>
<?php //get_sidebar(); ?>
<?php get_footer(); ?>