Add PHPCS config, lint files

This commit is contained in:
Ben Goldsworthy 2021-01-09 11:13:06 +00:00
parent 3c30f664b8
commit c5a41ae9ea
24 changed files with 1686 additions and 1427 deletions

View file

@ -12,14 +12,16 @@
<main id="list-page" class="col-10 col-m-12" role="main"> <main id="list-page" class="col-10 col-m-12" role="main">
<header> <header>
<h1><?php echo (get_post_type() == "post") ? single_cat_title() : ucfirst(get_post_type())."s"; ?>.</h1> <h1><?php echo ( get_post_type() == 'post' ) ? single_cat_title() : ucfirst( get_post_type() ) . 's'; ?>.</h1>
<?php <?php
echo get_the_posts_pagination( array( echo get_the_posts_pagination(
array(
'screen_reader_text' => ' ', 'screen_reader_text' => ' ',
'mid_size' => 20, 'mid_size' => 20,
'prev_text' => '', 'prev_text' => '',
'next_text' => '', 'next_text' => '',
)); )
);
?> ?>
</header> </header>
@ -27,7 +29,8 @@
<?php <?php
if ( have_posts() ) : if ( have_posts() ) :
// Start the loop. // Start the loop.
while ( have_posts() ) : the_post(); while ( have_posts() ) :
the_post();
/* /*
* Include the Post-Format-specific template for the content. * Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file * If you want to override this in a child theme, then include a file
@ -45,12 +48,14 @@
<footer> <footer>
<?php <?php
echo get_the_posts_pagination( array( echo get_the_posts_pagination(
array(
'screen_reader_text' => ' ', 'screen_reader_text' => ' ',
'mid_size' => 20, 'mid_size' => 20,
'prev_text' => '', 'prev_text' => '',
'next_text' => '', 'next_text' => '',
)); )
);
?> ?>
</footer> </footer>
</main><!-- .content-area --> </main><!-- .content-area -->

View file

@ -17,7 +17,10 @@
<?php get_header(); ?> <?php get_header(); ?>
<main id="centred-page" role="main"> <main id="centred-page" role="main">
<?php while (have_posts()): the_post(); ?> <?php
while ( have_posts() ) :
the_post();
?>
<h1><?php echo get_the_title(); ?></h1> <h1><?php echo get_the_title(); ?></h1>
<h2><?php the_content(); ?></h2> <h2><?php the_content(); ?></h2>
<?php endwhile; ?> <?php endwhile; ?>

View file

@ -12,7 +12,9 @@
* the visitor has not yet entered the password we will * the visitor has not yet entered the password we will
* return early without loading the comments. * return early without loading the comments.
*/ */
if (post_password_required()) return; if ( post_password_required() ) {
return;
}
?> ?>
<div id="comments" class="comments-area"> <div id="comments" class="comments-area">
@ -24,11 +26,13 @@
<ol class="comment-list"> <ol class="comment-list">
<?php <?php
wp_list_comments( array( wp_list_comments(
array(
'style' => 'ol', 'style' => 'ol',
'short_ping' => true, 'short_ping' => true,
'avatar_size' => 42, 'avatar_size' => 42,
)); )
);
?> ?>
</ol><!-- .comment-list --> </ol><!-- .comment-list -->
@ -43,10 +47,12 @@
<div class="col-5" id="comments-reply"> <div class="col-5" id="comments-reply">
<?php <?php
comment_form( array( comment_form(
array(
'title_reply_before' => '<h3 id="comments-reply-title">', 'title_reply_before' => '<h3 id="comments-reply-title">',
'title_reply_after' => '</h3>', 'title_reply_after' => '</h3>',
)); )
);
?> ?>
</div> </div>
</div> </div>

View file

