This commit is contained in:
Ben Goldsworthy 2020-08-08 10:55:20 +01:00
parent 1ab6e5f0b0
commit 5faca190a6
13 changed files with 1070 additions and 535 deletions

View file

@ -1,2 +1,46 @@
# Omphaloskepsis
Ompahloskepsis is the current WordPress Theme for `bengoldsworthy.uk`.
Contributors: Ben Goldsworthy
Version: 1.0
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
## Abstract
Omphaloskepsis is a portfolio- and experience-centric WordPress Theme.
## Copyright
Omphaloskepsis WordPress Theme, Copyright 2016-2020 Ben Goldsworthy
Omphaloskepsis is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Omphaloskepsis Theme bundles the following third-party resources:
HTML5 Shiv v3.7.0, Copyright 2014 Alexander Farkas
Licenses: MIT/GPL2
Source: https://github.com/aFarkas/html5shiv
Genericons icon font, Copyright 2013-2015 Automattic.com
License: GNU GPL, Version 2 (or later)
Source: http://www.genericons.com
## TODO 2017-01-13
### Short-term
* Finish refactoring
..* Remove all vestiges of Twenty Sixteen
* Skills pages
### Long-term
* SOCs

View file

@ -18,7 +18,7 @@
<div id="comments" class="comments-area">
<div class="row">
<div class="col-7" id="comments-list">
<h3 id="comments-list-title">Comments</h3>
<h3 id="comments-list-title">Replies</h3>
<?php if ( have_comments() ) : ?>
<?php the_comments_navigation(); ?>

View file

