diff --git a/404.php b/404.php index aa1fe9f..deeee6e 100644 --- a/404.php +++ b/404.php @@ -1,11 +1,11 @@ diff --git a/archive.php b/archive.php index f9833a9..9b87f07 100644 --- a/archive.php +++ b/archive.php @@ -1,57 +1,62 @@
-

.

- ' ', - 'mid_size' => 20, - 'prev_text' => '', - 'next_text' => '', - )); - ?> +

.

+ ' ', + 'mid_size' => 20, + 'prev_text' => '', + 'next_text' => '', + ) + ); + ?>
- + // If no content, include the "No posts found" template. + else : + get_template_part( 'template-parts/content', 'none' ); + endif; + ?>
diff --git a/centred-page.php b/centred-page.php index df30a56..7249b9d 100644 --- a/centred-page.php +++ b/centred-page.php @@ -1,23 +1,26 @@
- +

diff --git a/comments.php b/comments.php index b981b27..8d72050 100644 --- a/comments.php +++ b/comments.php @@ -1,53 +1,59 @@
-
+

Replies

- + -
    - 'ol', - 'short_ping' => true, - 'avatar_size' => 42, - )); - ?> -
+
    + 'ol', + 'short_ping' => true, + 'avatar_size' => 42, + ) + ); + ?> +
- - -

No comments yet.

+ + +

No comments yet.

- -

+ +

-
- -
- '

', - 'title_reply_after' => '

', - )); - ?> -
+
+ +
+ '

', + 'title_reply_after' => '

', + ) + ); + ?> +
diff --git a/footer.php b/footer.php index 7ab589e..5b3f2af 100644 --- a/footer.php +++ b/footer.php @@ -1,13 +1,13 @@ - + - + link.innerHTML = (link.innerHTML == linkText[0]) ? linkText[1] : linkText[0]; + } + + diff --git a/functions.php b/functions.php index 2e1d63e..c0dd789 100644 --- a/functions.php +++ b/functions.php @@ -55,7 +55,7 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) : * to change 'omphaloskepsis' to the name of your theme in all the template files */ load_theme_textdomain( 'omphaloskepsis', get_template_directory() . '/languages' ); - + // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); @@ -72,11 +72,14 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) : * * @since Omphaloskepsis 1.2 */ - add_theme_support( 'custom-logo', array( - 'height' => 2256, - 'width' => 1622, - 'flex-height' => true, - ) ); + add_theme_support( + 'custom-logo', + array( + 'height' => 2256, + 'width' => 1622, + 'flex-height' => true, + ) + ); /* * Enable support for Post Thumbnails on posts and pages. @@ -87,62 +90,73 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) : set_post_thumbnail_size( 1200, 9999 ); // This theme uses wp_nav_menu() in two locations. - register_nav_menus( array( - 'primary' => __( 'Primary Menu', 'omphaloskepsis' ), - 'social' => __( 'Social Links Menu', 'omphaloskepsis' ), - ) ); - - function omphaloskepsis_infinite_scroll_init() { - add_theme_support( 'infinite-scroll', array( - 'container' => 'main', - 'render' => 'omphaloskepsis_infinite_scroll_render', - 'footer' => 'colophon', - ) ); -} + register_nav_menus( + array( + 'primary' => __( 'Primary Menu', 'omphaloskepsis' ), + 'social' => __( 'Social Links Menu', 'omphaloskepsis' ), + ) + ); -add_action( 'init', 'omphaloskepsis_infinite_scroll_init' ); -/** - * Custom render function for Infinite Scroll. - */ -function omphaloskepsis_infinite_scroll_render() { - while ( have_posts() ) { - the_post(); - if ( is_search() ) { - get_template_part( 'template-parts/content', 'search' ); - } else { - get_template_part( 'template-parts/content', get_post_format() ); + function omphaloskepsis_infinite_scroll_init() { + add_theme_support( + 'infinite-scroll', + array( + 'container' => 'main', + 'render' => 'omphaloskepsis_infinite_scroll_render', + 'footer' => 'colophon', + ) + ); + } + + add_action( 'init', 'omphaloskepsis_infinite_scroll_init' ); + /** + * Custom render function for Infinite Scroll. + */ + function omphaloskepsis_infinite_scroll_render() { + while ( have_posts() ) { + the_post(); + if ( is_search() ) { + get_template_part( 'template-parts/content', 'search' ); + } else { + get_template_part( 'template-parts/content', get_post_format() ); + } + } } - } -} /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ - add_theme_support( 'html5', array( - 'search-form', - 'comment-form', - 'comment-list', - 'gallery', - 'caption', - ) ); + add_theme_support( + 'html5', + array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) + ); /* * Enable support for Post Formats. * * See: https://codex.wordpress.org/Post_Formats */ - add_theme_support( 'post-formats', array( - 'aside', - 'image', - 'video', - 'quote', - 'link', - 'gallery', - 'status', - 'audio', - 'chat', - ) ); + add_theme_support( + 'post-formats', + array( + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'status', + 'audio', + 'chat', + ) + ); /* * This theme styles the visual editor to resemble the theme style, @@ -178,35 +192,41 @@ add_action( 'after_setup_theme', 'omphaloskepsis_content_width', 0 ); * @since Omphaloskepsis 1.0 */ function omphaloskepsis_widgets_init() { - register_sidebar( array( - 'name' => __( 'Sidebar', 'omphaloskepsis' ), - 'id' => 'sidebar-1', - 'description' => __( 'Add widgets here to appear in your sidebar.', 'omphaloskepsis' ), - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '

', - 'after_title' => '