@ -72,11 +72,14 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
* *
* @since Omphaloskepsis 1.2 * @since Omphaloskepsis 1.2
*/ */
add_theme_support( 'custom-logo', array( add_theme_support(
'custom-logo',
array(
'height' => 2256, 'height' => 2256,
'width' => 1622, 'width' => 1622,
'flex-height' => true, 'flex-height' => true,
) ); )
);
/* /*
* Enable support for Post Thumbnails on posts and pages. * Enable support for Post Thumbnails on posts and pages.
@ -87,17 +90,22 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
set_post_thumbnail_size( 1200, 9999 ); set_post_thumbnail_size( 1200, 9999 );
// This theme uses wp_nav_menu() in two locations. // This theme uses wp_nav_menu() in two locations.
register_nav_menus( array( register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'omphaloskepsis' ), 'primary' => __( 'Primary Menu', 'omphaloskepsis' ),
'social' => __( 'Social Links Menu', 'omphaloskepsis' ), 'social' => __( 'Social Links Menu', 'omphaloskepsis' ),
) ); )
);
function omphaloskepsis_infinite_scroll_init() { function omphaloskepsis_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array( add_theme_support(
'infinite-scroll',
array(
'container' => 'main', 'container' => 'main',
'render' => 'omphaloskepsis_infinite_scroll_render', 'render' => 'omphaloskepsis_infinite_scroll_render',
'footer' => 'colophon', 'footer' => 'colophon',
) ); )
);
} }
add_action( 'init', 'omphaloskepsis_infinite_scroll_init' ); add_action( 'init', 'omphaloskepsis_infinite_scroll_init' );
@ -119,20 +127,25 @@ function omphaloskepsis_infinite_scroll_render() {
* Switch default core markup for search form, comment form, and comments * Switch default core markup for search form, comment form, and comments
* to output valid HTML5. * to output valid HTML5.
*/ */
add_theme_support( 'html5', array( add_theme_support(
'html5',
array(
'search-form', 'search-form',
'comment-form', 'comment-form',
'comment-list', 'comment-list',
'gallery', 'gallery',
'caption', 'caption',
) ); )
);
/* /*
* Enable support for Post Formats. * Enable support for Post Formats.
* *
* See: https://codex.wordpress.org/Post_Formats * See: https://codex.wordpress.org/Post_Formats
*/ */
add_theme_support( 'post-formats', array( add_theme_support(
'post-formats',
array(
'aside', 'aside',
'image', 'image',
'video', 'video',
@ -142,7 +155,8 @@ function omphaloskepsis_infinite_scroll_render() {
'status', 'status',
'audio', 'audio',
'chat', 'chat',
) ); )
);
/* /*
* This theme styles the visual editor to resemble the theme style, * This theme styles the visual editor to resemble the theme style,
@ -178,7 +192,8 @@ add_action( 'after_setup_theme', 'omphaloskepsis_content_width', 0 );
* @since Omphaloskepsis 1.0 * @since Omphaloskepsis 1.0
*/ */
function omphaloskepsis_widgets_init() { function omphaloskepsis_widgets_init() {
register_sidebar( array( register_sidebar(
array(
'name' => __( 'Sidebar', 'omphaloskepsis' ), 'name' => __( 'Sidebar', 'omphaloskepsis' ),
'id' => 'sidebar-1', 'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar.', 'omphaloskepsis' ), 'description' => __( 'Add widgets here to appear in your sidebar.', 'omphaloskepsis' ),
@ -186,9 +201,11 @@ function omphaloskepsis_widgets_init() {
'after_widget' => '</section>', 'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">', 'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>', 'after_title' => '</h2>',
) ); )
);
register_sidebar( array( register_sidebar(
array(
'name' => __( 'Content Bottom 1', 'omphaloskepsis' ), 'name' => __( 'Content Bottom 1', 'omphaloskepsis' ),
'id' => 'sidebar-2', 'id' => 'sidebar-2',
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ), 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
@ -196,9 +213,11 @@ function omphaloskepsis_widgets_init() {
'after_widget' => '</section>', 'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">', 'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>', 'after_title' => '</h2>',
) ); )
);
register_sidebar( array( register_sidebar(
array(
'name' => __( 'Content Bottom 2', 'omphaloskepsis' ), 'name' => __( 'Content Bottom 2', 'omphaloskepsis' ),
'id' => 'sidebar-3', 'id' => 'sidebar-3',
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ), 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
@ -206,7 +225,8 @@ function omphaloskepsis_widgets_init() {
'after_widget' => '</section>', 'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">', 'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>', 'after_title' => '</h2>',
) ); )
);
} }
add_action( 'widgets_init', 'omphaloskepsis_widgets_init' ); add_action( 'widgets_init', 'omphaloskepsis_widgets_init' );
@ -241,10 +261,13 @@ if ( ! function_exists( 'omphaloskepsis_fonts_url' ) ) :
} }
if ( $fonts ) { if ( $fonts ) {
$fonts_url = add_query_arg( array( $fonts_url = add_query_arg(
array(
'family' => urlencode( implode( '|', $fonts ) ), 'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ), 'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' ); ),
'https://fonts.googleapis.com/css'
);
} }
return $fonts_url; return $fonts_url;
@ -284,7 +307,7 @@ function omphaloskepsis_scripts() {
wp_enqueue_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' ); 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( 'montserrat', 'https://fonts.googleapis.com/css?family=Montserrat' );
// Load the Internet Explorer specific stylesheet. // 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' );
@ -314,10 +337,14 @@ function omphaloskepsis_scripts() {
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( wp_localize_script(
'omphaloskepsis-script',
'screenReaderText',
array(
'expand' => __( 'expand child menu', 'omphaloskepsis' ), 'expand' => __( 'expand child menu', 'omphaloskepsis' ),
'collapse' => __( 'collapse child menu', 'omphaloskepsis' ), 'collapse' => __( 'collapse child menu', 'omphaloskepsis' ),
) ); )
);
} }
add_action( 'wp_enqueue_scripts', 'omphaloskepsis_scripts' ); add_action( 'wp_enqueue_scripts', 'omphaloskepsis_scripts' );
@ -378,7 +405,11 @@ function omphaloskepsis_hex2rgb( $color ) {
return array(); return array();
} }
return array( 'red' => $r, 'green' => $g, 'blue' => $b ); return array(
'red' => $r,
'green' => $g,
'blue' => $b,
);
} }
/** /**
@ -462,35 +493,46 @@ add_filter('script_loader_tag', 'clean_script_tag');
function omphaloskepsis_the_content( $content ) { function omphaloskepsis_the_content( $content ) {
global $post; global $post;
if ($post->post_type == "program") { if ( $post->post_type == 'program' ) {
if ($meta = get_post_meta($post->ID, 'Link', true)) if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>';
if ($meta = get_post_meta($post->ID, 'Documentation', true)) }
if ( $meta = get_post_meta( $post->ID, 'Documentation', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Documentation</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Documentation</a>';
if ($meta = get_post_meta($post->ID, 'Repo', true)) }
if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>';
if ($meta = get_post_meta($post->ID, 'Licence', true)) }
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
if ($meta = get_post_meta($post->ID, 'MD5', true)) }
if ( $meta = get_post_meta( $post->ID, 'MD5', true ) ) {
$links = $links . '<p class="checksum">MD5 checksum: ' . $meta . '</p>'; $links = $links . '<p class="checksum">MD5 checksum: ' . $meta . '</p>';
}
return $content . $links; return $content . $links;
} elseif ($post->post_type == "website") { } elseif ( $post->post_type == 'website' ) {
if ($meta = get_post_meta($post->ID, 'Link', true)) if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Visit</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Visit</a>';
if ($meta = get_post_meta($post->ID, 'Repo', true)) }
if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>';
if ($meta = get_post_meta($post->ID, 'Licence', true)) }
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
}
return $content . $links; return $content . $links;
} elseif ($post->post_type == "writing") { } elseif ( $post->post_type == 'writing' ) {
if ($meta = get_post_meta($post->ID, 'Link', true)) if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Read</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Read</a>';
if ($meta = get_post_meta($post->ID, 'Licence', true)) }
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
}
return $content . $links; return $content . $links;
} elseif ($post->post_type == "other") { } elseif ( $post->post_type == 'other' ) {
if ($meta = get_post_meta($post->ID, 'Link', true)) if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>'; $links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>';
}
return $content . $links; return $content . $links;
} }
return $content; return $content;
@ -509,19 +551,34 @@ function display_companies() {
echo '<th>Associated Items</th>'; echo '<th>Associated Items</th>';
echo '</tr>'; echo '</tr>';
if ($_POST['toplevel'] == "true") { if ( $_POST['toplevel'] == 'true' ) {
// Gets all of the top-level company terms. // 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))); $terms = apply_filters(
'taxonomy-images-get-terms',
'',
array(
'having_images' => false,
'taxonomy' => 'company',
'term_args' => array( 'parent' => 0 ),
)
);
$include = 1; $include = 1;
} else { } else {
// Gets all of the company terms. // Gets all of the company terms.
$terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company',)); $terms = apply_filters(
'taxonomy-images-get-terms',
'',
array(
'having_images' => false,
'taxonomy' => 'company',
)
);
$include = 0; $include = 0;
} }
if ( ! empty( $terms ) ) { if ( ! empty( $terms ) ) {
foreach ( $terms as $term ) { foreach ( $terms as $term ) {
$term_children = get_term_children($term->term_id, "company"); $term_children = get_term_children( $term->term_id, 'company' );
// 0 = Jobs // 0 = Jobs
// 1 = Blog Posts // 1 = Blog Posts
@ -537,8 +594,6 @@ function display_companies() {
$term_items = array(); $term_items = array();
$term_item_counts = array(); $term_item_counts = array();
foreach ( $post_types as $post_type ) { foreach ( $post_types as $post_type ) {
$args = array( $args = array(
'posts_per_page' => -1, 'posts_per_page' => -1,
@ -554,7 +609,7 @@ function display_companies() {
'meta_query' => array(), 'meta_query' => array(),
); );
if ($_POST['currentjobs'] == "true" && $post_type == "job") { if ( $_POST['currentjobs'] == 'true' && $post_type == 'job' ) {
$args['meta_query'] = array( $args['meta_query'] = array(
array( array(
'key' => 'end-date', 'key' => 'end-date',
@ -564,7 +619,7 @@ function display_companies() {
); );
} }
if ($_POST['showexpired'] != "true" && $post_type == "qualification") { if ( $_POST['showexpired'] != 'true' && $post_type == 'qualification' ) {
$args['meta_query'] = array( $args['meta_query'] = array(
array( array(
'key' => 'Expired', 'key' => 'Expired',
@ -580,19 +635,19 @@ function display_companies() {
array_push( $term_item_counts, count( $posts ) ); array_push( $term_item_counts, count( $posts ) );
} }
if(($_POST['job'] == "true" && $term_item_counts[0] > 0) || if ( ( $_POST['job'] == 'true' && $term_item_counts[0] > 0 ) ||
($_POST['post'] == "true" && $term_item_counts[1] > 0) || ( $_POST['post'] == 'true' && $term_item_counts[1] > 0 ) ||
($_POST['website'] == "true" && $term_item_counts[2] > 0) || ( $_POST['website'] == 'true' && $term_item_counts[2] > 0 ) ||
($_POST['program'] == "true" && $term_item_counts[3] > 0) || ( $_POST['program'] == 'true' && $term_item_counts[3] > 0 ) ||
($_POST['writing'] == "true" && $term_item_counts[4] > 0) || ( $_POST['writing'] == 'true' && $term_item_counts[4] > 0 ) ||
($_POST['video'] == "true" && $term_item_counts[5] > 0) || ( $_POST['video'] == 'true' && $term_item_counts[5] > 0 ) ||
($_POST['other'] == "true" && $term_item_counts[6] > 0) || ( $_POST['other'] == 'true' && $term_item_counts[6] > 0 ) ||
($_POST['qualification'] == "true" && $term_item_counts[7] > 0) || ( $_POST['qualification'] == 'true' && $term_item_counts[7] > 0 ) ||
($_POST['award'] == "true" && $term_item_counts[8] > 0)) { ( $_POST['award'] == 'true' && $term_item_counts[8] > 0 ) ) {
$imgURL = wp_get_attachment_image_src( $term->image_id, 'full' )[0]; $imgURL = wp_get_attachment_image_src( $term->image_id, 'full' )[0];
$bgImg = (!$imgURL) ? "" : " background-image: url(".strtok($imgURL, '?').");"; $bgImg = ( ! $imgURL ) ? '' : ' background-image: url(' . strtok( $imgURL, '?' ) . ');';
$colour = get_term_meta( $term->term_id, 'color', true ); $colour = get_term_meta( $term->term_id, 'color', true );
$colour = ($colour != "") ? $colour : "transparent"; $colour = ( $colour != '' ) ? $colour : 'transparent';
echo '<tr class="organisation">'; echo '<tr class="organisation">';
echo '<td class="organisation-logo">'; echo '<td class="organisation-logo">';
@ -608,7 +663,7 @@ function display_companies() {
echo '</td>'; echo '</td>';
echo '<td class="organisation-items organisation-children">'; echo '<td class="organisation-items organisation-children">';
$num = (count($term_children) > 0) ? "" : "none"; $num = ( count( $term_children ) > 0 ) ? '' : 'none';
echo '<div class="organisation-item ' . $num . '">'; echo '<div class="organisation-item ' . $num . '">';
echo '<span class="dashicons dashicons-groups"></span><br>' . count( $term_children ); echo '<span class="dashicons dashicons-groups"></span><br>' . count( $term_children );
echo '</div>'; echo '</div>';
@ -617,7 +672,7 @@ function display_companies() {
echo '<td class="organisation-items">'; echo '<td class="organisation-items">';
$i = 0; $i = 0;
foreach ( $post_types as $post_type ) { foreach ( $post_types as $post_type ) {
$num = ($term_item_counts[$i] > 0) ? "" : "none"; $num = ( $term_item_counts[ $i ] > 0 ) ? '' : 'none';
echo '<div class="organisation-item ' . $num . '">'; echo '<div class="organisation-item ' . $num . '">';
echo '<span class="dashicons dashicons-' . $dashicons[ $i ] . '"></span><br>' . $term_item_counts[ $i ]; echo '<span class="dashicons dashicons-' . $dashicons[ $i ] . '"></span><br>' . $term_item_counts[ $i ];
echo '</div>'; echo '</div>';

View file

@ -14,7 +14,7 @@
<meta charset="<?php bloginfo( 'charset' ); ?>"> <meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<?php $index = get_post_meta( get_the_ID(), 'Index', true ); ?> <?php $index = get_post_meta( get_the_ID(), 'Index', true ); ?>
<?php if (!(is_single() && !is_page() && $index == "true")): ?> <?php if ( ! ( is_single() && ! is_page() && $index == 'true' ) ) : ?>
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<?php endif; ?> <?php endif; ?>
<link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="profile" href="http://gmpg.org/xfn/11">

View file

@ -15,12 +15,14 @@
<h1>Blog.</h1> <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> <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 <?php
echo get_the_posts_pagination( array( echo get_the_posts_pagination(
array(
'screen_reader_text' => ' ', 'screen_reader_text' => ' ',
'mid_size' => 20, 'mid_size' => 20,
'prev_text' => '', 'prev_text' => '',
'next_text' => '', 'next_text' => '',
)); )
);
?> ?>
</header> </header>
@ -28,7 +30,8 @@
<?php <?php
if ( have_posts() ) : if ( have_posts() ) :
// Start the loop. // Start the loop.
while ( have_posts() ) : the_post(); while ( have_posts() ) :
the_post();
/* /*
* Include the Post-Format-specific template for the content. * Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file * If you want to override this in a child theme, then include a file
@ -46,12 +49,14 @@
<footer> <footer>
<?php <?php
echo get_the_posts_pagination( array( echo get_the_posts_pagination(
array(
'screen_reader_text' => ' ', 'screen_reader_text' => ' ',
'mid_size' => 20, 'mid_size' => 20,
'prev_text' => '', 'prev_text' => '',
'next_text' => '', 'next_text' => '',
)); )
);
?> ?>
</footer> </footer>
</main><!-- .content-area --> </main><!-- .content-area -->

View file

@ -50,9 +50,13 @@ function twentysixteen_upgrade_notice() {
* @global string $wp_version WordPress version. * @global string $wp_version WordPress version.
*/ */
function twentysixteen_customize() { 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( 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, 'back_link' => true,
) ); )
);
} }
add_action( 'load-customize.php', 'twentysixteen_customize' ); add_action( 'load-customize.php', 'twentysixteen_customize' );