@ -8,17 +8,39 @@
*/
?>
<script type="text/javascript">
// Displays and hides the top header bar on page scroll.
jQuery(document).ready(function($) {
$(window).on("scroll", function() {
var fromTop = $(window).scrollTop();
$('body > header').toggleClass("show", (fromTop > 200));
});
});
<script type="text/javascript">
// Displays and hides the top header bar on page scroll.
jQuery(document).ready(function($) {
$(window).on("scroll", function() {
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>
<?php wp_footer(); ?>
<?php wp_footer(); ?>
</body>
</body>
</html>

View file

@ -454,44 +454,46 @@ function omphaloskepsis_widget_tag_cloud_args( $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);
}
add_filter('script_loader_tag', 'clean_script_tag');
function omphaloskepsis_the_content($content) {
global $post;
if ($post->post_type == "program") {
$links = '<h2 class="subheading">Links</h2>';
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") {
$links = '<h2 class="subheading">Links</h2>';
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 '<h2 class="subheading">Summary</h2>' . $content . $links;
} elseif ($post->post_type == "writing") {
$links = '<h2 class="subheading">Links</h2>';
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 '<h2 class="subheading">Summary</h2>' . $content . $links;
} elseif ($post->post_type == "other") {
$links = '<h2 class="subheading">Links</h2>';
if ($meta = get_post_meta($post->ID, 'Link', true))
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Download</a>';
return '<h2 class="subheading">Summary</h2>' . $content . $links;
}
return $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;
}
add_filter('the_content', 'omphaloskepsis_the_content', 10);
@ -501,122 +503,163 @@ function load_dashicons_front_end() {
}
function display_companies() {
echo "<ul>";
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");
echo '<tr>';
echo '<th colspan="2">Organisation</th>';
echo '<th>Children</th>';
echo '<th>Associated Items</th>';
echo '</tr>';
// 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();
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;
}
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(!empty($terms)) {
foreach($terms as $term) {
$term_children = get_term_children($term->term_id, "company");
if ($_POST['currentjobs'] == "true" && $post_type == "job") {
$args['meta_query'] = array(
array(
'key' => 'end-date',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
// 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();
if ($_POST['showexpired'] != "true" && $post_type == "qualification") {
$args['meta_query'] = array(
array(
'key' => 'Expired',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
$posts = get_posts($args);
array_push($term_items, $posts);
array_push($term_item_counts, count($posts));
}
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['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)) {
if ($_POST['currentjobs'] == "true" && $post_type == "job") {
$args['meta_query'] = array(
array(
'key' => 'end-date',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
$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";
if ($_POST['showexpired'] != "true" && $post_type == "qualification") {
$args['meta_query'] = array(
array(
'key' => 'Expired',
'compare' => 'NOT EXISTS',
'value' => '1',
),
);
}
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>';
$posts = get_posts($args);
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>';
}
echo '</ul>';
array_push($term_items, $posts);
array_push($term_item_counts, count($posts));
}
die();
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>';
}
die();
}
add_action('wp_ajax_display_companies', 'display_companies');
add_action('wp_ajax_nopriv_display_companies', 'display_companies');

View file

@ -13,7 +13,8 @@
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php if (!is_front_page()): ?>
<?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">
@ -22,18 +23,18 @@
<?php endif; ?>
<?php wp_head(); ?>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<script>//alert("If the site looks weird, it's because I am currently in the process of redoing the CSS (giving it a new paint job, basically). Sorry about that.");</script>
</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>bengoldsworthy.uk</h1></a></div>
<div class="site-header-nav-item"><p>~ <a href="mailto:me@bengoldsworthy.uk"><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> ~</p></div>
<div class="site-header-nav-item"><a href="/portfolios">Portfolios</a></div>
<div class="site-header-nav-item"><a href="/blog">Blog</a></div>
<div class="site-header-nav-item"><a href="/experience">Experience</a></div>
<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; ?>

View file

@ -13,7 +13,7 @@
<main id="list-page" class="col-10 col-m-12" role="main">
<header>
<h1>Blog.</h1>
<h2><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>
<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' => ' ',

View file

@ -17,121 +17,120 @@ 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>
<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>
<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>
<!--Company Grid-->
<div class="row" id="companies-grid">
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
</div>
<table class="row" id="organisations-grid">
</table>
<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 companies grid.
// Populates the organisations grid.
jQuery(document).ready(function($) {
// Sets up jQueryUI elements.
$('input:checkbox').checkboxradio();
$('.controlgroup').controlgroup();
$('.refresh').button();
// Sets up jQueryUI elements.
$('input:checkbox').checkboxradio();
$('.controlgroup').controlgroup();
$('.refresh').button();
// Displays the initial companies grid.
displayCompanies();
// Displays the initial organisations grid.
displayCompanies();
$('.expired').hide();
$('.expired').hide();
$('input[type="checkbox"]').change(function() {
$('#refresh').css('border-width', '5px');
});
$('input[type="checkbox"]').change(function() {
$('#refresh').css('border-width', '5px');
});
$('#jobs').change(function() {
if($(this).is(":checked")) {
$('.currentjobs').fadeIn(100);
} else {
$('.currentjobs').fadeOut(100);
}
});
$('#jobs').change(function() {
if($(this).is(":checked")) {
$('.currentjobs').fadeIn(100);
} else {
$('.currentjobs').fadeOut(100);
}
});
$('#qualifications').change(function() {
if($(this).is(":checked")) {
$('.expired').fadeIn(100);
} else {
$('.expired').fadeOut(100);
}
});
$('#qualifications').change(function() {
if($(this).is(":checked")) {
$('.expired').fadeIn(100);
} else {
$('.expired').fadeOut(100);
}
});
$('#refresh').click(function(event) {
$(this).css('border-width', '1px');
event.preventDefault();
displayCompanies();
});
$('#refresh').click(function(event) {
$(this).css('border-width', '1px');
event.preventDefault();
displayCompanies();
});
function displayCompanies() {
$('#companies-grid').html('<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">');
function displayCompanies() {
$('#organisations-grid').html('<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">');
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'),
};
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) {
$('#companies-grid').html(response);
});
}
$.post("/wp-admin/admin-ajax.php", settings, function(response) {
$('#organisations-grid').html(response);
});
}
});
</script>
</div>

View file

@ -14,17 +14,17 @@
<?php
// Start the loop.
while (have_posts()):
the_post();
the_post();
// Include the page content template.
get_template_part('template-parts/content', 'page');
// Include the page content template.
get_template_part('template-parts/content', 'page');
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
// 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.
// End of the loop.
endwhile;
?>
</main>

579
style.css
View file

@ -3,6 +3,26 @@
--dark: #020202;
}
html {
font-size: 16px;
color: black;
}
@media all and (max-width: 800px) {
html {
font-size:14px;
}
}
@media all and (max-width: 600px) {
html {
font-size:12px;
}
}
@media all and (max-width: 400px) {
html {
font-size:10px;
}
}
/** 1. Block Elements */
/* 1.1. Flexible Grid */
@ -89,19 +109,19 @@
align-items: center;
min-height: 100vh;
grid-template-areas:
"header"
"page-container"
"footer";
"header"
"page-container"
"footer";
}
@media only screen and (min-width: 1024px) {
#site-wrapper {
grid-template-columns: 2.5% 1fr 2.5%;
grid-template-rows: auto 1fr 2.5%;
min-height: calc(100vh - 4em);
grid-template-areas:
"header header header"
". page-container ."
"footer footer footer";
grid-template-columns: 2.5% 1fr 2.5%;
grid-template-rows: auto 1fr 2.5%;
min-height: calc(100vh - 4em);
grid-template-areas:
"header header header"
". page-container ."
"footer footer footer";
border: 2px solid black;
margin: 2em;
}
@ -113,17 +133,18 @@
grid-template-columns: 1fr;
grid-template-rows: 1fr;
grid-template-areas:
"header-nav";
"header-nav";
}
#site-header > nav {
grid-area: header-nav;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 0.7fr auto;
grid-template-rows: 1fr 0.4fr 0.5fr auto;
grid-template-areas:
"header-top header-top header-top"
"header-middle header-middle header-middle"
"header-left header-center header-right";
"header-top header-top header-top"
"header-middle header-middle header-middle"
"header-bottom header-bottom header-bottom"
"header-left header-centre header-right";
}
#site-header > nav > div {
@ -136,12 +157,15 @@
grid-area: header-middle;
}
#site-header > nav > div:nth-child(3) {
grid-area: header-left;
grid-area: header-bottom;
}
#site-header > nav > div:nth-child(4) {
grid-area: header-center;
grid-area: header-left;
}
#site-header > nav > div:nth-child(5) {
grid-area: header-centre;
}
#site-header > nav > div:nth-child(6) {
grid-area: header-right;
}
@ -163,9 +187,9 @@
justify-items: center;
align-items: center;
grid-template-areas:
"list-page-header"
"list-page-grid"
"list-page-footer";
"list-page-header"
"list-page-grid"
"list-page-footer";
}
#list-page > header {
grid-area: list-page-header;
@ -224,9 +248,9 @@
grid-template-columns: 5% auto 5%;
grid-template-rows: 2.5% auto 2.5%;
grid-template-areas:
". . ."
". tile-details ."
". . .";
". . ."
". tile-details ."
". . .";
}
#list-page > section#grid article.tile:nth-child(1) { grid-area: li1; }
#list-page > section#grid article.tile:nth-child(2) { grid-area: li2; }
@ -242,8 +266,8 @@
grid-template-columns: 5px auto 5px;
grid-template-rows: auto auto;
grid-template-areas:
". tile-title ."
". tile-subtitle .";
". tile-title ."
". tile-subtitle .";
}
article.tile > header > h1 {
grid-area: tile-title;
@ -264,7 +288,7 @@
@media only screen and (min-width: 1024px) {
#split-page,
#split-page > #wrapper {
width: 100%;
width: 100%;
}
}
@ -274,8 +298,8 @@
justify-items: center;
align-items: center;
grid-template-areas:
"post"
"comments";
"post"
"comments";
}
#split-page > #wrapper {
@ -285,18 +309,19 @@
justify-items: center;
align-items: center;
grid-template-areas:
"post-content-header"
"post-content";
"post-content-header"
"post-content";
}
@media only screen and (min-width: 1024px) {
#split-page > #wrapper {
grid-template-columns: 1fr 1fr;
grid-template-rows: 70vh auto;
justify-items: center;
align-items: center;
grid-template-areas:
"post-content-header post-content"
" . post-content";
grid-template-columns: 1fr 1fr;
grid-template-rows: 70vh auto auto;
justify-items: center;
align-items: center;
grid-template-areas:
"post-content-header post-content"
" post-toc post-content"
" . post-content";
}
}
@ -305,43 +330,43 @@
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
min-height: 80vh;
min-height: 70vh;
height: 100%;
margin-bottom: 4em;
width: 100vw;
grid-template-columns: 1fr;
grid-template-rows: 1fr;
grid-template-columns: 1fr auto 1fr;
grid-template-rows: 1fr auto 1fr;
grid-template-areas:
"post-header-details";
". . ."
". post-header-details ."
". . .";
}
@media only screen and (min-width: 1024px) {
#split-page > #wrapper > header {
grid-area: post-content-header;
min-height: 180px;
height: 100%;
width: 100%;
grid-template-columns: 15% 1fr 15%;
grid-template-rows: 20% 1fr 20%;
grid-template-areas:
". . ."
". post-header-details ."
". . .";
grid-area: post-content-header;
min-height: 180px;
height: 100%;
width: 100%;
grid-template-columns: 15% 1fr 15%;
grid-template-rows: 20% 1fr 20%;
grid-template-areas:
". . ."
". post-header-details ."
". . .";
}
}
#split-page > #wrapper > header > div {
grid-area: post-header-details;
grid-template-columns: 1fr;
padding: 20px;
grid-template-rows: 1fr auto auto 1fr auto 1fr;
grid-template-rows: 1fr auto auto 1fr;
justify-items: center;
align-items: center;
grid-template-areas:
"."
"post-title"
"post-subtitle"
"."
"post-date"
".";
"."
"post-title"
"post-subtitle"
".";
}
#split-page > #wrapper > header > div > h1 {
grid-area: post-title;
@ -353,6 +378,25 @@
grid-area: post-date;
}
#split-page #post-toc {
grid-area: post-toc;
width: 100%;
text-align: left;
}
#split-page #post-toc > 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 {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
#split-page > #wrapper > .body {
grid-area: post-content;
display: block;
@ -362,16 +406,16 @@
grid-template-columns: 1fr;
grid-template-rows: auto auto auto auto auto auto auto auto auto auto;
grid-template-areas:
"description"
"timeline"
"related"
"posts"
"websites"
"programs"
"writings"
"videos"
"others"
"quals-and-awards";
"description"
"timeline"
"related"
"posts"
"websites"
"programs"
"writings"
"videos"
"others"
"quals-and-awards";
}
#organisation-body > #description {
@ -392,7 +436,7 @@
grid-template-rows: auto;
text-align: left;
grid-template-areas:
"left right";
"left right";
}
#organisation-body > #related > #children {
grid-area: left;
@ -428,8 +472,8 @@
grid-template-columns: 1fr;
grid-template-rows: auto auto;
grid-template-areas:
"title"
"items";
"title"
"items";
}
#organisation-body > .org-items h2.subheading {
grid-area: title;
@ -437,12 +481,12 @@
#organisation-body > .org-items .index {
grid-gap: 6px 5px;
grid-area: items;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(1, 1fr);
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 1fr;
justify-items: stretch;
align-items: stretch;
grid-template-areas:
"item1 item2";
"item1 item2 item3 item4";
}
#organisation-body > .org-items .index .item:nth-child(1) {
grid-area: item1;
@ -450,6 +494,12 @@
#organisation-body > .org-items .index .item:nth-child(2) {
grid-area: item2;
}
#organisation-body > .org-items .index .item:nth-child(3) {
grid-area: item3;
}
#organisation-body > .org-items .index .item:nth-child(4) {
grid-area: item4;
}
#split-page > #comments {
grid-area: comments;
@ -460,22 +510,24 @@
grid-template-columns: 1fr;
grid-template-rows: auto auto;
grid-template-areas:
"comment-entry"
"comments";
"comment-entry"
"comments";
}
@media only screen and (min-width: 1024px) {
#split-page > #comments > .row {
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas:
"comments comment-entry";
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas:
"comments comment-entry";
}
}
#split-page > #comments #comments-list {
grid-area: comments;
justify-items: center;
align-items: start;
}
#split-page > #comments #comments-reply {
grid-area: comment-entry;
justify-items: center;
@ -483,8 +535,59 @@
text-align: center;
}
#related-organisations {
.comment-body {
grid-template-columns: 15% 1fr;
grid-template-rows: auto auto;
grid-template-areas:
"comment-meta comment-content"
". comment-content"
". comment-reply";
}
.comment-body .comment-meta {
grid-area: comment-meta;
justify-items: center;
align-items: start;
text-align: center;
font-weight: bold;
}
.comment-body .comment-meta .comment-author img {
display: none;
}
.comment-body .comment-content {
grid-area: comment-content;
justify-items: left;
align-items: start;
padding: 0 2em 0 2em;
}
.comment-body .comment-content p {
padding-top: 0.5em;
padding-bottom: 0.5em;
font-size: 1em;
}
.comment-body .comment-content p:first-of-type {
padding-top: 0em;
}
.comment-body .comment-content p:last-of-type {
padding-bottom: 0em;
}
.comment-body .comment-content .comment-source {
font-size: 0.75em;
opacity: 0.75;
}
.comment-body .reply {
grid-area: comment-reply;
justify-items: right;
align-items: start;
text-align: right;
padding-left: 0.4em;
}
body > footer {
@ -511,7 +614,7 @@
}
body:not(.page-template-centred-page) > main {
margin-top: 80px;
margin-top: 3.8em;
}
body > header {
@ -559,15 +662,24 @@ article #details {
display: block;
}
#split-page >
#split-page section div {
margin: 0 1em;
}
#organisation-body {
width: 100%;
}
/** 2.Inline Elements */
/* 1.1. Appearance */
body { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; }
body {
font-family: Palatino, serif;
}
h1, h2, h3, h4, h5, h6 {
h1, h2, h3, h4, h5, h6, th {
font-family: "Palatino Linotype", serif;
margin: 0;
}
@ -589,7 +701,7 @@ ol {
strong { font-weight: bold; }
sup, sup {
sup, sub {
font-size:xx-small;
line-height: 1.2em;
}
@ -637,16 +749,58 @@ q, blockquote {
q.guillemets {
quotes: "«" "»" "«" "»";
}
q:before, blockquote p:first-of-type::before {
q:before, blockquote:not(.no-first-quote) p:first-of-type::before {
content: open-quote;
}
q:after, blockquote p:last-of-type::after {
q:after, blockquote:not(.no-last-quote) p:last-of-type::after {
content: close-quote;
}
cite:not(.smallcite), i, em { font-style: italic; }
cite.smallcite:before { content: '“'; }
cite.smallcite:after { content: '”'; }
i, em {
font-style: italic;
}
cite,
cite.book,
cite.film,
cite.tv-show,
cite.book,
cite.album,
cite.report {
font-style: italic;
}
cite.legislation,
cite.smallcite,
cite.article,
cite.episode,
cite.video,
cite.chapter,
cite.song,
cite.speech,
cite.presentation {
font-style: normal;
}
cite.smallcite:before,
cite.article:before,
cite.episode:before,
cite.video:before,
cite.chapter:before,
cite.song:before,
cite.speech:before,
cite.presentation:before {
content: '“';
}
cite.smallcite:after,
cite.article:after,
cite.episode:after,
cite.video:after,
cite.chapter:after,
cite.song:after,
cite.speech:after,
cite.presentation:after {
content: '”';
}
code,
samp,
@ -663,18 +817,39 @@ pre .nocode {
border-radius: 6px;
border: dashed 1px black;
}
:not(.post-title):not(pre) code,
:not(.post-title):not(pre) samp,
:not(.post-title):not(pre) var {
code,
samp,
var {
background-color: #d1d1d1;
border-radius: 5px;
padding: 2px 2px;
}
pre {
max-width: 50vw;
overflow: scroll;
}
h1 code, .post-title code, pre code,
h1 samp, .post-title samp, pre samp,
h1 var, .post-title var, pre var {
background-color: transparent;
padding: 0;
}
.heading code,
.subheading code {
background-color: transparent;
}
pre.prettyprint ol {
padding-left: 3.5em;
}
pre.prettyprint li {
background: none !important;
}
li.L0, li.L1, li.L2, li.L3,
li.L5, li.L6, li.L7, li.L8 {
list-style-type: decimal !important;
@ -702,8 +877,18 @@ kbd {
white-space: nowrap;
}
.pre-nominals,
.post-nominals {
font-size: 0.6em;
font-variant: small-caps;
}
.article__text--commentary {
display: inline;
}
#toggleCommentary {
text-decoration: underline;
}
#comments-list-title {
@ -765,7 +950,7 @@ body > header h1 {
#split-page > #wrapper > header > div > h1 {
font-weight: bold;
margin-top: 20%;
/*margin-top: 20%;*/
font-size: 2.5em;
}
#split-page > #wrapper > header > div > h2 {
@ -776,6 +961,10 @@ body > header h1 {
margin-top: 20%;
font-size: 1em;
}
#split-page > #wrapper > footer > h1 {
font-size: 2em;
}
@media only screen and (min-width: 1024px) {
#split-page > #wrapper > header > div > h1 {
font-size: 3.5em;
@ -787,13 +976,98 @@ body > header h1 {
#comments-list-title, #comments-reply-title {
font-size: 1.6em;
margin-bottom: 0.5em;
}
.logged-in-as, .comment-form-comment, .form-submit {
margin-bottom: 0.5em;
}
.comment-form-comment label {
display: none;
}
.comment-form-comment textarea,
.form-submit input#submit {
border: 2px solid black;
background-color: #fffff0;
}
.form-submit input#submit {
padding: 0.6em 1em;
cursor: pointer;
box-shadow: 3px 3px black;
}
.form-submit input#submit:hover {
box-shadow: none;
margin-left: 3px;
}
.akismet_comment_form_privacy_notice {
font-size: 0.6em;
}
.comment-list {
margin: auto;
list-style: none;
}
.comment .children {
list-style: none;
}
.comment .children .comment .comment-body {
border-left: 2px solid black;
padding-left: 1em;
}
.comment-body {
border-top: 1px solid black;
border-bottom: 1px solid black;
padding-top: 1em;
}
.comment-body:first-of-type {
border-top: 0px;
}
.comment-body:last-of-type {
border-bottom: 0px;
}
.comment-body .comment-meta img {
border-radius: 50%;
width: 100%;
height: auto;
}
.comment-body .comment-meta .says {
display: none;
}
.comment-body .comment-meta .comment-metadata > a {
margin-top: 0.4em;
margin-bottom: 0.4em;
font-size: 0.6em;
}
.comment-body .comment-meta .comment-metadata .edit-link {
font-size: 0.8em;
margin-top: 0.4em;
}
.comment-body .comment-meta .comment-metadata .edit-link::before {
content: '( ';
}
.comment-body .comment-meta .comment-metadata .edit-link::after {
content: ' )';
}
main#split-page > #wrapper > .body {
text-align: justify;
text-align: left;
padding: 0 2em 2em 2em;
}
main#split-page > #wrapper > .body blockquote:first-of-type {
main#split-page > #wrapper > .body blockquote:first-of-type:not(.no-first-blockquote) {
font-size: 1.2em;
text-align: center;
margin: 0;
@ -811,7 +1085,7 @@ main#split-page > #wrapper > .body ol li {
font-size: 1em;
margin-top: 0.5em;
margin-bottom: 0.5em;
line-height: 1.2em;
line-height: 1.3em;
}
main#split-page > #wrapper > .body h2.subheading {
font-size: 1.6em;
@ -821,6 +1095,16 @@ main#split-page > #wrapper > .body h2.subheading {
line-height: 1.2em;
text-align: center;
}
main#split-page > #wrapper > .body h3.subsubheading {
font-size: 1em;
border-bottom: 1px dashed var(--dark);
margin-top: 1em;
margin-bottom: 1em;
padding-bottom: 0.5em;
line-height: 1em;
text-align: left;
font-weight: bold;
}
main#split-page > #wrapper > #organisation-body h2.subheading a {
font-size: 0.5em;
}
@ -863,6 +1147,77 @@ a:hover, a:focus {
#experience-wrapper {
grid-area: page-container;
}
#organisations-grid {
border-spacing: 1em;
margin-top: 1em;
margin-bottom: 1em;
border-radius: 10px;
}
#organisations-grid th {
font-weight: bold;
text-align: left;
padding: 1em;
font-size: 1.4em;
}
#organisations-grid tr:first-of-type {
background-color: #808080;
color: #FFFFF0;
z-index: 1;
position: sticky;
vertical-align: middle;
top: 99px;
max-height: 1.8em;
}
#organisations-grid tr:nth-child(even) {
background-color: #DDDDD0;
}
.organisation td {
padding: 1em;
vertical-align: middle;
}
.organisation a {
display: block;
}
.organisation-logo {
width: 160px;
}
.organisation-logo img {
height: 60px;
width: auto;
max-width: 150px;
display: block;
object-fit: contain;
margin: auto
}
.organisation-children {
width: 5%
}
.organisation-items:not(.organisation-children) .organisation-item {
width: 10%;
float: left;
}
.organisation-items .organisation-item {
text-align: center;
}
.organisation-items .organisation-item span {
margin: auto;
}
.organisation-items .organisation-item.none {
opacity: 0.4;
}
.company-info-container {
background-color: #ffffff;
max-width: 60px;
@ -962,7 +1317,7 @@ a:hover, a:focus {
#split-page > #wrapper > .body > figure {
max-width: none !important;
width: 100%;
width: 100% !important;
text-align: center;
}
@ -986,3 +1341,27 @@ a:hover, a:focus {
.latex {
vertical-align: middle;
}
span.nobr {
white-space: nowrap;
}
.footnote_tooltip {
z-index: 1;
}
.footnote-reference-container {
border-collapse: separate;
border-spacing: 0 10px;
}
table:not(.footnote-reference-container) th {
font-weight: bold;
}
table:not(.footnote-reference-container) th,
table:not(.footnote-reference-container) td {
border: 1px solid var(--dark);
padding: 0.5em 1em;
text-align: left;
}

View file

@ -13,14 +13,15 @@
<?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->name,
),
array(
'taxonomy' => 'company',
'field' => 'slug',
'terms' => $company->slug,
),
),
'posts_per_page' => -1
);
@ -32,7 +33,10 @@
<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');
@ -44,36 +48,34 @@
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;
<?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++;
}
}
foreach ($companies as $company) {
if (sizeof(get_ancestors($company->term_id, 'company')) > $currSizeOf) {
$currSizeOf = sizeof(get_ancestors($company->term_id, 'company'));
$lowestDepthCompany = $i++;
}
}
$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 "[ '{$companies[$lowestDepthCompany]->name}', '$title', new Date('$start'), new Date('$end') ],\n";
$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($("#timeline div:first-child div:first-child div:first-child div svg").attr("height"))+70;
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);
console.log(dataTable);
chart.draw(dataTable, options);
}
</script>
@ -84,130 +86,155 @@
?>
<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>
<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>
<section id="timeline">
<?php /*if ($loop->have_posts()): ?>
<div class="row">
<div id="timeline" class="col-12">
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
</div>
</div>
<?php endif;*/ ?>
</section>
<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
)
));
}
<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"; ?>
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 else: ?>
<h2 class="subheading"></h2>
<?php endif; ?>
</div>
<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">Children</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="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"; ?>
<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>
<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>
<?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 );
$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++ < 2)) : $loop->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
echo '</div>';
echo '</section>';
endif;
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';
$i = 0;
$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();
echo '<li><a href="#">'.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';
$i = 0;
$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();
echo '<li><a href="#">'.get_the_title().'</a></li>';
endwhile;
echo '</ul>';
else:
echo '<p>No awards.</p>';
endif;
echo '</div>';
echo '</section>'
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>

View file

@ -11,16 +11,18 @@
<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>'); ?>
<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 -->
<main id="post-body" class="body">
<?php if (has_category()): ?>
<?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
@ -47,16 +49,22 @@
$catag .= '<a href="/category/series/'.$thisSeries->slug.'">'.$thisSeries->name.'</a>';
}
$catag .= '.';
} else {
$catag = "is not a part of any series.";
echo "<li>This <a href='/category/{$type}s'>{$type}</a> {$catag}</li>";
}
?>
<li>This <?php echo '<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>
<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>
@ -70,4 +78,16 @@
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

@ -10,16 +10,16 @@
<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";
?>
<?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 ?>"><?php echo get_the_title(); ?></h1>
<?php if ($subtitle = get_post_meta(get_the_ID(), 'Subtitle', true)): ?>
<h2><?php echo $subtitle ?></h2>
<?php endif; ?>
<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>