', - ) ); + register_sidebar( + array( + 'name' => __( 'Sidebar', 'omphaloskepsis' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar.', 'omphaloskepsis' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) + ); - register_sidebar( array( - 'name' => __( 'Content Bottom 1', 'omphaloskepsis' ), - 'id' => 'sidebar-2', - 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ), - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '

', - 'after_title' => '

', - ) ); + register_sidebar( + array( + 'name' => __( 'Content Bottom 1', 'omphaloskepsis' ), + 'id' => 'sidebar-2', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) + ); - register_sidebar( array( - 'name' => __( 'Content Bottom 2', 'omphaloskepsis' ), - 'id' => 'sidebar-3', - 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ), - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '

', - 'after_title' => '

', - ) ); + register_sidebar( + array( + 'name' => __( 'Content Bottom 2', 'omphaloskepsis' ), + 'id' => 'sidebar-3', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) + ); } add_action( 'widgets_init', 'omphaloskepsis_widgets_init' ); @@ -241,10 +261,13 @@ if ( ! function_exists( 'omphaloskepsis_fonts_url' ) ) : } if ( $fonts ) { - $fonts_url = add_query_arg( array( - 'family' => urlencode( implode( '|', $fonts ) ), - 'subset' => urlencode( $subsets ), - ), 'https://fonts.googleapis.com/css' ); + $fonts_url = add_query_arg( + array( + 'family' => urlencode( implode( '|', $fonts ) ), + 'subset' => urlencode( $subsets ), + ), + 'https://fonts.googleapis.com/css' + ); } return $fonts_url; @@ -270,8 +293,8 @@ add_action( 'wp_head', 'omphaloskepsis_javascript_detection', 0 ); */ function omphaloskepsis_scripts() { // Load the normalisation stylesheet. - wp_enqueue_style( 'omphaloskepsis-reset', get_template_directory_uri() . '/css/reset.css', array( ), null ); - + wp_enqueue_style( 'omphaloskepsis-reset', get_template_directory_uri() . '/css/reset.css', array(), null ); + wp_style_add_data( 'omphaloskepsis-ie', 'conditional', 'lt IE 10' ); // Add custom fonts, used in the main stylesheet. wp_enqueue_style( 'omphaloskepsis-fonts', omphaloskepsis_fonts_url(), array(), null ); @@ -281,10 +304,10 @@ function omphaloskepsis_scripts() { // Theme stylesheet. wp_enqueue_style( 'omphaloskepsis-style', get_stylesheet_uri() ); - - wp_enqueue_style('font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'); - - wp_enqueue_style( 'montserrat', "https://fonts.googleapis.com/css?family=Montserrat" ); + + wp_enqueue_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' ); + + wp_enqueue_style( 'montserrat', 'https://fonts.googleapis.com/css?family=Montserrat' ); // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'omphaloskepsis-ie', get_template_directory_uri() . '/css/ie.css', array( 'omphaloskepsis-style' ), '20160412' ); @@ -314,10 +337,14 @@ function omphaloskepsis_scripts() { wp_enqueue_script( 'omphaloskepsis-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160412', true ); - wp_localize_script( 'omphaloskepsis-script', 'screenReaderText', array( - 'expand' => __( 'expand child menu', 'omphaloskepsis' ), - 'collapse' => __( 'collapse child menu', 'omphaloskepsis' ), - ) ); + wp_localize_script( + 'omphaloskepsis-script', + 'screenReaderText', + array( + 'expand' => __( 'expand child menu', 'omphaloskepsis' ), + 'collapse' => __( 'collapse child menu', 'omphaloskepsis' ), + ) + ); } add_action( 'wp_enqueue_scripts', 'omphaloskepsis_scripts' ); @@ -367,9 +394,9 @@ function omphaloskepsis_hex2rgb( $color ) { $color = trim( $color, '#' ); if ( strlen( $color ) === 3 ) { - $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) ); - $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) ); - $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) ); + $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); + $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); + $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); } else if ( strlen( $color ) === 6 ) { $r = hexdec( substr( $color, 0, 2 ) ); $g = hexdec( substr( $color, 2, 2 ) ); @@ -378,7 +405,11 @@ function omphaloskepsis_hex2rgb( $color ) { return array(); } - return array( 'red' => $r, 'green' => $g, 'blue' => $b ); + return array( + 'red' => $r, + 'green' => $g, + 'blue' => $b, + ); } /** @@ -416,7 +447,7 @@ function omphaloskepsis_content_image_sizes_attr( $sizes, $size ) { return $sizes; } -add_filter( 'wp_calculate_image_sizes', 'omphaloskepsis_content_image_sizes_attr', 10 , 2 ); +add_filter( 'wp_calculate_image_sizes', 'omphaloskepsis_content_image_sizes_attr', 10, 2 ); /** * Add custom image sizes attribute to enhance responsive image functionality @@ -436,7 +467,7 @@ function omphaloskepsis_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { } return $attr; } -add_filter( 'wp_get_attachment_image_attributes', 'omphaloskepsis_post_thumbnail_sizes_attr', 10 , 3 ); +add_filter( 'wp_get_attachment_image_attributes', 'omphaloskepsis_post_thumbnail_sizes_attr', 10, 3 ); /** * Modifies tag cloud widget arguments to have all tags in the widget same font size. @@ -447,219 +478,243 @@ add_filter( 'wp_get_attachment_image_attributes', 'omphaloskepsis_post_thumbnail * @return array A new modified arguments. */ function omphaloskepsis_widget_tag_cloud_args( $args ) { - $args['largest'] = 1; - $args['smallest'] = 1; - $args['unit'] = 'em'; - return $args; + $args['largest'] = 1; + $args['smallest'] = 1; + $args['unit'] = 'em'; + return $args; } add_filter( 'widget_tag_cloud_args', 'omphaloskepsis_widget_tag_cloud_args' ); -function clean_script_tag($input) { - $input = str_replace("type='text/javascript' ", '', $input); - return str_replace("'", '"', $input); +function clean_script_tag( $input ) { + $input = str_replace( "type='text/javascript' ", '', $input ); + return str_replace( "'", '"', $input ); } -add_filter('script_loader_tag', 'clean_script_tag'); +add_filter( 'script_loader_tag', 'clean_script_tag' ); -function omphaloskepsis_the_content($content) { - global $post; - if ($post->post_type == "program") { - if ($meta = get_post_meta($post->ID, 'Link', true)) - $links = $links . 'Download'; - if ($meta = get_post_meta($post->ID, 'Documentation', true)) - $links = $links . 'Documentation'; - if ($meta = get_post_meta($post->ID, 'Repo', true)) - $links = $links . 'Repo'; - if ($meta = get_post_meta($post->ID, 'Licence', true)) - $links = $links . 'Licence'; - if ($meta = get_post_meta($post->ID, 'MD5', true)) - $links = $links . '

MD5 checksum: '.$meta.'

'; - return $content . $links; - } elseif ($post->post_type == "website") { - if ($meta = get_post_meta($post->ID, 'Link', true)) - $links = $links . 'Visit'; - if ($meta = get_post_meta($post->ID, 'Repo', true)) - $links = $links . 'Repo'; - if ($meta = get_post_meta($post->ID, 'Licence', true)) - $links = $links . 'Licence'; - return $content . $links; - } elseif ($post->post_type == "writing") { - if ($meta = get_post_meta($post->ID, 'Link', true)) - $links = $links . 'Read'; - if ($meta = get_post_meta($post->ID, 'Licence', true)) - $links = $links . 'Licence'; - return $content . $links; - } elseif ($post->post_type == "other") { - if ($meta = get_post_meta($post->ID, 'Link', true)) - $links = $links . 'Download'; - return $content . $links; - } - return $content; +function omphaloskepsis_the_content( $content ) { + global $post; + if ( $post->post_type == 'program' ) { + if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) { + $links = $links . 'Download'; + } + if ( $meta = get_post_meta( $post->ID, 'Documentation', true ) ) { + $links = $links . 'Documentation'; + } + if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) { + $links = $links . 'Repo'; + } + if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) { + $links = $links . 'Licence'; + } + if ( $meta = get_post_meta( $post->ID, 'MD5', true ) ) { + $links = $links . '

MD5 checksum: ' . $meta . '

'; + } + return $content . $links; + } elseif ( $post->post_type == 'website' ) { + if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) { + $links = $links . 'Visit'; + } + if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) { + $links = $links . 'Repo'; + } + if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) { + $links = $links . 'Licence'; + } + return $content . $links; + } elseif ( $post->post_type == 'writing' ) { + if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) { + $links = $links . 'Read'; + } + if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) { + $links = $links . 'Licence'; + } + return $content . $links; + } elseif ( $post->post_type == 'other' ) { + if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) { + $links = $links . 'Download'; + } + return $content . $links; + } + return $content; } -add_filter('the_content', 'omphaloskepsis_the_content', 10); +add_filter( 'the_content', 'omphaloskepsis_the_content', 10 ); add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' ); function load_dashicons_front_end() { - wp_enqueue_style( 'dashicons' ); + wp_enqueue_style( 'dashicons' ); } function display_companies() { - echo ''; - echo 'Organisation'; - echo 'Children'; - echo 'Associated Items'; - echo ''; - - if ($_POST['toplevel'] == "true") { - // Gets all of the top-level company terms. - $terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company', 'term_args' => array('parent' => 0))); - $include = 1; - } else { - // Gets all of the company terms. - $terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company',)); - $include = 0; - } - - if(!empty($terms)) { - foreach($terms as $term) { - $term_children = get_term_children($term->term_id, "company"); - - // 0 = Jobs - // 1 = Blog Posts - // 2 = Websites - // 3 = Programs - // 4 = Writings - // 5 = Videos - // 6 = Others - // 7 = Qualifications - // 8 = Awards - $post_types = array('job', 'post', 'website', 'program', 'writing', 'video', 'other', 'qualification', 'award'); - $dashicons = array('hammer', 'admin-post', 'schedule', 'desktop', 'format-aside', 'video-alt', 'archive', 'id', 'awards'); - $term_items = array(); - $term_item_counts = array(); + echo ''; + echo 'Organisation'; + echo 'Children'; + echo 'Associated Items'; + echo ''; - - - foreach ($post_types as $post_type) { - $args = array( - 'posts_per_page' => -1, - 'post_type' => $post_type, - 'tax_query' => array( - array( - 'taxonomy' => 'company', - 'field' => 'slug', - 'terms' => $term->slug, - 'include_children' => $include, - ), - ), - 'meta_query' => array(), - ); - - if ($_POST['currentjobs'] == "true" && $post_type == "job") { - $args['meta_query'] = array( - array( - 'key' => 'end-date', - 'compare' => 'NOT EXISTS', - 'value' => '1', - ), - ); - } - - if ($_POST['showexpired'] != "true" && $post_type == "qualification") { - $args['meta_query'] = array( - array( - 'key' => 'Expired', - 'compare' => 'NOT EXISTS', - 'value' => '1', - ), - ); - } + if ( $_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; + } - $posts = get_posts($args); + if ( ! empty( $terms ) ) { + foreach ( $terms as $term ) { + $term_children = get_term_children( $term->term_id, 'company' ); - array_push($term_items, $posts); - array_push($term_item_counts, count($posts)); - } - - if(($_POST['job'] == "true" && $term_item_counts[0] > 0) || - ($_POST['post'] == "true" && $term_item_counts[1] > 0) || - ($_POST['website'] == "true" && $term_item_counts[2] > 0) || - ($_POST['program'] == "true" && $term_item_counts[3] > 0) || - ($_POST['writing'] == "true" && $term_item_counts[4] > 0) || - ($_POST['video'] == "true" && $term_item_counts[5] > 0) || - ($_POST['other'] == "true" && $term_item_counts[6] > 0) || - ($_POST['qualification'] == "true" && $term_item_counts[7] > 0) || - ($_POST['award'] == "true" && $term_item_counts[8] > 0)) { - $imgURL = wp_get_attachment_image_src($term->image_id, 'full')[0]; - $bgImg = (!$imgURL) ? "" : " background-image: url(".strtok($imgURL, '?').");"; - $colour = get_term_meta($term->term_id, 'color', true); - $colour = ($colour != "") ? $colour : "transparent"; - - echo ''; - echo ''; - echo ''; - echo ''.$term->name.' logo'; - echo ''; - echo ''; - - echo ''; - echo ''; - echo '

'.$term->name.'

'; - echo '
'; - echo ''; - - echo ''; - $num = (count($term_children) > 0) ? "" : "none"; - echo '
'; - echo '
'.count($term_children); - echo '
'; - echo ''; - - echo ''; - $i = 0; - foreach ($post_types as $post_type) { - $num = ($term_item_counts[$i] > 0) ? "" : "none"; - echo '
'; - echo '
'.$term_item_counts[$i]; - echo '
'; - $i++; - }; - echo ''; - echo ''; - - /* - echo ''; - echo '
  • '; - echo '
    '; - if (count($term_children) > 0) { - echo '
    '; - echo count($term_children).'
    '; - echo '
    '; - } - echo '
    '; - - echo '
    '; - $i = 0; - foreach ($post_types as $post_type) { - if ($_POST[$post_type] == "true") { - echo '
    '; - echo $term_item_counts[$i].''; - echo '
    '; - } - $i++; - } - echo '
    '; - if (!$imgURL) echo '

    '.$term->name.'

    '; - echo '
  • '; - echo '
    '; - */ - } - } - } else { - echo '

    No companies found

    '; - } + // 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(); - die(); + foreach ( $post_types as $post_type ) { + $args = array( + 'posts_per_page' => -1, + 'post_type' => $post_type, + 'tax_query' => array( + array( + 'taxonomy' => 'company', + 'field' => 'slug', + 'terms' => $term->slug, + 'include_children' => $include, + ), + ), + 'meta_query' => array(), + ); + + if ( $_POST['currentjobs'] == 'true' && $post_type == 'job' ) { + $args['meta_query'] = array( + array( + 'key' => 'end-date', + 'compare' => 'NOT EXISTS', + 'value' => '1', + ), + ); + } + + if ( $_POST['showexpired'] != 'true' && $post_type == 'qualification' ) { + $args['meta_query'] = array( + array( + 'key' => 'Expired', + 'compare' => 'NOT EXISTS', + 'value' => '1', + ), + ); + } + + $posts = get_posts( $args ); + + array_push( $term_items, $posts ); + array_push( $term_item_counts, count( $posts ) ); + } + + if ( ( $_POST['job'] == 'true' && $term_item_counts[0] > 0 ) || + ( $_POST['post'] == 'true' && $term_item_counts[1] > 0 ) || + ( $_POST['website'] == 'true' && $term_item_counts[2] > 0 ) || + ( $_POST['program'] == 'true' && $term_item_counts[3] > 0 ) || + ( $_POST['writing'] == 'true' && $term_item_counts[4] > 0 ) || + ( $_POST['video'] == 'true' && $term_item_counts[5] > 0 ) || + ( $_POST['other'] == 'true' && $term_item_counts[6] > 0 ) || + ( $_POST['qualification'] == 'true' && $term_item_counts[7] > 0 ) || + ( $_POST['award'] == 'true' && $term_item_counts[8] > 0 ) ) { + $imgURL = wp_get_attachment_image_src( $term->image_id, 'full' )[0]; + $bgImg = ( ! $imgURL ) ? '' : ' background-image: url(' . strtok( $imgURL, '?' ) . ');'; + $colour = get_term_meta( $term->term_id, 'color', true ); + $colour = ( $colour != '' ) ? $colour : 'transparent'; + + echo ''; + echo ''; + echo ''; + echo '' . $term->name . ' logo'; + echo ''; + echo ''; + + echo ''; + echo ''; + echo '

    ' . $term->name . '

    '; + echo '
    '; + echo ''; + + echo ''; + $num = ( count( $term_children ) > 0 ) ? '' : 'none'; + echo '
    '; + echo '
    ' . count( $term_children ); + echo '
    '; + echo ''; + + echo ''; + $i = 0; + foreach ( $post_types as $post_type ) { + $num = ( $term_item_counts[ $i ] > 0 ) ? '' : 'none'; + echo '
    '; + echo '
    ' . $term_item_counts[ $i ]; + echo '
    '; + $i++; + }; + echo ''; + echo ''; + + /* + echo ''; + echo '
  • '; + echo '
    '; + if (count($term_children) > 0) { + echo '
    '; + echo count($term_children).'
    '; + echo '
    '; + } + echo '
    '; + + echo '
    '; + $i = 0; + foreach ($post_types as $post_type) { + if ($_POST[$post_type] == "true") { + echo '
    '; + echo $term_item_counts[$i].''; + echo '
    '; + } + $i++; + } + echo '
    '; + if (!$imgURL) echo '

    '.$term->name.'

    '; + echo '
  • '; + echo '
    '; + */ + } + } + } else { + echo '

    No companies found

    '; + } + + die(); } -add_action('wp_ajax_display_companies', 'display_companies'); -add_action('wp_ajax_nopriv_display_companies', 'display_companies'); +add_action( 'wp_ajax_display_companies', 'display_companies' ); +add_action( 'wp_ajax_nopriv_display_companies', 'display_companies' ); diff --git a/header.php b/header.php index 106e608..e80dde8 100644 --- a/header.php +++ b/header.php @@ -1,40 +1,40 @@ class="no-js"> - - - - - + + + + + - + - + - - + + id="site-wrapper"> - + - + diff --git a/home.php b/home.php index 3683f01..2489dbc 100644 --- a/home.php +++ b/home.php @@ -1,61 +1,66 @@
    -

    Blog.

    -

    All / Thoughts / Reports / Reviews / Projects

    - ' ', - 'mid_size' => 20, - 'prev_text' => '', - 'next_text' => '', - )); - ?> +

    Blog.

    +

    All / Thoughts / Reports / Reviews / Projects

    + ' ', + 'mid_size' => 20, + 'prev_text' => '', + 'next_text' => '', + ) + ); + ?>
    - + // If no content, include the "No posts found" template. + else : + get_template_part( 'template-parts/content', 'none' ); + endif; + ?>
    - ' ', - 'mid_size' => 20, - 'prev_text' => '', - 'next_text' => '', - )); - ?> + ' ', + 'mid_size' => 20, + 'prev_text' => '', + 'next_text' => '', + ) + ); + ?>
    - + diff --git a/inc/back-compat.php b/inc/back-compat.php index 7ed4240..c97940e 100644 --- a/inc/back-compat.php +++ b/inc/back-compat.php @@ -50,9 +50,13 @@ function twentysixteen_upgrade_notice() { * @global string $wp_version WordPress version. */ function twentysixteen_customize() { - wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), '', array( - 'back_link' => true, - ) ); + wp_die( + sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), + '', + array( + 'back_link' => true, + ) + ); } add_action( 'load-customize.php', 'twentysixteen_customize' ); diff --git a/inc/customizer.php b/inc/customizer.php index 794752d..e46ac05 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -30,9 +30,15 @@ function twentysixteen_custom_header_and_background() { * @type string $default-color Default color of the background. * } */ - add_theme_support( 'custom-background', apply_filters( 'twentysixteen_custom_background_args', array( - 'default-color' => $default_background_color, - ) ) ); + add_theme_support( + 'custom-background', + apply_filters( + 'twentysixteen_custom_background_args', + array( + 'default-color' => $default_background_color, + ) + ) + ); /** * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen. @@ -50,34 +56,40 @@ function twentysixteen_custom_header_and_background() { * displayed on the blog. * } */ - add_theme_support( 'custom-header', apply_filters( 'twentysixteen_custom_header_args', array( - 'default-text-color' => $default_text_color, - 'width' => 1200, - 'height' => 280, - 'flex-height' => true, - 'wp-head-callback' => 'twentysixteen_header_style', - ) ) ); + add_theme_support( + 'custom-header', + apply_filters( + 'twentysixteen_custom_header_args', + array( + 'default-text-color' => $default_text_color, + 'width' => 1200, + 'height' => 280, + 'flex-height' => true, + 'wp-head-callback' => 'twentysixteen_header_style', + ) + ) + ); } add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' ); if ( ! function_exists( 'twentysixteen_header_style' ) ) : -/** - * Styles the header text displayed on the site. - * - * Create your own twentysixteen_header_style() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @see twentysixteen_custom_header_and_background(). - */ -function twentysixteen_header_style() { - // If the header text option is untouched, let's bail. - if ( display_header_text() ) { - return; - } + /** + * Styles the header text displayed on the site. + * + * Create your own twentysixteen_header_style() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @see twentysixteen_custom_header_and_background(). + */ + function twentysixteen_header_style() { + // If the header text option is untouched, let's bail. + if ( display_header_text() ) { + return; + } - // If the header text has been hidden. - ?> + // If the header text has been hidden. + ?> - get_setting( 'blogdescription' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( 'blogname', array( - 'selector' => '.site-title a', - 'container_inclusive' => false, - 'render_callback' => 'twentysixteen_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'container_inclusive' => false, - 'render_callback' => 'twentysixteen_customize_partial_blogdescription', - ) ); + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogdescription', + ) + ); } // Add color scheme setting and control. - $wp_customize->add_setting( 'color_scheme', array( - 'default' => 'default', - 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'color_scheme', + array( + 'default' => 'default', + 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( 'color_scheme', array( - 'label' => __( 'Base Color Scheme', 'twentysixteen' ), - 'section' => 'colors', - 'type' => 'select', - 'choices' => twentysixteen_get_color_scheme_choices(), - 'priority' => 1, - ) ); + $wp_customize->add_control( + 'color_scheme', + array( + 'label' => __( 'Base Color Scheme', 'twentysixteen' ), + 'section' => 'colors', + 'type' => 'select', + 'choices' => twentysixteen_get_color_scheme_choices(), + 'priority' => 1, + ) + ); // Add page background color setting and control. - $wp_customize->add_setting( 'page_background_color', array( - 'default' => $color_scheme[1], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'page_background_color', + array( + 'default' => $color_scheme[1], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'page_background_color', array( - 'label' => __( 'Page Background Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'page_background_color', + array( + 'label' => __( 'Page Background Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Remove the core header textcolor control, as it shares the main text color. $wp_customize->remove_control( 'header_textcolor' ); // Add link color setting and control. - $wp_customize->add_setting( 'link_color', array( - 'default' => $color_scheme[2], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'link_color', + array( + 'default' => $color_scheme[2], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( - 'label' => __( 'Link Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'link_color', + array( + 'label' => __( 'Link Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Add main text color setting and control. - $wp_customize->add_setting( 'main_text_color', array( - 'default' => $color_scheme[3], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'main_text_color', + array( + 'default' => $color_scheme[3], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_text_color', array( - 'label' => __( 'Main Text Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'main_text_color', + array( + 'label' => __( 'Main Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Add secondary text color setting and control. - $wp_customize->add_setting( 'secondary_text_color', array( - 'default' => $color_scheme[4], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'secondary_text_color', + array( + 'default' => $color_scheme[4], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_text_color', array( - 'label' => __( 'Secondary Text Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'secondary_text_color', + array( + 'label' => __( 'Secondary Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); } add_action( 'customize_register', 'twentysixteen_customize_register', 11 ); @@ -248,127 +308,130 @@ function twentysixteen_get_color_schemes() { * } * } */ - return apply_filters( 'twentysixteen_color_schemes', array( - 'default' => array( - 'label' => __( 'Default', 'twentysixteen' ), - 'colors' => array( - '#1a1a1a', - '#ffffff', - '#007acc', - '#1a1a1a', - '#686868', + return apply_filters( + 'twentysixteen_color_schemes', + array( + 'default' => array( + 'label' => __( 'Default', 'twentysixteen' ), + 'colors' => array( + '#1a1a1a', + '#ffffff', + '#007acc', + '#1a1a1a', + '#686868', + ), ), - ), - 'dark' => array( - 'label' => __( 'Dark', 'twentysixteen' ), - 'colors' => array( - '#262626', - '#1a1a1a', - '#9adffd', - '#e5e5e5', - '#c1c1c1', + 'dark' => array( + 'label' => __( 'Dark', 'twentysixteen' ), + 'colors' => array( + '#262626', + '#1a1a1a', + '#9adffd', + '#e5e5e5', + '#c1c1c1', + ), ), - ), - 'gray' => array( - 'label' => __( 'Gray', 'twentysixteen' ), - 'colors' => array( - '#616a73', - '#4d545c', - '#c7c7c7', - '#f2f2f2', - '#f2f2f2', + 'gray' => array( + 'label' => __( 'Gray', 'twentysixteen' ), + 'colors' => array( + '#616a73', + '#4d545c', + '#c7c7c7', + '#f2f2f2', + '#f2f2f2', + ), ), - ), - 'red' => array( - 'label' => __( 'Red', 'twentysixteen' ), - 'colors' => array( - '#ffffff', - '#ff675f', - '#640c1f', - '#402b30', - '#402b30', + 'red' => array( + 'label' => __( 'Red', 'twentysixteen' ), + 'colors' => array( + '#ffffff', + '#ff675f', + '#640c1f', + '#402b30', + '#402b30', + ), ), - ), - 'yellow' => array( - 'label' => __( 'Yellow', 'twentysixteen' ), - 'colors' => array( - '#3b3721', - '#ffef8e', - '#774e24', - '#3b3721', - '#5b4d3e', + 'yellow' => array( + 'label' => __( 'Yellow', 'twentysixteen' ), + 'colors' => array( + '#3b3721', + '#ffef8e', + '#774e24', + '#3b3721', + '#5b4d3e', + ), ), - ), - ) ); + ) + ); } if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) : -/** - * Retrieves the current Twenty Sixteen color scheme. - * - * Create your own twentysixteen_get_color_scheme() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return array An associative array of either the current or default color scheme HEX values. - */ -function twentysixteen_get_color_scheme() { - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); - $color_schemes = twentysixteen_get_color_schemes(); + /** + * Retrieves the current Twenty Sixteen color scheme. + * + * Create your own twentysixteen_get_color_scheme() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array An associative array of either the current or default color scheme HEX values. + */ + function twentysixteen_get_color_scheme() { + $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); + $color_schemes = twentysixteen_get_color_schemes(); - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { - return $color_schemes[ $color_scheme_option ]['colors']; + if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { + return $color_schemes[ $color_scheme_option ]['colors']; + } + + return $color_schemes['default']['colors']; } - - return $color_schemes['default']['colors']; -} endif; // twentysixteen_get_color_scheme if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) : -/** - * Retrieves an array of color scheme choices registered for Twenty Sixteen. - * - * Create your own twentysixteen_get_color_scheme_choices() function to override - * in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return array Array of color schemes. - */ -function twentysixteen_get_color_scheme_choices() { - $color_schemes = twentysixteen_get_color_schemes(); - $color_scheme_control_options = array(); + /** + * Retrieves an array of color scheme choices registered for Twenty Sixteen. + * + * Create your own twentysixteen_get_color_scheme_choices() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array Array of color schemes. + */ + function twentysixteen_get_color_scheme_choices() { + $color_schemes = twentysixteen_get_color_schemes(); + $color_scheme_control_options = array(); - foreach ( $color_schemes as $color_scheme => $value ) { - $color_scheme_control_options[ $color_scheme ] = $value['label']; + foreach ( $color_schemes as $color_scheme => $value ) { + $color_scheme_control_options[ $color_scheme ] = $value['label']; + } + + return $color_scheme_control_options; } - - return $color_scheme_control_options; -} endif; // twentysixteen_get_color_scheme_choices if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) : -/** - * Handles sanitization for Twenty Sixteen color schemes. - * - * Create your own twentysixteen_sanitize_color_scheme() function to override - * in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @param string $value Color scheme name value. - * @return string Color scheme name. - */ -function twentysixteen_sanitize_color_scheme( $value ) { - $color_schemes = twentysixteen_get_color_scheme_choices(); + /** + * Handles sanitization for Twenty Sixteen color schemes. + * + * Create your own twentysixteen_sanitize_color_scheme() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @param string $value Color scheme name value. + * @return string Color scheme name. + */ + function twentysixteen_sanitize_color_scheme( $value ) { + $color_schemes = twentysixteen_get_color_scheme_choices(); - if ( ! array_key_exists( $value, $color_schemes ) ) { - return 'default'; + if ( ! array_key_exists( $value, $color_schemes ) ) { + return 'default'; + } + + return $value; } - - return $value; -} endif; // twentysixteen_sanitize_color_scheme /** @@ -445,14 +508,17 @@ add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' ); * @return string Color scheme CSS. */ function twentysixteen_get_color_scheme_css( $colors ) { - $colors = wp_parse_args( $colors, array( - 'background_color' => '', - 'page_background_color' => '', - 'link_color' => '', - 'main_text_color' => '', - 'secondary_text_color' => '', - 'border_color' => '', - ) ); + $colors = wp_parse_args( + $colors, + array( + 'background_color' => '', + 'page_background_color' => '', + 'link_color' => '', + 'main_text_color' => '', + 'secondary_text_color' => '', + 'border_color' => '', + ) + ); return <<%1$s%4$s', - get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), - _x( 'Author', 'Used before post author name.', 'twentysixteen' ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() - ); - } + /** + * Prints HTML with meta information for the categories, tags. + * + * Create your own twentysixteen_entry_meta() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_meta() { + if ( 'post' === get_post_type() ) { + $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); + printf( + '', + get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), + _x( 'Author', 'Used before post author name.', 'twentysixteen' ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); + } - if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { - twentysixteen_entry_date(); - } + if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { + twentysixteen_entry_date(); + } - $format = get_post_format(); - if ( current_theme_supports( 'post-formats', $format ) ) { - printf( '%1$s%3$s', - sprintf( '%s ', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), - esc_url( get_post_format_link( $format ) ), - get_post_format_string( $format ) - ); - } - - edit_post_link( - sprintf( + $format = get_post_format(); + if ( current_theme_supports( 'post-formats', $format ) ) { + printf( + '%1$s%3$s', + sprintf( '%s ', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), + esc_url( get_post_format_link( $format ) ), + get_post_format_string( $format ) + ); + } + + edit_post_link( + sprintf( /* translators: %s: Name of current post */ - __( 'Edit', 'twentysixteen' ), - get_the_title() - ), - '', - '' - ); - - -} + __( 'Edit', 'twentysixteen' ), + get_the_title() + ), + '', + '' + ); + + } endif; if ( ! function_exists( 'twentysixteen_entry_date' ) ) : -/** - * Prints HTML with date information for current post. - * - * Create your own twentysixteen_entry_date() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_date() { - $time_string = ''; + /** + * Prints HTML with date information for current post. + * + * Create your own twentysixteen_entry_date() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_date() { + $time_string = ''; - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = ''; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ''; + } + + $time_string = sprintf( + $time_string, + esc_attr( get_the_date( 'c' ) ), + get_the_date(), + esc_attr( get_the_modified_date( 'c' ) ), + get_the_modified_date() + ); + + printf( + '%3$s', + _x( 'Posted on', 'Used before publish date.', 'bengoldsworthy' ), + esc_url( get_permalink() ), + $time_string + ); } - - $time_string = sprintf( $time_string, - esc_attr( get_the_date( 'c' ) ), - get_the_date(), - esc_attr( get_the_modified_date( 'c' ) ), - get_the_modified_date() - ); - - printf( '%3$s', - _x( 'Posted on', 'Used before publish date.', 'bengoldsworthy' ), - esc_url( get_permalink() ), - $time_string - ); -} endif; if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : -/** - * Prints HTML with category and tags for current post. - * - * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_taxonomies() { - $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); - if ( $categories_list && twentysixteen_categorized_blog() ) { - printf( '%1$s %2$s', - _x( 'Categories', 'Used before category names.', 'twentysixteen' ), - $categories_list - ); - } + /** + * Prints HTML with category and tags for current post. + * + * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_taxonomies() { + $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + if ( $categories_list && twentysixteen_categorized_blog() ) { + printf( + '%1$s %2$s', + _x( 'Categories', 'Used before category names.', 'twentysixteen' ), + $categories_list + ); + } - $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); - if ( $tags_list ) { - printf( '%1$s %2$s', - _x( 'Tags', 'Used before tag names.', 'twentysixteen' ), - $tags_list - ); + $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + if ( $tags_list ) { + printf( + '%1$s %2$s', + _x( 'Tags', 'Used before tag names.', 'twentysixteen' ), + $tags_list + ); + } } -} endif; if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) : -/** - * Displays an optional post thumbnail. - * - * Wraps the post thumbnail in an anchor element on index views, or a div - * element when on single views. - * - * Create your own twentysixteen_post_thumbnail() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_post_thumbnail() { - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { - return; - } + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + * + * Create your own twentysixteen_post_thumbnail() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } - if ( is_singular() ) : - ?> + if ( is_singular() ) : + ?>
    ', '' ); ?>
    @@ -138,19 +143,20 @@ function twentysixteen_post_thumbnail() { - - + if ( has_excerpt() || is_search() ) : + ?>
    - %2$s', - esc_url( get_permalink( get_the_ID() ) ), - /* translators: %s: Name of current post */ - sprintf( __( 'Continue reading "%s"', 'twentysixteen' ), get_the_title( get_the_ID() ) ) - ); - return ' … ' . $link; -} -add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); + /** + * Replaces "[...]" (appended to automatically generated excerpts) with ... and + * a 'Continue reading' link. + * + * Create your own twentysixteen_excerpt_more() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return string 'Continue reading' link prepended with an ellipsis. + */ + function twentysixteen_excerpt_more() { + $link = sprintf( + '%2$s', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Name of current post */ + sprintf( __( 'Continue reading "%s"', 'twentysixteen' ), get_the_title( get_the_ID() ) ) + ); + return ' … ' . $link; + } + add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); endif; /** @@ -210,11 +219,13 @@ endif; function twentysixteen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { // Create an array of all the categories that are attached to posts. - $all_the_cool_cats = get_categories( array( - 'fields' => 'ids', - // We only need to know if there is more than one category. - 'number' => 2, - ) ); + $all_the_cool_cats = get_categories( + array( + 'fields' => 'ids', + // We only need to know if there is more than one category. + 'number' => 2, + ) + ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); @@ -244,19 +255,19 @@ function twentysixteen_category_transient_flusher() { delete_transient( 'twentysixteen_categories' ); } add_action( 'edit_category', 'twentysixteen_category_transient_flusher' ); -add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); +add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) : -/** - * Displays the optional custom logo. - * - * Does nothing if the custom logo is not available. - * - * @since Twenty Sixteen 1.2 - */ -function twentysixteen_the_custom_logo() { - if ( function_exists( 'the_custom_logo' ) ) { - the_custom_logo(); + /** + * Displays the optional custom logo. + * + * Does nothing if the custom logo is not available. + * + * @since Twenty Sixteen 1.2 + */ + function twentysixteen_the_custom_logo() { + if ( function_exists( 'the_custom_logo' ) ) { + the_custom_logo(); + } } -} endif; diff --git a/page-experience-by-companies.php b/page-experience-by-companies.php index 82c5f20..c1c3e5f 100644 --- a/page-experience-by-companies.php +++ b/page-experience-by-companies.php @@ -2,7 +2,7 @@ /* * Template Name: Experience by Companies */ - + /** * * @@ -17,49 +17,52 @@ get_header(); ?>
    -

    Experience.

    - -
    - -
    - -
    -

    Settings

    -
    - - -
    -
    -

    Display only organisations with associated:

    -
    - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    +

    Experience.

    + +
    + +
    + +
    +

    Settings

    +
    + + +
    +
    +

    Display only organisations with associated:

    +
    + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    @@ -70,68 +73,68 @@ get_header(); ?>
    diff --git a/page-experience-by-locations.php b/page-experience-by-locations.php index 1d3108f..500dfc5 100644 --- a/page-experience-by-locations.php +++ b/page-experience-by-locations.php @@ -1,10 +1,10 @@ @@ -12,74 +12,88 @@
    -

    Experience

    -

    by location

    - +

    Experience

    +

    by location

    +
    - - + +
    - +
    0)); + $locations = get_terms( 'location', array( 'hide_empty' => 0 ) ); // Gets all of the top-level location terms. - $terms = get_terms(array('taxonomy' => 'location', 'term_args' => array('parent' => 0))); +$terms = get_terms( + array( + 'taxonomy' => 'location', + 'term_args' => array( 'parent' => 0 ), + ) +); ?>
    -
    +
    -
    - - - parent != 0 && get_term($t->parent, 'location')->parent == 0; - }); - ?> - - + - - 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; - }); - ?> - + + 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; + } + ); + ?> + - - + } + + + - +
    diff --git a/page.php b/page.php index de9047d..8f5fdfd 100644 --- a/page.php +++ b/page.php @@ -1,32 +1,32 @@
    + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) { + comments_template(); + } + + // End of the loop. + endwhile; + ?>
    diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..8bbb46d --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,34 @@ + + + Pivotol Wordpress Coding Standards + + + . + + + */plugins/* + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/search.php b/search.php index 4180b5f..0f89363 100644 --- a/search.php +++ b/search.php @@ -20,7 +20,8 @@ get_header(); ?> */ get_template_part( 'template-parts/content', 'search' ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', - ) ); + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', + ) + ); - // If no content, include the "No posts found" template. + // If no content, include the "No posts found" template. else : get_template_part( 'template-parts/content', 'none' ); diff --git a/sidebar.php b/sidebar.php index b4a5d0d..1137e72 100644 --- a/sidebar.php +++ b/sidebar.php @@ -1,26 +1,26 @@ diff --git a/single.php b/single.php index 3654318..0251c37 100644 --- a/single.php +++ b/single.php @@ -1,29 +1,30 @@
    + // Start the loop. + while ( have_posts() ) : + the_post(); + // Include the single post content template. + get_template_part( 'template-parts/content', 'single' ); + + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) { + comments_template(); + } + // End of the loop. + endwhile; + ?>
    diff --git a/style.css b/style.css index fbffcf2..257ef60 100644 --- a/style.css +++ b/style.css @@ -320,7 +320,7 @@ html { align-items: center; grid-template-areas: "post-content-header post-content" - " post-toc post-content" + " post-meta post-content" " . post-content"; } } @@ -378,25 +378,39 @@ html { grid-area: post-date; } - #split-page #post-toc { - grid-area: post-toc; + #split-page #post-meta { + grid-area: post-meta; width: 100%; text-align: left; } - #split-page #post-toc > h1 { + #split-page #post-meta > h1 { border-bottom: 2px inset var(--dark); margin-top: 0.5em; margin-bottom: 0.5em; line-height: 1.2em; - text-align: center; + text-align: left; } - #split-page #post-toc > ol > li { + #split-page #post-meta h2 { + margin-top: 0.5em; + font-size: 1.4em; + margin-bottom: 0.5em; + line-height: 1.2em; + text-align: left; + } + + #split-page #post-meta > #post-contents > ol > li { margin-top: 0.5em; margin-bottom: 0.5em; } + + #split-page #post-meta > #post-tags > a { + margin-top: 0.2em; + margin-left: 1em; + } + #split-page > #wrapper > .body { grid-area: post-content; display: block; diff --git a/taxonomy-company.php b/taxonomy-company.php index 4b6d9d4..870c8f5 100644 --- a/taxonomy-company.php +++ b/taxonomy-company.php @@ -1,11 +1,11 @@ @@ -13,230 +13,259 @@ name."-->"; - $args= array( - 'post_type' => array( 'job' ), - 'tax_query' => array( - array( - 'taxonomy' => 'company', - 'field' => 'slug', - 'terms' => $company->slug, - ), - ), - 'posts_per_page' => -1 + echo ''; + $args = array( + 'post_type' => array( 'job' ), + 'tax_query' => array( + array( + 'taxonomy' => 'company', + 'field' => 'slug', + 'terms' => $company->slug, + ), + ), + 'posts_per_page' => -1, ); - + $loop = new WP_Query( $args ); -?> + ?>
    'full')); + $companyLogo = apply_filters( 'taxonomy-images-queried-term-image-url', '', array( 'image_size' => 'full' ) ); $companyName = get_queried_object()->name; ?>
    -
    -
    - 70) $small= "2em"; - elseif (strlen($companyName) > 35) $small = "3em"; - elseif (strlen($companyName) > 12) $small = "4em"; - else $small = "5em" - ?> -

    -
    -
    +
    +
    + 70 ) { + $small = '2em'; + } elseif ( strlen( $companyName ) > 35 ) { + $small = '3em'; + } elseif ( strlen( $companyName ) > 12 ) { + $small = '4em'; + } else { + $small = '5em'; + } + ?> +

    +
    +
    -
    -
    - -
    - have_posts()): ?> -
    -
    -
    - -
    -
    -
    - - + if ( count( $parents ) > 0 ) : + ?> +

    Parent

    +
      + image_id )[0]; + $colour = get_term_meta( $parent->term_id, 'color', true ); + $colour = ( $colour != '' ) ? $colour : 'transparent'; + ?> + +
    • term_id, 'company' )->name; ?>
    • + +
    + +
    + +
    + false, + 'taxonomy' => 'company', + 'term_args' => array( 'parent' => get_queried_object()->term_id ), + ) + ); + if ( count( $children ) > 0 ) : + ?> +

    Child

    +
      + image_id, 'detail' )[0]; + $colour = get_term_meta( $child->term_id, 'color', true ); + $colour = ( $colour != '' ) ? $colour : 'transparent'; + ?> + +
    • term_id, 'company' )->name; ?>
    • + +
    + +

    No children.

    + +
    + have_posts() ): - echo '
    '; - echo '

    '.ucwords($currSec).'s View all '.$loop->post_count.'

    '; - echo '
    '; - while (($loop->have_posts()) && ($i++ < 4)) : $loop->the_post(); - get_template_part( 'template-parts/content', get_post_format() ); - endwhile; - echo '
    '; - echo '
    '; - endif; - } - echo '
    '; - echo '
    '; - $args['post_type'] = 'qualification'; - $loop = new WP_Query( $args ); - echo '

    Qualifications

    '; - if ( $loop->have_posts() ): - echo '
      '; - while ($loop->have_posts()) : $loop->the_post(); - $url = esc_url(get_permalink()); - echo '
    • '.get_the_title().'
    • '; - endwhile; - echo '
    '; - else: - echo '

    No qualifications.

    '; - endif; - echo '
    '; - - echo '
    '; - $args['post_type'] = 'award'; - $loop = new WP_Query( $args ); - echo '

    Awards

    '; - if ( $loop->have_posts() ): - echo '
      '; - while ($loop->have_posts()) : $loop->the_post(); - $url = esc_url(get_permalink()); - echo '
    • '.get_the_title().'
    • '; - endwhile; - echo '
    '; - else: - echo '

    No awards.

    '; - endif; - echo '
    '; - echo '
    '; - - $args['post_type'] = 'appearance'; - $loop = new WP_Query( $args ); - if ( $loop->have_posts() ): - echo '
    '; - echo '

    Appearances View all '.$loop->post_count.'

    '; - echo '
    '; - while (($loop->have_posts())) : $loop->the_post(); - get_template_part( 'template-parts/content', get_post_format() ); - endwhile; - echo '
    '; - echo '
    '; - endif; - - $args['post_type'] = 'correspondence'; - $loop = new WP_Query( $args ); - if ( $loop->have_posts() ): - echo '
    '; - echo '

    Correspondence View all '.$loop->post_count.'

    '; - echo '
    '; - while (($loop->have_posts())) : $loop->the_post(); - get_template_part( 'template-parts/content', get_post_format() ); - endwhile; - echo '
    '; - echo '
    '; - endif; - ?> -
    + $pageOrder = array( 'post', 'website', 'program', 'writing', 'video', 'other' ); + foreach ( $pageOrder as $currSec ) { + $args['post_type'] = array( $currSec ); + $i = 0; + $loop = new WP_Query( $args ); + + if ( $loop->have_posts() ) : + echo '
    '; + echo '

    ' . ucwords( $currSec ) . 's View all ' . $loop->post_count . '

    '; + echo '
    '; + while ( ( $loop->have_posts() ) && ( $i++ < 4 ) ) : + $loop->the_post(); + get_template_part( 'template-parts/content', get_post_format() ); + endwhile; + echo '
    '; + echo '
    '; + endif; + } + echo '
    '; + echo '
    '; + $args['post_type'] = 'qualification'; + $loop = new WP_Query( $args ); + echo '

    Qualifications

    '; + if ( $loop->have_posts() ) : + echo '
      '; + while ( $loop->have_posts() ) : + $loop->the_post(); + $url = esc_url( get_permalink() ); + echo '
    • ' . get_the_title() . '
    • '; + endwhile; + echo '
    '; + else : + echo '

    No qualifications.

    '; + endif; + echo '
    '; + + echo '
    '; + $args['post_type'] = 'award'; + $loop = new WP_Query( $args ); + echo '

    Awards

    '; + if ( $loop->have_posts() ) : + echo '
      '; + while ( $loop->have_posts() ) : + $loop->the_post(); + $url = esc_url( get_permalink() ); + echo '
    • ' . get_the_title() . '
    • '; + endwhile; + echo '
    '; + else : + echo '

    No awards.

    '; + endif; + echo '
    '; + echo '
    '; + + $args['post_type'] = 'appearance'; + $loop = new WP_Query( $args ); + if ( $loop->have_posts() ) : + echo '
    '; + echo '

    Appearances View all ' . $loop->post_count . '

    '; + echo '
    '; + while ( ( $loop->have_posts() ) ) : + $loop->the_post(); + get_template_part( 'template-parts/content', get_post_format() ); + endwhile; + echo '
    '; + echo '
    '; + endif; + + $args['post_type'] = 'correspondence'; + $loop = new WP_Query( $args ); + if ( $loop->have_posts() ) : + echo '
    '; + echo '

    Correspondence View all ' . $loop->post_count . '

    '; + echo '
    '; + while ( ( $loop->have_posts() ) ) : + $loop->the_post(); + get_template_part( 'template-parts/content', get_post_format() ); + endwhile; + echo '
    '; + echo '
    '; + endif; + ?> +
    diff --git a/template-parts/content-none.php b/template-parts/content-none.php index e519ba7..f67990f 100644 --- a/template-parts/content-none.php +++ b/template-parts/content-none.php @@ -1,11 +1,11 @@
    diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 393ca4d..18606b8 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -1,30 +1,30 @@
    >
    -
    +

    - -

    - -
    + +

    + +
    - + ?>
    diff --git a/template-parts/content-single.php b/template-parts/content-single.php index 9dfde51..fb2f840 100644 --- a/template-parts/content-single.php +++ b/template-parts/content-single.php @@ -1,93 +1,114 @@
    >
    -
    -

    - -

    - - S\<\/\s\u\p\>, 1,Y \H\.\E\.', '

    ', '

    '); ?> -
    +
    +

    + +

    + + S\<\/\s\u\p\>, 1,Y \H\.\E\.', '

    ', '

    '); ?> +
    - - - -
    -
      - term_id, 'category'); - - foreach ($seriesIDs as $thisSeriesID) { - if (has_category($thisSeriesID)) { - array_push($series, get_category($thisSeriesID)); - } - } - if (count($series) > 1) $catag .= "’"; - $punct = ":"; - foreach ($series as $thisSeries) { - $catag .= $punct.' '; - if ($punct == ":") $punct = ";"; - $catag .= ''.$thisSeries->name.''; - } - $catag .= '.'; - - echo "
    • This {$type} {$catag}
    • "; - } - ?> - - -
    • This piece was written over a year ago. It may no longer accurately reflect my views now, or may be factually outdated.
    • + + + +
      +
        + term_id, 'category' ); + + foreach ( $seriesIDs as $thisSeriesID ) { + if ( has_category( $thisSeriesID ) ) { + array_push( $series, get_category( $thisSeriesID ) ); + } + } + if ( count( $series ) > 1 ) { + $catag .= '’'; + } + $punct = ':'; + foreach ( $series as $thisSeries ) { + $catag .= $punct . ' '; + if ( $punct == ':' ) { + $punct = ';'; + } + $catag .= '' . $thisSeries->name . ''; + } + $catag .= '.'; + + echo "
      • This {$type} {$catag}
      • "; + } + ?> + + +
      • This piece was written over a year ago. It may no longer accurately reflect my views now, or may be factually outdated.
      • - -
      • 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).
      • - - -
      • - - -
      • This work is licensed under . Sorry about that.
      • - -
      -
      + +
    • 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).
    • + + +
    • + + +
    • This work is licensed under . Sorry about that.
    • + +
    +
    + if ( get_the_content() ) : + the_content(); + else : + echo get_the_excerpt(); + endif; + ?>
    -
    - -

    Contents

    -
      - - -
    1. - -
    +
    +

    Post Meta

    + +
    +

    Contents

    +
      + + +
    1. + +
    +
    + + +
    +

    Tags

    + + + name; ?> + + +
    diff --git a/template-parts/content.php b/template-parts/content.php index 02aa2ad..de6c387 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -1,25 +1,29 @@ -> +>
    - 70) $small= "vsmall"; - elseif (strlen(get_the_title()) > 35) $small = "small"; - elseif (strlen(get_the_title()) > 12) $small = "qsmall"; - ?> -
    -

    - -

    - -
    + 70 ) { + $small = 'vsmall'; + } elseif ( strlen( get_the_title() ) > 35 ) { + $small = 'small'; + } elseif ( strlen( get_the_title() ) > 12 ) { + $small = 'qsmall'; + } + ?> +
    +

    + +

    + +
    -
    \ No newline at end of file + diff --git a/zzpage-experience.php b/zzpage-experience.php index 9539a8a..8236b87 100644 --- a/zzpage-experience.php +++ b/zzpage-experience.php @@ -1,51 +1,54 @@ - $endDate) ? $endDate : $jEDate); - return (((strtotime($jSDate) < strtotime($endDate)) && (strtotime($jSDate) > strtotime($startDate))) && (strtotime($jEDate) > strtotime($startDate))); - } - $args = array( - 'post_type' => array( - 'job' - ), - 'posts_per_page' => -1 - ); - $loop = new WP_Query($args); -?> +function withinDates( $jSDate, $jEDate ) { + $endYear = date( 'Y' ); + $endDate = $endYear . '-12-31'; + $startDate = ( $endYear - 2 ) . '-01-01'; + $jEDate = ( ! $jEDate ) ? date( 'Y-m-d' ) : ( ( $jEDate > $endDate ) ? $endDate : $jEDate ); + return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) ); +} + $args = array( + 'post_type' => array( + 'job', + ), + 'posts_per_page' => -1, + ); + $loop = new WP_Query( $args ); + ?> +
    -

    Experience

    -

    or, a brief history of Ben

    - -
    +

    Experience

    +

    or, a brief history of Ben

    + +
    -
    +
    -
    +
    -
    +
    - - + +