View file

@ -30,9 +30,15 @@ function twentysixteen_custom_header_and_background() {
* @type string $default-color Default color of the background. * @type string $default-color Default color of the background.
* } * }
*/ */
add_theme_support( 'custom-background', apply_filters( 'twentysixteen_custom_background_args', array( add_theme_support(
'custom-background',
apply_filters(
'twentysixteen_custom_background_args',
array(
'default-color' => $default_background_color, 'default-color' => $default_background_color,
) ) ); )
)
);
/** /**
* Filter the arguments used when adding 'custom-header' support in Twenty Sixteen. * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen.
@ -50,13 +56,19 @@ function twentysixteen_custom_header_and_background() {
* displayed on the blog. * displayed on the blog.
* } * }
*/ */
add_theme_support( 'custom-header', apply_filters( 'twentysixteen_custom_header_args', array( add_theme_support(
'custom-header',
apply_filters(
'twentysixteen_custom_header_args',
array(
'default-text-color' => $default_text_color, 'default-text-color' => $default_text_color,
'width' => 1200, 'width' => 1200,
'height' => 280, 'height' => 280,
'flex-height' => true, 'flex-height' => true,
'wp-head-callback' => 'twentysixteen_header_style', 'wp-head-callback' => 'twentysixteen_header_style',
) ) ); )
)
);
} }
add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' ); add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' );
@ -107,83 +119,131 @@ function twentysixteen_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
if ( isset( $wp_customize->selective_refresh ) ) { if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'blogname', array( $wp_customize->selective_refresh->add_partial(
'blogname',
array(
'selector' => '.site-title a', 'selector' => '.site-title a',
'container_inclusive' => false, 'container_inclusive' => false,
'render_callback' => 'twentysixteen_customize_partial_blogname', 'render_callback' => 'twentysixteen_customize_partial_blogname',
) ); )
$wp_customize->selective_refresh->add_partial( 'blogdescription', array( );
$wp_customize->selective_refresh->add_partial(
'blogdescription',
array(
'selector' => '.site-description', 'selector' => '.site-description',
'container_inclusive' => false, 'container_inclusive' => false,
'render_callback' => 'twentysixteen_customize_partial_blogdescription', 'render_callback' => 'twentysixteen_customize_partial_blogdescription',
) ); )
);
} }
// Add color scheme setting and control. // Add color scheme setting and control.
$wp_customize->add_setting( 'color_scheme', array( $wp_customize->add_setting(
'color_scheme',
array(
'default' => 'default', 'default' => 'default',
'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme',
'transport' => 'postMessage', 'transport' => 'postMessage',
) ); )
);
$wp_customize->add_control( 'color_scheme', array( $wp_customize->add_control(
'color_scheme',
array(
'label' => __( 'Base Color Scheme', 'twentysixteen' ), 'label' => __( 'Base Color Scheme', 'twentysixteen' ),
'section' => 'colors', 'section' => 'colors',
'type' => 'select', 'type' => 'select',
'choices' => twentysixteen_get_color_scheme_choices(), 'choices' => twentysixteen_get_color_scheme_choices(),
'priority' => 1, 'priority' => 1,
) ); )
);
// Add page background color setting and control. // Add page background color setting and control.
$wp_customize->add_setting( 'page_background_color', array( $wp_customize->add_setting(
'page_background_color',
array(
'default' => $color_scheme[1], 'default' => $color_scheme[1],
'sanitize_callback' => 'sanitize_hex_color', 'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage', 'transport' => 'postMessage',
) ); )
);
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'page_background_color', array( $wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'page_background_color',
array(
'label' => __( 'Page Background Color', 'twentysixteen' ), 'label' => __( 'Page Background Color', 'twentysixteen' ),
'section' => 'colors', 'section' => 'colors',
) ) ); )
)
);
// Remove the core header textcolor control, as it shares the main text color. // Remove the core header textcolor control, as it shares the main text color.
$wp_customize->remove_control( 'header_textcolor' ); $wp_customize->remove_control( 'header_textcolor' );
// Add link color setting and control. // Add link color setting and control.
$wp_customize->add_setting( 'link_color', array( $wp_customize->add_setting(
'link_color',
array(
'default' => $color_scheme[2], 'default' => $color_scheme[2],
'sanitize_callback' => 'sanitize_hex_color', 'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage', 'transport' => 'postMessage',
) ); )
);
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( $wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'link_color',
array(
'label' => __( 'Link Color', 'twentysixteen' ), 'label' => __( 'Link Color', 'twentysixteen' ),
'section' => 'colors', 'section' => 'colors',
) ) ); )
)
);
// Add main text color setting and control. // Add main text color setting and control.
$wp_customize->add_setting( 'main_text_color', array( $wp_customize->add_setting(
'main_text_color',
array(
'default' => $color_scheme[3], 'default' => $color_scheme[3],
'sanitize_callback' => 'sanitize_hex_color', 'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage', 'transport' => 'postMessage',
) ); )
);
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_text_color', array( $wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'main_text_color',
array(
'label' => __( 'Main Text Color', 'twentysixteen' ), 'label' => __( 'Main Text Color', 'twentysixteen' ),
'section' => 'colors', 'section' => 'colors',
) ) ); )
)
);
// Add secondary text color setting and control. // Add secondary text color setting and control.
$wp_customize->add_setting( 'secondary_text_color', array( $wp_customize->add_setting(
'secondary_text_color',
array(
'default' => $color_scheme[4], 'default' => $color_scheme[4],
'sanitize_callback' => 'sanitize_hex_color', 'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage', 'transport' => 'postMessage',
) ); )
);
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_text_color', array( $wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'secondary_text_color',
array(
'label' => __( 'Secondary Text Color', 'twentysixteen' ), 'label' => __( 'Secondary Text Color', 'twentysixteen' ),
'section' => 'colors', 'section' => 'colors',
) ) ); )
)
);
} }
add_action( 'customize_register', 'twentysixteen_customize_register', 11 ); add_action( 'customize_register', 'twentysixteen_customize_register', 11 );
@ -248,7 +308,9 @@ function twentysixteen_get_color_schemes() {
* } * }
* } * }
*/ */
return apply_filters( 'twentysixteen_color_schemes', array( return apply_filters(
'twentysixteen_color_schemes',
array(
'default' => array( 'default' => array(
'label' => __( 'Default', 'twentysixteen' ), 'label' => __( 'Default', 'twentysixteen' ),
'colors' => array( 'colors' => array(
@ -299,7 +361,8 @@ function twentysixteen_get_color_schemes() {
'#5b4d3e', '#5b4d3e',
), ),
), ),
) ); )
);
} }
if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) : if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) :
@ -445,14 +508,17 @@ add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' );
* @return string Color scheme CSS. * @return string Color scheme CSS.
*/ */
function twentysixteen_get_color_scheme_css( $colors ) { function twentysixteen_get_color_scheme_css( $colors ) {
$colors = wp_parse_args( $colors, array( $colors = wp_parse_args(
$colors,
array(
'background_color' => '', 'background_color' => '',
'page_background_color' => '', 'page_background_color' => '',
'link_color' => '', 'link_color' => '',
'main_text_color' => '', 'main_text_color' => '',
'secondary_text_color' => '', 'secondary_text_color' => '',
'border_color' => '', 'border_color' => '',
) ); )
);
return <<<CSS return <<<CSS
/* Color Scheme */ /* Color Scheme */

View file

@ -20,7 +20,8 @@ if ( ! function_exists( 'twentysixteen_entry_meta' ) ) :
function twentysixteen_entry_meta() { function twentysixteen_entry_meta() {
if ( 'post' === get_post_type() ) { if ( 'post' === get_post_type() ) {
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); $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>', 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 ), get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
_x( 'Author', 'Used before post author name.', 'twentysixteen' ), _x( 'Author', 'Used before post author name.', 'twentysixteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
@ -34,7 +35,8 @@ function twentysixteen_entry_meta() {
$format = get_post_format(); $format = get_post_format();
if ( current_theme_supports( 'post-formats', $format ) ) { if ( current_theme_supports( 'post-formats', $format ) ) {
printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', 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' ) ), sprintf( '<span class="screen-reader-text">%s </span></div>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ),
esc_url( get_post_format_link( $format ) ), esc_url( get_post_format_link( $format ) ),
get_post_format_string( $format ) get_post_format_string( $format )
@ -51,7 +53,6 @@ function twentysixteen_entry_meta() {
'</span>' '</span>'
); );
} }
endif; endif;
@ -70,14 +71,16 @@ function twentysixteen_entry_date() {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>'; $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
} }
$time_string = sprintf( $time_string, $time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ), esc_attr( get_the_date( 'c' ) ),
get_the_date(), get_the_date(),
esc_attr( get_the_modified_date( 'c' ) ), esc_attr( get_the_modified_date( 'c' ) ),
get_the_modified_date() get_the_modified_date()
); );
printf( '<span class="posted-on"><a href="%2$s" rel="bookmark">%3$s</a></span>', printf(
'<span class="posted-on"><a href="%2$s" rel="bookmark">%3$s</a></span>',
_x( 'Posted on', 'Used before publish date.', 'bengoldsworthy' ), _x( 'Posted on', 'Used before publish date.', 'bengoldsworthy' ),
esc_url( get_permalink() ), esc_url( get_permalink() ),
$time_string $time_string
@ -96,7 +99,8 @@ if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) :
function twentysixteen_entry_taxonomies() { function twentysixteen_entry_taxonomies() {
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); $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() ) { if ( $categories_list && twentysixteen_categorized_blog() ) {
printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', printf(
'<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Categories', 'Used before category names.', 'twentysixteen' ), _x( 'Categories', 'Used before category names.', 'twentysixteen' ),
$categories_list $categories_list
); );
@ -104,7 +108,8 @@ function twentysixteen_entry_taxonomies() {
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
if ( $tags_list ) { if ( $tags_list ) {
printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', printf(
'<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Tags', 'Used before tag names.', 'twentysixteen' ), _x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
$tags_list $tags_list
); );
@ -149,7 +154,8 @@ function twentysixteen_post_thumbnail() {
</div> </div>
</a> </a>
<?php endif; // End is_singular() <?php
endif; // End is_singular()
} }
endif; endif;
@ -168,11 +174,13 @@ if ( ! function_exists( 'twentysixteen_excerpt' ) ) :
function twentysixteen_excerpt( $class = 'entry-summary' ) { function twentysixteen_excerpt( $class = 'entry-summary' ) {
$class = esc_attr( $class ); $class = esc_attr( $class );
if ( has_excerpt() || is_search() ) : ?> if ( has_excerpt() || is_search() ) :
?>
<div class="<?php echo $class; ?>"> <div class="<?php echo $class; ?>">
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
</div><!-- .<?php echo $class; ?> --> </div><!-- .<?php echo $class; ?> -->
<?php endif; <?php
endif;
} }
endif; endif;
@ -188,7 +196,8 @@ if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) :
* @return string 'Continue reading' link prepended with an ellipsis. * @return string 'Continue reading' link prepended with an ellipsis.
*/ */
function twentysixteen_excerpt_more() { function twentysixteen_excerpt_more() {
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', $link = sprintf(
'<a href="%1$s" class="more-link">%2$s</a>',
esc_url( get_permalink( get_the_ID() ) ), esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */ /* translators: %s: Name of current post */
sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) ) sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) )
@ -210,11 +219,13 @@ endif;
function twentysixteen_categorized_blog() { function twentysixteen_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) {
// Create an array of all the categories that are attached to posts. // Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories( array( $all_the_cool_cats = get_categories(
array(
'fields' => 'ids', 'fields' => 'ids',
// We only need to know if there is more than one category. // We only need to know if there is more than one category.
'number' => 2, 'number' => 2,
) ); )
);
// Count the number of categories that are attached to the posts. // Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats ); $all_the_cool_cats = count( $all_the_cool_cats );

View file

@ -18,9 +18,12 @@ get_header(); ?>
<!--Page Title & Details--> <!--Page Title & Details-->
<header class="post-header-title"> <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(); ?> <?php
while ( have_posts() ) :
the_post();
?>
<div class="entry-content tile" id="taxonomy-description"> <div class="entry-content tile" id="taxonomy-description">
<?php the_content() ?> <?php the_content(); ?>
</div> </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"> <div style="width: 70%; margin: auto; margin-top: 20px; border: 2px dashed #020202; padding: 20px; border-radius: 25px;" class="entry-content tile" id="settings">

View file

@ -14,9 +14,12 @@
<div class="post-header-title"> <div class="post-header-title">
<h1 id="page-title">Experience</h1> <h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">by location</h2> <h2 id="page-subtitle">by location</h2>
<?php while (have_posts()) : the_post(); ?> <?php
while ( have_posts() ) :
the_post();
?>
<div class="entry-content" id="taxonomy-description"> <div class="entry-content" id="taxonomy-description">
<?php the_content() ?> <?php the_content(); ?>
<div> <div>
<a class="hyperlink-button" href="?view=countries">Countries</a> <a class="hyperlink-button" href="?view=countries">Countries</a>
<!--<a class="hyperlink-button" href="?view=regions">Regions</a>--> <!--<a class="hyperlink-button" href="?view=regions">Regions</a>-->
@ -30,7 +33,12 @@
<?php <?php
$locations = get_terms( 'location', array( 'hide_empty' => 0 ) ); $locations = get_terms( 'location', array( 'hide_empty' => 0 ) );
// Gets all of the top-level location terms. // Gets all of the top-level location terms.
$terms = get_terms(array('taxonomy' => 'location', 'term_args' => array('parent' => 0))); $terms = get_terms(
array(
'taxonomy' => 'location',
'term_args' => array( 'parent' => 0 ),
)
);
?> ?>
<div id="primary" class="content-area"> <div id="primary" class="content-area">
@ -39,11 +47,14 @@
<div id="map" style="height:100vh; width:100%;"></div> <div id="map" style="height:100vh; width:100%;"></div>
</div> </div>
<?php if ( ! empty( $locations ) ) : ?> <?php if ( ! empty( $locations ) ) : ?>
<?php if ($_GET['view'] == "countries"): ?> <?php if ( $_GET['view'] == 'countries' ) : ?>
<?php <?php
$locationsSubset = array_filter($locations, function ($t) { $locationsSubset = array_filter(
$locations,
function ( $t ) {
return $t->parent != 0 && get_term( $t->parent, 'location' )->parent == 0; 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" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript"> <script type="text/javascript">
@ -54,7 +65,7 @@
var data = google.visualization.arrayToDataTable([ var data = google.visualization.arrayToDataTable([
['Country'], ['Country'],
<?php foreach ( (array) $locationsSubset as $term ) : ?> <?php foreach ( (array) $locationsSubset as $term ) : ?>
['<?php echo $term->description ?>'], ['<?php echo $term->description; ?>'],
<?php endforeach; ?> <?php endforeach; ?>
]); ]);
var options = {}; var options = {};
@ -63,16 +74,19 @@
chart.draw(data, options); chart.draw(data, options);
} }
</script> </script>
<?php elseif ($_GET['view'] == "locations"): ?> <?php elseif ( $_GET['view'] == 'locations' ) : ?>
<?php <?php
$locationsSubset = array_filter($locations, function ($t) { $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; 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"> <script type="text/javascript">
var locations = [ var locations = [
<?php foreach ( (array) $locationsSubset as $term ) : ?> <?php foreach ( (array) $locationsSubset as $term ) : ?>
{<?php echo $term->description ?>}, {<?php echo $term->description; ?>},
<?php endforeach; ?> <?php endforeach; ?>
] ]

34
phpcs.xml Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<ruleset name="Pivotal Agency">
<description>Pivotol 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>

View file

@ -20,7 +20,8 @@ get_header(); ?>
<?php <?php
// Start the loop. // Start the loop.
while ( have_posts() ) : the_post(); while ( have_posts() ) :
the_post();
/** /**
* Run the loop for the search to output the results. * Run the loop for the search to output the results.
@ -33,11 +34,13 @@ get_header(); ?>
endwhile; endwhile;
// Previous/next page navigation. // Previous/next page navigation.
the_posts_pagination( array( the_posts_pagination(
array(
'prev_text' => __( 'Previous page', 'twentysixteen' ), 'prev_text' => __( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ), 'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', '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 : else :

View file

@ -13,7 +13,8 @@
<main id="split-page" role="main"> <main id="split-page" role="main">
<?php <?php
// Start the loop. // Start the loop.
while (have_posts()): the_post(); while ( have_posts() ) :
the_post();
// Include the single post content template. // Include the single post content template.
get_template_part( 'template-parts/content', 'single' ); get_template_part( 'template-parts/content', 'single' );

View file

@ -13,7 +13,7 @@
<?php <?php
// Gets all of the roles attached to the given organisation. // Gets all of the roles attached to the given organisation.
$company = get_queried_object(); $company = get_queried_object();
echo "<!-- ".$company->name."-->"; echo '<!-- ' . $company->name . '-->';
$args = array( $args = array(
'post_type' => array( 'job' ), 'post_type' => array( 'job' ),
'tax_query' => array( 'tax_query' => array(
@ -23,7 +23,7 @@
'terms' => $company->slug, 'terms' => $company->slug,
), ),
), ),
'posts_per_page' => -1 'posts_per_page' => -1,
); );
$loop = new WP_Query( $args ); $loop = new WP_Query( $args );
@ -48,7 +48,9 @@
dataTable.addColumn({ type: 'date', id: 'Start' }); dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' }); dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([ dataTable.addRows([
<?php while ($loop->have_posts()): $loop->the_post(); <?php
while ( $loop->have_posts() ) :
$loop->the_post();
// Gets all of the roles associated with this organisation and its // Gets all of the roles associated with this organisation and its
// child organisations. // child organisations.
$companies = wp_get_object_terms( get_the_ID(), 'company' ); $companies = wp_get_object_terms( get_the_ID(), 'company' );
@ -66,7 +68,8 @@
$start = get_the_date(); $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 ); $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"; echo "[ '" . html_entity_decode( $companies[ $lowestDepthCompany ]->name ) . "', '$title', new Date('$start'), new Date('$end') ],\n";
endwhile; ?> endwhile;
?>
]); ]);
// Draws the table, then resizes the element height and re-draws it // Draws the table, then resizes the element height and re-draws it
@ -85,15 +88,20 @@
$companyName = get_queried_object()->name; $companyName = get_queried_object()->name;
?> ?>
<div id="wrapper"> <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;"> <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> <div>
<?php <?php
if (strlen($companyName) > 70) $small= "2em"; if ( strlen( $companyName ) > 70 ) {
elseif (strlen($companyName) > 35) $small = "3em"; $small = '2em';
elseif (strlen($companyName) > 12) $small = "4em"; } elseif ( strlen( $companyName ) > 35 ) {
else $small = "5em" $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> <h1 id="post-title" style="font-size: <?php echo $small; ?>;"><?php echo $companyName; ?></h1>
</div> </div>
</header><!-- .entry-header --> </header><!-- .entry-header -->
@ -114,26 +122,31 @@
<div id="parents" class="col-6 col-m-12"> <div id="parents" class="col-6 col-m-12">
<?php <?php
if ( get_queried_object()->parent != 0 ) { if ( get_queried_object()->parent != 0 ) {
$parents = apply_filters("taxonomy-images-get-terms", "", $parents = apply_filters(
'taxonomy-images-get-terms',
'',
array( array(
'having_images' => false, 'having_images' => false,
'taxonomy' => 'company', 'taxonomy' => 'company',
'term_args' => array( 'term_args' => array(
'include' => get_term_by('id', get_queried_object()->parent, 'company')->term_id 'include' => get_term_by( 'id', get_queried_object()->parent, 'company' )->term_id,
) ),
) )
); );
} }
if (count($parents) > 0): ?> if ( count( $parents ) > 0 ) :
?>
<h2 class="subheading">Parent</h2> <h2 class="subheading">Parent</h2>
<ul class="index"> <ul class="index">
<?php foreach ((array) $parents as $parent): <?php
foreach ( (array) $parents as $parent ) :
$imgURL = wp_get_attachment_image_src( $parent->image_id )[0]; $imgURL = wp_get_attachment_image_src( $parent->image_id )[0];
$colour = get_term_meta( $parent->term_id, 'color', true ); $colour = get_term_meta( $parent->term_id, 'color', true );
$colour = ($colour != "") ? $colour : "transparent"; ?> $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> <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; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
@ -141,16 +154,27 @@
<div id="children" class="col-6 col-m-12"> <div id="children" class="col-6 col-m-12">
<?php <?php
$children = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company', 'term_args' => array('parent' => get_queried_object()->term_id))); $children = apply_filters(
if (count($children) > 0): ?> 'taxonomy-images-get-terms',
<h2 class="subheading">Child<?php echo (count($children) != 1) ? "ren" : ""; ?></h2> '',
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"> <ul class="index">
<?php foreach ( (array) $children as $child ): <?php
foreach ( (array) $children as $child ) :
$imgURL = wp_get_attachment_image_src( $child->image_id, 'detail' )[0]; $imgURL = wp_get_attachment_image_src( $child->image_id, 'detail' )[0];
$colour = get_term_meta( $child->term_id, 'color', true ); $colour = get_term_meta( $child->term_id, 'color', true );
$colour = ($colour != "") ? $colour : "transparent"; ?> $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> <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; ?> <?php endforeach; ?>
</ul> </ul>
<?php else : ?> <?php else : ?>
@ -167,9 +191,10 @@
if ( $loop->have_posts() ) : if ( $loop->have_posts() ) :
echo '<section id="' . $currSec . '" class="org-items row">'; 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 '<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">'; echo '<div class="index">';
while (($loop->have_posts()) && ($i++ < 4)) : $loop->the_post(); while ( ( $loop->have_posts() ) && ( $i++ < 4 ) ) :
$loop->the_post();
get_template_part( 'template-parts/content', get_post_format() ); get_template_part( 'template-parts/content', get_post_format() );
endwhile; endwhile;
echo '</div>'; echo '</div>';
@ -183,7 +208,8 @@
echo '<h2 class="subheading">Qualifications</h2>'; echo '<h2 class="subheading">Qualifications</h2>';
if ( $loop->have_posts() ) : if ( $loop->have_posts() ) :
echo '<ul class="index">'; echo '<ul class="index">';
while ($loop->have_posts()) : $loop->the_post(); while ( $loop->have_posts() ) :
$loop->the_post();
$url = esc_url( get_permalink() ); $url = esc_url( get_permalink() );
echo '<li><a href="' . $url . '">' . get_the_title() . '</a></li>'; echo '<li><a href="' . $url . '">' . get_the_title() . '</a></li>';
endwhile; endwhile;
@ -199,7 +225,8 @@
echo '<h2 class="subheading">Awards</h2>'; echo '<h2 class="subheading">Awards</h2>';
if ( $loop->have_posts() ) : if ( $loop->have_posts() ) :
echo '<ul class="index">'; echo '<ul class="index">';
while ($loop->have_posts()) : $loop->the_post(); while ( $loop->have_posts() ) :
$loop->the_post();
$url = esc_url( get_permalink() ); $url = esc_url( get_permalink() );
echo '<li><a href="' . $url . '">' . get_the_title() . '</a></li>'; echo '<li><a href="' . $url . '">' . get_the_title() . '</a></li>';
endwhile; endwhile;
@ -216,7 +243,8 @@
echo '<section id="appearances" class="org-items row">'; 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 '<h2 class="subheading">Appearances <a href="/appearance?company=' . get_queried_object()->slug . '">View all ' . $loop->post_count . '</a></h2>';
echo '<div class="index">'; echo '<div class="index">';
while (($loop->have_posts())) : $loop->the_post(); while ( ( $loop->have_posts() ) ) :
$loop->the_post();
get_template_part( 'template-parts/content', get_post_format() ); get_template_part( 'template-parts/content', get_post_format() );
endwhile; endwhile;
echo '</div>'; echo '</div>';
@ -229,7 +257,8 @@
echo '<section id="correspondence" class="org-items row">'; 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 '<h2 class="subheading">Correspondence <a href="/correspondence?company=' . get_queried_object()->slug . '">View all ' . $loop->post_count . '</a></h2>';
echo '<div class="index">'; echo '<div class="index">';
while (($loop->have_posts())) : $loop->the_post(); while ( ( $loop->have_posts() ) ) :
$loop->the_post();
get_template_part( 'template-parts/content', get_post_format() ); get_template_part( 'template-parts/content', get_post_format() );
endwhile; endwhile;
echo '</div>'; echo '</div>';

View file

@ -13,7 +13,7 @@
<div> <div>
<h1 id="post-title"><?php echo get_the_title(); ?></h1> <h1 id="post-title"><?php echo get_the_title(); ?></h1>
<?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?> <?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?>
<h2 id="post-subtitle"><?php echo $subtitle ?></h2> <h2 id="post-subtitle"><?php echo $subtitle; ?></h2>
<?php endif; ?> <?php endif; ?>
</div> </div>
</header><!-- .entry-header --> </header><!-- .entry-header -->

View file

@ -13,7 +13,7 @@
<div> <div>
<h1 id="post-title"><?php echo get_the_title(); ?></h1> <h1 id="post-title"><?php echo get_the_title(); ?></h1>
<?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?> <?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?>
<h2 id="post-subtitle"><?php echo $subtitle ?></h2> <h2 id="post-subtitle"><?php echo $subtitle; ?></h2>
<?php endif; ?> <?php endif; ?>
<?php // the_date('F j\<\s\u\p\>S\<\/\s\u\p\>, 1,Y \H\.\E\.', '<h3>', '</h3>'); ?> <?php // the_date('F j\<\s\u\p\>S\<\/\s\u\p\>, 1,Y \H\.\E\.', '<h3>', '</h3>'); ?>
</div> </div>
@ -26,13 +26,17 @@
<div id="details"> <div id="details">
<ul> <ul>
<?php <?php
if (has_category('thoughts')) $type = "thought"; if ( has_category( 'thoughts' ) ) {
else if (has_category('reports')) $type = "report"; $type = 'thought';
else if (has_category('review')) $type = "review"; } else if ( has_category( 'reports' ) ) {
$type = 'report';
} else if ( has_category( 'review' ) ) {
$type = 'review';
}
if ( has_category( 'series' ) ) { if ( has_category( 'series' ) ) {
$catag = "is a part of the following series"; $catag = 'is a part of the following series';
$series = []; $series = array();
$s = get_category_by_slug( 'series' ); $s = get_category_by_slug( 'series' );
$seriesIDs = get_term_children( $s->term_id, 'category' ); $seriesIDs = get_term_children( $s->term_id, 'category' );
@ -41,11 +45,15 @@
array_push( $series, get_category( $thisSeriesID ) ); array_push( $series, get_category( $thisSeriesID ) );
} }
} }
if (count($series) > 1) $catag .= "&rsquo;"; if ( count( $series ) > 1 ) {
$punct = ":"; $catag .= '&rsquo;';
}
$punct = ':';
foreach ( $series as $thisSeries ) { foreach ( $series as $thisSeries ) {
$catag .= $punct . ' '; $catag .= $punct . ' ';
if ($punct == ":") $punct = ";"; if ( $punct == ':' ) {
$punct = ';';
}
$catag .= '<a href="/category/series/' . $thisSeries->slug . '">' . $thisSeries->name . '</a>'; $catag .= '<a href="/category/series/' . $thisSeries->slug . '">' . $thisSeries->name . '</a>';
} }
$catag .= '.'; $catag .= '.';
@ -61,10 +69,10 @@
<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> <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 endif; ?>
<?php if ( $notes = get_post_meta( get_the_ID(), 'Note(s)', true ) ) : ?> <?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 endif; ?>
<?php if ( $license = get_post_meta( get_the_ID(), 'License', true ) ) : ?> <?php if ( $license = get_post_meta( get_the_ID(), 'License', true ) ) : ?>
<li>This work is licensed under <?php echo $license ?>. <a href="/2018/03/copywrong/">Sorry about that</a>.</li> <li>This work is licensed under <?php echo $license; ?>. <a href="/2018/03/copywrong/">Sorry about that</a>.</li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
</div> </div>
@ -87,7 +95,7 @@
<ol> <ol>
<?php $i = 1; ?> <?php $i = 1; ?>
<?php while ( $content = get_post_meta( get_the_ID(), 'ToC' . $i, true ) ) : ?> <?php while ( $content = get_post_meta( get_the_ID(), 'ToC' . $i, true ) ) : ?>
<li><a href="#section-<?php echo $i++ ?>"><?php echo $content ?></a></li> <li><a href="#section-<?php echo $i++; ?>"><?php echo $content; ?></a></li>
<?php endwhile; ?> <?php endwhile; ?>
</ol> </ol>
</section> </section>
@ -96,8 +104,8 @@
<section id="post-tags"> <section id="post-tags">
<h2>Tags</h2> <h2>Tags</h2>
<?php foreach ( $tags as $tag ) : ?> <?php foreach ( $tags as $tag ) : ?>
<a href="<?php echo get_tag_link($tag->term_id) ?>" title="<?php echo $tag->name ?> Tag" class="tag-link"> <a href="<?php echo get_tag_link( $tag->term_id ); ?>" title="<?php echo $tag->name; ?> Tag" class="tag-link">
<?php echo $tag->name ?> <?php echo $tag->name; ?>
</a> </a>
<?php endforeach; ?> <?php endforeach; ?>
</section> </section>

View file

@ -11,14 +11,18 @@
<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"' : ''; ?>> <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(); ?>');"> <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 <?php
if (strlen(get_the_title()) > 70) $small= "vsmall"; if ( strlen( get_the_title() ) > 70 ) {
elseif (strlen(get_the_title()) > 35) $small = "small"; $small = 'vsmall';
elseif (strlen(get_the_title()) > 12) $small = "qsmall"; } elseif ( strlen( get_the_title() ) > 35 ) {
$small = 'small';
} elseif ( strlen( get_the_title() ) > 12 ) {
$small = 'qsmall';
}
?> ?>
<header> <header>
<h1 class="<?php echo $small ?> post-title"><?php echo get_the_title(); ?></h1> <h1 class="<?php echo $small; ?> post-title"><?php echo get_the_title(); ?></h1>
<?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?> <?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?>
<h2><?php echo $subtitle ?></h2> <h2><?php echo $subtitle; ?></h2>
<?php endif; ?> <?php endif; ?>
</header> </header>
</article><!-- #post-## --> </article><!-- #post-## -->

View file

@ -9,26 +9,29 @@
get_header(); get_header();
?> ?>
<?php <?php
function withinDates($jSDate, $jEDate) function withinDates( $jSDate, $jEDate ) {
{ $endYear = date( 'Y' );
$endYear = date("Y"); $endDate = $endYear . '-12-31';
$endDate = $endYear . "-12-31"; $startDate = ( $endYear - 2 ) . '-01-01';
$startDate = ($endYear - 2) . "-01-01";
$jEDate = ( ! $jEDate ) ? date( 'Y-m-d' ) : ( ( $jEDate > $endDate ) ? $endDate : $jEDate ); $jEDate = ( ! $jEDate ) ? date( 'Y-m-d' ) : ( ( $jEDate > $endDate ) ? $endDate : $jEDate );
return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) ); return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) );
} }
$args = array( $args = array(
'post_type' => array( 'post_type' => array(
'job' 'job',
), ),
'posts_per_page' => -1 'posts_per_page' => -1,
); );
$loop = new WP_Query( $args ); $loop = new WP_Query( $args );
?> ?>
<header class="post-header-title"> <header class="post-header-title">
<h1 id="page-title">Experience</h1> <h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">or, a brief history of Ben</h2> <h2 id="page-subtitle">or, a brief history of Ben</h2>
<?php while (have_posts()): the_post(); ?> <?php
while ( have_posts() ) :
the_post();
?>
<div class="entry-content tile" id="taxonomy-description"> <div class="entry-content tile" id="taxonomy-description">
<?php the_content(); ?> <?php the_content(); ?>
</div> </div>
@ -57,21 +60,26 @@
dataTable.addColumn({ type: 'date', id: 'End' }); dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([ dataTable.addRows([
<?php <?php
while ($loop->have_posts()): $loop->the_post(); while ( $loop->have_posts() ) :
$loop->the_post();
?> ?>
<?php <?php
$isCurrent = ( get_post_meta( get_the_ID(), 'end-date', true ) ) ? false : true; $isCurrent = ( get_post_meta( get_the_ID(), 'end-date', true ) ) ? false : true;
$company = wp_get_object_terms(get_the_ID(), 'company', array( $company = wp_get_object_terms(
'fields' => 'names' get_the_ID(),
)); 'company',
array(
'fields' => 'names',
)
);
$title = html_entity_decode( get_the_title() ); $title = html_entity_decode( get_the_title() );
$start = get_the_date(); $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 ); $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 ( $isCurrent ) ? 'Current' : 'Current'; ?>',
'<?php echo $title . ', ' . html_entity_decode( $company[0] ); ?>', '<?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>', '<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 $start; ?>'),
new Date('<?php echo $end; ?>') new Date('<?php echo $end; ?>')
], ],