Add code linting to ensure WordPress Coding Standards compliance #7
24 changed files with 1686 additions and 1427 deletions
12
404.php
12
404.php
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying 404 (not found) errors.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying 404 (not found) errors.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
|
81
archive.php
81
archive.php
|
@ -1,57 +1,62 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying portfolio archives.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying portfolio archives.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<main id="list-page" class="col-10 col-m-12" role="main">
|
||||
<header>
|
||||
<h1><?php echo (get_post_type() == "post") ? single_cat_title() : ucfirst(get_post_type())."s"; ?>.</h1>
|
||||
<?php
|
||||
echo get_the_posts_pagination( array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
));
|
||||
?>
|
||||
<h1><?php echo ( get_post_type() == 'post' ) ? single_cat_title() : ucfirst( get_post_type() ) . 's'; ?>.</h1>
|
||||
<?php
|
||||
echo get_the_posts_pagination(
|
||||
array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</header>
|
||||
|
||||
<section id="grid" class="row">
|
||||
<?php
|
||||
if ( have_posts() ) :
|
||||
// Start the loop.
|
||||
while ( have_posts() ) : the_post();
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
// End the loop.
|
||||
if ( have_posts() ) :
|
||||
// Start the loop.
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
// End the loop.
|
||||
endwhile;
|
||||
// If no content, include the "No posts found" template.
|
||||
else:
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
endif;
|
||||
?>
|
||||
// If no content, include the "No posts found" template.
|
||||
else :
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
endif;
|
||||
?>
|
||||
</section><!-- .site-main -->
|
||||
|
||||
<footer>
|
||||
<?php
|
||||
echo get_the_posts_pagination( array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
));
|
||||
?>
|
||||
<?php
|
||||
echo get_the_posts_pagination(
|
||||
array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</footer>
|
||||
</main><!-- .content-area -->
|
||||
|
||||
|
|
|
@ -1,23 +1,26 @@
|
|||
<?php
|
||||
/*
|
||||
* Template Name: Centred Page
|
||||
*/
|
||||
* Template Name: Centred Page
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Displays a full-screen page with content in the center.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
*
|
||||
*
|
||||
* Displays a full-screen page with content in the center.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<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>
|
||||
<h2><?php the_content(); ?></h2>
|
||||
<?php endwhile; ?>
|
||||
|
|
78
comments.php
78
comments.php
|
@ -1,53 +1,59 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying comments.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying comments.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
|
||||
/*
|
||||
* If the current post is protected by a password and
|
||||
* the visitor has not yet entered the password we will
|
||||
* return early without loading the comments.
|
||||
*/
|
||||
if (post_password_required()) return;
|
||||
* If the current post is protected by a password and
|
||||
* the visitor has not yet entered the password we will
|
||||
* return early without loading the comments.
|
||||
*/
|
||||
if ( post_password_required() ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="comments" class="comments-area">
|
||||
<div class="row">
|
||||
<div class="col-7" id="comments-list">
|
||||
<div class="col-7" id="comments-list">
|
||||
<h3 id="comments-list-title">Replies</h3>
|
||||
<?php if ( have_comments() ) : ?>
|
||||
<?php the_comments_navigation(); ?>
|
||||
<?php the_comments_navigation(); ?>
|
||||
|
||||
<ol class="comment-list">
|
||||
<?php
|
||||
wp_list_comments( array(
|
||||
'style' => 'ol',
|
||||
'short_ping' => true,
|
||||
'avatar_size' => 42,
|
||||
));
|
||||
?>
|
||||
</ol><!-- .comment-list -->
|
||||
<ol class="comment-list">
|
||||
<?php
|
||||
wp_list_comments(
|
||||
array(
|
||||
'style' => 'ol',
|
||||
'short_ping' => true,
|
||||
'avatar_size' => 42,
|
||||
)
|
||||
);
|
||||
?>
|
||||
</ol><!-- .comment-list -->
|
||||
|
||||
<?php the_comments_navigation(); ?>
|
||||
<?php else: ?>
|
||||
<p id="no-comments">No comments yet.</p>
|
||||
<?php the_comments_navigation(); ?>
|
||||
<?php else : ?>
|
||||
<p id="no-comments">No comments yet.</p>
|
||||
<?php endif; ?>
|
||||
<?php if (!comments_open() && get_comments_number() && post_type_supports(get_post_type(), 'comments')): ?>
|
||||
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p>
|
||||
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
|
||||
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-5" id="comments-reply">
|
||||
<?php
|
||||
comment_form( array(
|
||||
'title_reply_before' => '<h3 id="comments-reply-title">',
|
||||
'title_reply_after' => '</h3>',
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
<div class="col-5" id="comments-reply">
|
||||
<?php
|
||||
comment_form(
|
||||
array(
|
||||
'title_reply_before' => '<h3 id="comments-reply-title">',
|
||||
'title_reply_after' => '</h3>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .comments-area -->
|
||||
|
|
32
footer.php
32
footer.php
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying the footer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying the footer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -27,18 +27,18 @@
|
|||
});
|
||||
});
|
||||
|
||||
function toggleCommentary() {
|
||||
var linkText = ["Click here to hide all commentary and leave only reportage.", "Click here to show commentary."];
|
||||
var commentaries = document.getElementsByClassName("article__text--commentary");
|
||||
var link = document.getElementById("toggleCommentary");
|
||||
function toggleCommentary() {
|
||||
var linkText = ["Click here to hide all commentary and leave only reportage.", "Click here to show commentary."];
|
||||
var commentaries = document.getElementsByClassName("article__text--commentary");
|
||||
var link = document.getElementById("toggleCommentary");
|
||||
|
||||
for (var i = 0; i < commentaries.length; i++) {
|
||||
commentaries[i].style.display = (commentaries[i].style.display == 'none') ? 'inline' : 'none';
|
||||
}
|
||||
for (var i = 0; i < commentaries.length; i++) {
|
||||
commentaries[i].style.display = (commentaries[i].style.display == 'none') ? 'inline' : 'none';
|
||||
}
|
||||
|
||||
link.innerHTML = (link.innerHTML == linkText[0]) ? linkText[1] : linkText[0];
|
||||
}
|
||||
</script>
|
||||
link.innerHTML = (link.innerHTML == linkText[0]) ? linkText[1] : linkText[0];
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
|
|
609
functions.php
609
functions.php
|
@ -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' ),
|
||||
) );
|
||||
register_nav_menus(
|
||||
array(
|
||||
'primary' => __( 'Primary Menu', 'omphaloskepsis' ),
|
||||
'social' => __( 'Social Links Menu', 'omphaloskepsis' ),
|
||||
)
|
||||
);
|
||||
|
||||
function omphaloskepsis_infinite_scroll_init() {
|
||||
add_theme_support( 'infinite-scroll', array(
|
||||
'container' => 'main',
|
||||
'render' => 'omphaloskepsis_infinite_scroll_render',
|
||||
'footer' => 'colophon',
|
||||
) );
|
||||
}
|
||||
|
||||
add_action( 'init', 'omphaloskepsis_infinite_scroll_init' );
|
||||
/**
|
||||
* Custom render function for Infinite Scroll.
|
||||
*/
|
||||
function omphaloskepsis_infinite_scroll_render() {
|
||||
while ( have_posts() ) {
|
||||
the_post();
|
||||
if ( is_search() ) {
|
||||
get_template_part( 'template-parts/content', 'search' );
|
||||
} else {
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
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' => '<section id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h2 class="widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar(
|
||||
array(
|
||||
'name' => __( 'Sidebar', 'omphaloskepsis' ),
|
||||
'id' => 'sidebar-1',
|
||||
'description' => __( 'Add widgets here to appear in your sidebar.', 'omphaloskepsis' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h2 class="widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
)
|
||||
);
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Content Bottom 1', 'omphaloskepsis' ),
|
||||
'id' => 'sidebar-2',
|
||||
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h2 class="widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar(
|
||||
array(
|
||||
'name' => __( 'Content Bottom 1', 'omphaloskepsis' ),
|
||||
'id' => 'sidebar-2',
|
||||
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h2 class="widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
)
|
||||
);
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Content Bottom 2', 'omphaloskepsis' ),
|
||||
'id' => 'sidebar-3',
|
||||
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h2 class="widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
) );
|
||||
register_sidebar(
|
||||
array(
|
||||
'name' => __( 'Content Bottom 2', 'omphaloskepsis' ),
|
||||
'id' => 'sidebar-3',
|
||||
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'omphaloskepsis' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h2 class="widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'widgets_init', 'omphaloskepsis_widgets_init' );
|
||||
|
||||
|
@ -241,10 +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,7 +293,7 @@ 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.
|
||||
|
@ -282,9 +305,9 @@ 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( '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.
|
||||
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 . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Download</a>';
|
||||
if ($meta = get_post_meta($post->ID, 'Documentation', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Documentation</a>';
|
||||
if ($meta = get_post_meta($post->ID, 'Repo', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Repo</a>';
|
||||
if ($meta = get_post_meta($post->ID, 'Licence', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Licence</a>';
|
||||
if ($meta = get_post_meta($post->ID, 'MD5', true))
|
||||
$links = $links . '<p class="checksum">MD5 checksum: '.$meta.'</p>';
|
||||
return $content . $links;
|
||||
} elseif ($post->post_type == "website") {
|
||||
if ($meta = get_post_meta($post->ID, 'Link', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Visit</a>';
|
||||
if ($meta = get_post_meta($post->ID, 'Repo', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Repo</a>';
|
||||
if ($meta = get_post_meta($post->ID, 'Licence', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Licence</a>';
|
||||
return $content . $links;
|
||||
} elseif ($post->post_type == "writing") {
|
||||
if ($meta = get_post_meta($post->ID, 'Link', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Read</a>';
|
||||
if ($meta = get_post_meta($post->ID, 'Licence', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Licence</a>';
|
||||
return $content . $links;
|
||||
} elseif ($post->post_type == "other") {
|
||||
if ($meta = get_post_meta($post->ID, 'Link', true))
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="'.$meta.'">Download</a>';
|
||||
return $content . $links;
|
||||
}
|
||||
return $content;
|
||||
function omphaloskepsis_the_content( $content ) {
|
||||
global $post;
|
||||
if ( $post->post_type == 'program' ) {
|
||||
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>';
|
||||
}
|
||||
if ( $meta = get_post_meta( $post->ID, 'Documentation', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Documentation</a>';
|
||||
}
|
||||
if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>';
|
||||
}
|
||||
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
|
||||
}
|
||||
if ( $meta = get_post_meta( $post->ID, 'MD5', true ) ) {
|
||||
$links = $links . '<p class="checksum">MD5 checksum: ' . $meta . '</p>';
|
||||
}
|
||||
return $content . $links;
|
||||
} elseif ( $post->post_type == 'website' ) {
|
||||
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Visit</a>';
|
||||
}
|
||||
if ( $meta = get_post_meta( $post->ID, 'Repo', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Repo</a>';
|
||||
}
|
||||
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
|
||||
}
|
||||
return $content . $links;
|
||||
} elseif ( $post->post_type == 'writing' ) {
|
||||
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Read</a>';
|
||||
}
|
||||
if ( $meta = get_post_meta( $post->ID, 'Licence', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Licence</a>';
|
||||
}
|
||||
return $content . $links;
|
||||
} elseif ( $post->post_type == 'other' ) {
|
||||
if ( $meta = get_post_meta( $post->ID, 'Link', true ) ) {
|
||||
$links = $links . '<a class="hyperlink-button" target="_blank" href="' . $meta . '">Download</a>';
|
||||
}
|
||||
return $content . $links;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
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 '<tr>';
|
||||
echo '<th colspan="2">Organisation</th>';
|
||||
echo '<th>Children</th>';
|
||||
echo '<th>Associated Items</th>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<th colspan="2">Organisation</th>';
|
||||
echo '<th>Children</th>';
|
||||
echo '<th>Associated Items</th>';
|
||||
echo '</tr>';
|
||||
|
||||
if ($_POST['toplevel'] == "true") {
|
||||
// Gets all of the top-level company terms.
|
||||
$terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company', 'term_args' => array('parent' => 0)));
|
||||
$include = 1;
|
||||
} else {
|
||||
// Gets all of the company terms.
|
||||
$terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company',));
|
||||
$include = 0;
|
||||
}
|
||||
if ( $_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");
|
||||
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();
|
||||
// 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();
|
||||
|
||||
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',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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['showexpired'] != 'true' && $post_type == 'qualification' ) {
|
||||
$args['meta_query'] = array(
|
||||
array(
|
||||
'key' => 'Expired',
|
||||
'compare' => 'NOT EXISTS',
|
||||
'value' => '1',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if ($_POST['currentjobs'] == "true" && $post_type == "job") {
|
||||
$args['meta_query'] = array(
|
||||
array(
|
||||
'key' => 'end-date',
|
||||
'compare' => 'NOT EXISTS',
|
||||
'value' => '1',
|
||||
),
|
||||
);
|
||||
}
|
||||
$posts = get_posts( $args );
|
||||
|
||||
if ($_POST['showexpired'] != "true" && $post_type == "qualification") {
|
||||
$args['meta_query'] = array(
|
||||
array(
|
||||
'key' => 'Expired',
|
||||
'compare' => 'NOT EXISTS',
|
||||
'value' => '1',
|
||||
),
|
||||
);
|
||||
}
|
||||
array_push( $term_items, $posts );
|
||||
array_push( $term_item_counts, count( $posts ) );
|
||||
}
|
||||
|
||||
$posts = get_posts($args);
|
||||
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';
|
||||
|
||||
array_push($term_items, $posts);
|
||||
array_push($term_item_counts, count($posts));
|
||||
}
|
||||
echo '<tr class="organisation">';
|
||||
echo '<td class="organisation-logo">';
|
||||
echo '<a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">';
|
||||
echo '<img style="background-color: ' . $colour . ';" src="' . strtok( $imgURL, '?' ) . '" alt="' . $term->name . ' logo">';
|
||||
echo '</a>';
|
||||
echo '</td>';
|
||||
|
||||
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 '<td class="organisation-name">';
|
||||
echo '<a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">';
|
||||
echo '<p>' . $term->name . '</p>';
|
||||
echo '</a>';
|
||||
echo '</td>';
|
||||
|
||||
echo '<tr class="organisation">';
|
||||
echo '<td class="organisation-logo">';
|
||||
echo '<a href="'.esc_url(get_term_link($term, $term->taxonomy)).'">';
|
||||
echo '<img style="background-color: '.$colour.';" src="'.strtok($imgURL, '?').'" alt="'.$term->name.' logo">';
|
||||
echo '</a>';
|
||||
echo '</td>';
|
||||
echo '<td class="organisation-items organisation-children">';
|
||||
$num = ( count( $term_children ) > 0 ) ? '' : 'none';
|
||||
echo '<div class="organisation-item ' . $num . '">';
|
||||
echo '<span class="dashicons dashicons-groups"></span><br>' . count( $term_children );
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="organisation-name">';
|
||||
echo '<a href="'.esc_url(get_term_link($term, $term->taxonomy)).'">';
|
||||
echo '<p>'.$term->name.'</p>';
|
||||
echo '</a>';
|
||||
echo '</td>';
|
||||
echo '<td class="organisation-items">';
|
||||
$i = 0;
|
||||
foreach ( $post_types as $post_type ) {
|
||||
$num = ( $term_item_counts[ $i ] > 0 ) ? '' : 'none';
|
||||
echo '<div class="organisation-item ' . $num . '">';
|
||||
echo '<span class="dashicons dashicons-' . $dashicons[ $i ] . '"></span><br>' . $term_item_counts[ $i ];
|
||||
echo '</div>';
|
||||
$i++;
|
||||
};
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '<td class="organisation-items organisation-children">';
|
||||
$num = (count($term_children) > 0) ? "" : "none";
|
||||
echo '<div class="organisation-item '.$num.'">';
|
||||
echo '<span class="dashicons dashicons-groups"></span><br>'.count($term_children);
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
/*
|
||||
echo '<a href="'.esc_url(get_term_link($term, $term->taxonomy)).'">';
|
||||
echo '<li class="col-2 col-m-4" style="background-color: '.$colour.'; '.$bgImg.'">';
|
||||
echo '<div class="company-info-container left">';
|
||||
if (count($term_children) > 0) {
|
||||
echo '<div class="company-info children">';
|
||||
echo count($term_children).'<br><span class="dashicons dashicons-groups"></span>';
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
echo '<td class="organisation-items">';
|
||||
$i = 0;
|
||||
foreach ($post_types as $post_type) {
|
||||
$num = ($term_item_counts[$i] > 0) ? "" : "none";
|
||||
echo '<div class="organisation-item '.$num.'">';
|
||||
echo '<span class="dashicons dashicons-'.$dashicons[$i].'"></span><br>'.$term_item_counts[$i];
|
||||
echo '</div>';
|
||||
$i++;
|
||||
};
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '<div class="company-info-container right">';
|
||||
$i = 0;
|
||||
foreach ($post_types as $post_type) {
|
||||
if ($_POST[$post_type] == "true") {
|
||||
echo '<div class="company-info jobs">';
|
||||
echo $term_item_counts[$i].'<span class="dashicons dashicons-'.$dashicons[$i].'"></span>';
|
||||
echo '</div>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
echo '</div>';
|
||||
if (!$imgURL) echo '<p class="company-name">'.$term->name.'</p>';
|
||||
echo '</li>';
|
||||
echo '</a>';
|
||||
*/
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<p>No companies found</p>';
|
||||
}
|
||||
|
||||
/*
|
||||
echo '<a href="'.esc_url(get_term_link($term, $term->taxonomy)).'">';
|
||||
echo '<li class="col-2 col-m-4" style="background-color: '.$colour.'; '.$bgImg.'">';
|
||||
echo '<div class="company-info-container left">';
|
||||
if (count($term_children) > 0) {
|
||||
echo '<div class="company-info children">';
|
||||
echo count($term_children).'<br><span class="dashicons dashicons-groups"></span>';
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="company-info-container right">';
|
||||
$i = 0;
|
||||
foreach ($post_types as $post_type) {
|
||||
if ($_POST[$post_type] == "true") {
|
||||
echo '<div class="company-info jobs">';
|
||||
echo $term_item_counts[$i].'<span class="dashicons dashicons-'.$dashicons[$i].'"></span>';
|
||||
echo '</div>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
echo '</div>';
|
||||
if (!$imgURL) echo '<p class="company-name">'.$term->name.'</p>';
|
||||
echo '</li>';
|
||||
echo '</a>';
|
||||
*/
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<p>No companies found</p>';
|
||||
}
|
||||
|
||||
die();
|
||||
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' );
|
||||
|
||||
|
|
40
header.php
40
header.php
|
@ -1,40 +1,40 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying the header.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying the header.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?> class="no-js">
|
||||
<head>
|
||||
<meta charset="<?php bloginfo('charset'); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php $index = get_post_meta(get_the_ID(), 'Index', true); ?>
|
||||
<?php if (!(is_single() && !is_page() && $index == "true")): ?>
|
||||
<meta name="robots" content="noindex">
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php $index = get_post_meta( get_the_ID(), 'Index', true ); ?>
|
||||
<?php if ( ! ( is_single() && ! is_page() && $index == 'true' ) ) : ?>
|
||||
<meta name="robots" content="noindex">
|
||||
<?php endif; ?>
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
|
||||
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
|
||||
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
|
||||
<?php endif; ?>
|
||||
<?php wp_head(); ?>
|
||||
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
|
||||
<?php wp_head(); ?>
|
||||
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
|
||||
</head>
|
||||
|
||||
<body <?php body_class(); ?> id="site-wrapper">
|
||||
<?php if (!is_page_template('centred-page.php')): ?>
|
||||
<?php if ( ! is_page_template( 'centred-page.php' ) ) : ?>
|
||||
<header id="site-header">
|
||||
<nav id="site-header-nav">
|
||||
<nav id="site-header-nav">
|
||||
<div class="site-header-nav-item"><a href="/"><h1>Ben Goldsworthy</a></div>
|
||||
<div class="site-header-nav-item"><h2>Views my own. Do try this at home.</h2></div>
|
||||
<div class="site-header-nav-item"><p>~ <a href="mailto:me+bg@bengoldsworthy.net"><i class="fa fa-envelope"></i></a> ~ <a href="bitcoin:1HApEg2robrRCx4rTKKeFj25unoaX65QUc"><i class="fa fa-btc"></i></a> ~ <a href="https://github.com/Rumperuu"><i class="fa fa-github"></i></a> ~ <a href="/0x30D22F41.asc"><i class="fa fa-key"></i></a> ~ <a href="/feed"><i class="fa fa-rss"></i></a> ~</p></div>
|
||||
<div class="site-header-nav-item"><a href="/blog">Blog</a></div>
|
||||
<div class="site-header-nav-item"><a href="/blog">Blog</a></div>
|
||||
<div class="site-header-nav-item"><a href="/portfolios">Portfolios</a></div>
|
||||
<div class="site-header-nav-item"><a href="/social-cataloguing">Social Cataloguing</a></div>
|
||||
</nav>
|
||||
</nav>
|
||||
</header>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
|
85
home.php
85
home.php
|
@ -1,61 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* The blogroll template file.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The blogroll template file.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<main id="list-page" class="col-10 col-m-12" role="main">
|
||||
<header>
|
||||
<h1>Blog.</h1>
|
||||
<h2><strong>All</strong> / <a href="/category/thoughts">Thoughts</a> / <a href="/category/reports">Reports</a> / <a href="/category/reviews">Reviews</a> / <a href="/category/projects">Projects</a></h2>
|
||||
<?php
|
||||
echo get_the_posts_pagination( array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
));
|
||||
?>
|
||||
<h1>Blog.</h1>
|
||||
<h2><strong>All</strong> / <a href="/category/thoughts">Thoughts</a> / <a href="/category/reports">Reports</a> / <a href="/category/reviews">Reviews</a> / <a href="/category/projects">Projects</a></h2>
|
||||
<?php
|
||||
echo get_the_posts_pagination(
|
||||
array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</header>
|
||||
|
||||
<section id="grid" class="row">
|
||||
<?php
|
||||
if ( have_posts() ) :
|
||||
// Start the loop.
|
||||
while ( have_posts() ) : the_post();
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
// End the loop.
|
||||
if ( have_posts() ) :
|
||||
// Start the loop.
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
// End the loop.
|
||||
endwhile;
|
||||
// If no content, include the "No posts found" template.
|
||||
else:
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
endif;
|
||||
?>
|
||||
// If no content, include the "No posts found" template.
|
||||
else :
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
endif;
|
||||
?>
|
||||
</section><!-- .site-main -->
|
||||
|
||||
<footer>
|
||||
<?php
|
||||
echo get_the_posts_pagination( array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
));
|
||||
?>
|
||||
<?php
|
||||
echo get_the_posts_pagination(
|
||||
array(
|
||||
'screen_reader_text' => ' ',
|
||||
'mid_size' => 20,
|
||||
'prev_text' => '',
|
||||
'next_text' => '',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</footer>
|
||||
</main><!-- .content-area -->
|
||||
|
||||
<?php //get_sidebar(); ?>
|
||||
<?php // get_sidebar(); ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
|
@ -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' );
|
||||
|
||||
|
|
|
@ -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.
|
||||
?>
|
||||
<style type="text/css" id="twentysixteen-header-css">
|
||||
.site-branding {
|
||||
margin: 0 auto 0 0;
|
||||
|
@ -89,8 +101,8 @@ function twentysixteen_header_style() {
|
|||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
}
|
||||
endif; // twentysixteen_header_style
|
||||
|
||||
/**
|
||||
|
@ -107,83 +119,131 @@ function twentysixteen_customize_register( $wp_customize ) {
|
|||
$wp_customize->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 <<<CSS
|
||||
/* Color Scheme */
|
||||
|
|
|
@ -10,126 +10,131 @@
|
|||
*/
|
||||
|
||||
if ( ! function_exists( 'twentysixteen_entry_meta' ) ) :
|
||||
/**
|
||||
* Prints HTML with meta information for the categories, tags.
|
||||
*
|
||||
* Create your own twentysixteen_entry_meta() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
function twentysixteen_entry_meta() {
|
||||
if ( 'post' === get_post_type() ) {
|
||||
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 );
|
||||
printf( '<span class="byline"><span class="author">%1$s<a class="url fn n" href="%3$s">%4$s</a></span></span>',
|
||||
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
|
||||
_x( 'Author', 'Used before post author name.', 'twentysixteen' ),
|
||||
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
||||
get_the_author()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Prints HTML with meta information for the categories, tags.
|
||||
*
|
||||
* Create your own twentysixteen_entry_meta() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
function twentysixteen_entry_meta() {
|
||||
if ( 'post' === get_post_type() ) {
|
||||
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 );
|
||||
printf(
|
||||
'<span class="byline"><span class="author">%1$s<a class="url fn n" href="%3$s">%4$s</a></span></span>',
|
||||
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
|
||||
_x( 'Author', 'Used before post author name.', 'twentysixteen' ),
|
||||
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
||||
get_the_author()
|
||||
);
|
||||
}
|
||||
|
||||
if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
|
||||
twentysixteen_entry_date();
|
||||
}
|
||||
if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
|
||||
twentysixteen_entry_date();
|
||||
}
|
||||
|
||||
$format = get_post_format();
|
||||
if ( current_theme_supports( 'post-formats', $format ) ) {
|
||||
printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
|
||||
sprintf( '<span class="screen-reader-text">%s </span></div>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ),
|
||||
esc_url( get_post_format_link( $format ) ),
|
||||
get_post_format_string( $format )
|
||||
);
|
||||
}
|
||||
$format = get_post_format();
|
||||
if ( current_theme_supports( 'post-formats', $format ) ) {
|
||||
printf(
|
||||
'<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
|
||||
sprintf( '<span class="screen-reader-text">%s </span></div>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ),
|
||||
esc_url( get_post_format_link( $format ) ),
|
||||
get_post_format_string( $format )
|
||||
);
|
||||
}
|
||||
|
||||
edit_post_link(
|
||||
sprintf(
|
||||
edit_post_link(
|
||||
sprintf(
|
||||
/* translators: %s: Name of current post */
|
||||
__( 'Edit', 'twentysixteen' ),
|
||||
get_the_title()
|
||||
),
|
||||
'<span class="edit-link">',
|
||||
'</span>'
|
||||
);
|
||||
__( 'Edit', 'twentysixteen' ),
|
||||
get_the_title()
|
||||
),
|
||||
'<span class="edit-link">',
|
||||
'</span>'
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'twentysixteen_entry_date' ) ) :
|
||||
/**
|
||||
* Prints HTML with date information for current post.
|
||||
*
|
||||
* Create your own twentysixteen_entry_date() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
function twentysixteen_entry_date() {
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
/**
|
||||
* Prints HTML with date information for current post.
|
||||
*
|
||||
* Create your own twentysixteen_entry_date() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
function twentysixteen_entry_date() {
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
|
||||
}
|
||||
|
||||
$time_string = sprintf(
|
||||
$time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
get_the_date(),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
get_the_modified_date()
|
||||
);
|
||||
|
||||
printf(
|
||||
'<span class="posted-on"><a href="%2$s" rel="bookmark">%3$s</a></span>',
|
||||
_x( 'Posted on', 'Used before publish date.', 'bengoldsworthy' ),
|
||||
esc_url( get_permalink() ),
|
||||
$time_string
|
||||
);
|
||||
}
|
||||
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
get_the_date(),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
get_the_modified_date()
|
||||
);
|
||||
|
||||
printf( '<span class="posted-on"><a href="%2$s" rel="bookmark">%3$s</a></span>',
|
||||
_x( 'Posted on', 'Used before publish date.', 'bengoldsworthy' ),
|
||||
esc_url( get_permalink() ),
|
||||
$time_string
|
||||
);
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) :
|
||||
/**
|
||||
* Prints HTML with category and tags for current post.
|
||||
*
|
||||
* Create your own twentysixteen_entry_taxonomies() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
function twentysixteen_entry_taxonomies() {
|
||||
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
|
||||
if ( $categories_list && twentysixteen_categorized_blog() ) {
|
||||
printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
|
||||
_x( 'Categories', 'Used before category names.', 'twentysixteen' ),
|
||||
$categories_list
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Prints HTML with category and tags for current post.
|
||||
*
|
||||
* Create your own twentysixteen_entry_taxonomies() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
function twentysixteen_entry_taxonomies() {
|
||||
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
|
||||
if ( $categories_list && twentysixteen_categorized_blog() ) {
|
||||
printf(
|
||||
'<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
|
||||
_x( 'Categories', 'Used before category names.', 'twentysixteen' ),
|
||||
$categories_list
|
||||
);
|
||||
}
|
||||
|
||||
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
|
||||
if ( $tags_list ) {
|
||||
printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
|
||||
_x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
|
||||
$tags_list
|
||||
);
|
||||
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
|
||||
if ( $tags_list ) {
|
||||
printf(
|
||||
'<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
|
||||
_x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
|
||||
$tags_list
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) :
|
||||
/**
|
||||
* Displays an optional post thumbnail.
|
||||
*
|
||||
* Wraps the post thumbnail in an anchor element on index views, or a div
|
||||
* element when on single views.
|
||||
*
|
||||
* Create your own twentysixteen_post_thumbnail() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
function twentysixteen_post_thumbnail() {
|
||||
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* 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() ) :
|
||||
?>
|
||||
|
||||
<div class="post-header-image">
|
||||
<div class="post-title"><?php the_title( '<h2 class="title">', '</h2>' ); ?></div>
|
||||
|
@ -138,19 +143,20 @@ function twentysixteen_post_thumbnail() {
|
|||
|
||||
<?php else : ?>
|
||||
|
||||
<!--<a class="post-thumbnail" href="<?php //the_permalink(); ?>" aria-hidden="true">
|
||||
<!--<a class="post-thumbnail" href="<?php // the_permalink(); ?>" aria-hidden="true">
|
||||
<div class="read-div">Read</div>
|
||||
<?php //the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
|
||||
<?php // the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
|
||||
</a>-->
|
||||
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
|
||||
<div class="image-thumbnail" style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
|
||||
<div class="read-div">Read</div>
|
||||
<?php //the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
|
||||
<?php // the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<?php endif; // End is_singular()
|
||||
}
|
||||
<?php
|
||||
endif; // End is_singular()
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'twentysixteen_excerpt' ) ) :
|
||||
|
@ -168,34 +174,37 @@ if ( ! function_exists( 'twentysixteen_excerpt' ) ) :
|
|||
function twentysixteen_excerpt( $class = 'entry-summary' ) {
|
||||
$class = esc_attr( $class );
|
||||
|
||||
if ( has_excerpt() || is_search() ) : ?>
|
||||
if ( has_excerpt() || is_search() ) :
|
||||
?>
|
||||
<div class="<?php echo $class; ?>">
|
||||
<?php the_excerpt(); ?>
|
||||
</div><!-- .<?php echo $class; ?> -->
|
||||
<?php endif;
|
||||
<?php
|
||||
endif;
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) :
|
||||
/**
|
||||
* Replaces "[...]" (appended to automatically generated excerpts) with ... and
|
||||
* a 'Continue reading' link.
|
||||
*
|
||||
* Create your own twentysixteen_excerpt_more() function to override in a child theme.
|
||||
*
|
||||
* @since Twenty Sixteen 1.0
|
||||
*
|
||||
* @return string 'Continue reading' link prepended with an ellipsis.
|
||||
*/
|
||||
function twentysixteen_excerpt_more() {
|
||||
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
|
||||
esc_url( get_permalink( get_the_ID() ) ),
|
||||
/* translators: %s: Name of current post */
|
||||
sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) )
|
||||
);
|
||||
return ' … ' . $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(
|
||||
'<a href="%1$s" class="more-link">%2$s</a>',
|
||||
esc_url( get_permalink( get_the_ID() ) ),
|
||||
/* translators: %s: Name of current post */
|
||||
sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) )
|
||||
);
|
||||
return ' … ' . $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;
|
||||
|
|
|
@ -17,49 +17,52 @@ get_header(); ?>
|
|||
<div id="experience-wrapper" class="content-area col-10 col-m-12">
|
||||
<!--Page Title & Details-->
|
||||
<header class="post-header-title">
|
||||
<h1 style="margin-bottom: 20px;" id="page-title">Experience.</h1>
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<div class="entry-content tile" id="taxonomy-description">
|
||||
<?php the_content() ?>
|
||||
</div>
|
||||
<h1 style="margin-bottom: 20px;" id="page-title">Experience.</h1>
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
?>
|
||||
<div class="entry-content tile" id="taxonomy-description">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
|
||||
<div style="width: 70%; margin: auto; margin-top: 20px; border: 2px dashed #020202; padding: 20px; border-radius: 25px;" class="entry-content tile" id="settings">
|
||||
<h3 style="margin-bottom: 14px;" class="subheading">Settings</h3>
|
||||
<form action="/experience-by-companies" id="settings" method="GET">
|
||||
<input class="checkbox" type="checkbox" id="toplevel" value="toplevel" checked="checked">
|
||||
<label for="toplevel">Display only top-level organisations</label>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend><p style="margin-top: 14px; margin-bottom: 14px;">Display only organisations with associated:</p></legend>
|
||||
<div class="controlgroup" id="typestodisplay">
|
||||
<label for="jobs">Roles <span class="dashicons dashicons-hammer"></span></label>
|
||||
<input type="checkbox" name="jobs" id="jobs" checked="checked">
|
||||
<label class="currentjobs" for="currentjobs">Display only current roles</label>
|
||||
<input class="currentjobs" type="checkbox" name="currentjobs" id="currentjobs" checked="checked">
|
||||
<label for="posts">Blog Posts <span class="dashicons dashicons-admin-post"></span></label>
|
||||
<input type="checkbox" name="posts" id="posts">
|
||||
<label for="websites">Websites <span class="dashicons dashicons-schedule"></span></label>
|
||||
<input type="checkbox" name="websites" id="websites">
|
||||
<label for="programs">Programs <span class="dashicons dashicons-desktop"></span></label>
|
||||
<input type="checkbox" name="programs" id="programs">
|
||||
<label for="writings">Writings <span class="dashicons dashicons-format-aside"></span></label>
|
||||
<input type="checkbox" name="writings" id="writings">
|
||||
<label for="videos">Videos <span class="dashicons dashicons-video-alt"></span></label>
|
||||
<input type="checkbox" name="videos" id="videos">
|
||||
<label for="other">Other <span class="dashicons dashicons-archive"></span></label>
|
||||
<input type="checkbox" name="other" id="other">
|
||||
<label for="qualifications">Qualifications <span class="dashicons dashicons-id"></span></label>
|
||||
<input type="checkbox" name="qualifications" id="qualifications">
|
||||
<label class="expired" for="expired">Show expired qualifications</label>
|
||||
<input class="expired" type="checkbox" name="expired" id="expired">
|
||||
<label for="awards">Awards <span class="dashicons dashicons-awards"></span></label>
|
||||
<input type="checkbox" name="awards" id="awards">
|
||||
</div>
|
||||
</fieldset>
|
||||
<br>
|
||||
<input class="ui-button ui-widget ui-corner-all" id="refresh" type="submit" value="Refresh">
|
||||
</form>
|
||||
</div>
|
||||
<div style="width: 70%; margin: auto; margin-top: 20px; border: 2px dashed #020202; padding: 20px; border-radius: 25px;" class="entry-content tile" id="settings">
|
||||
<h3 style="margin-bottom: 14px;" class="subheading">Settings</h3>
|
||||
<form action="/experience-by-companies" id="settings" method="GET">
|
||||
<input class="checkbox" type="checkbox" id="toplevel" value="toplevel" checked="checked">
|
||||
<label for="toplevel">Display only top-level organisations</label>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend><p style="margin-top: 14px; margin-bottom: 14px;">Display only organisations with associated:</p></legend>
|
||||
<div class="controlgroup" id="typestodisplay">
|
||||
<label for="jobs">Roles <span class="dashicons dashicons-hammer"></span></label>
|
||||
<input type="checkbox" name="jobs" id="jobs" checked="checked">
|
||||
<label class="currentjobs" for="currentjobs">Display only current roles</label>
|
||||
<input class="currentjobs" type="checkbox" name="currentjobs" id="currentjobs" checked="checked">
|
||||
<label for="posts">Blog Posts <span class="dashicons dashicons-admin-post"></span></label>
|
||||
<input type="checkbox" name="posts" id="posts">
|
||||
<label for="websites">Websites <span class="dashicons dashicons-schedule"></span></label>
|
||||
<input type="checkbox" name="websites" id="websites">
|
||||
<label for="programs">Programs <span class="dashicons dashicons-desktop"></span></label>
|
||||
<input type="checkbox" name="programs" id="programs">
|
||||
<label for="writings">Writings <span class="dashicons dashicons-format-aside"></span></label>
|
||||
<input type="checkbox" name="writings" id="writings">
|
||||
<label for="videos">Videos <span class="dashicons dashicons-video-alt"></span></label>
|
||||
<input type="checkbox" name="videos" id="videos">
|
||||
<label for="other">Other <span class="dashicons dashicons-archive"></span></label>
|
||||
<input type="checkbox" name="other" id="other">
|
||||
<label for="qualifications">Qualifications <span class="dashicons dashicons-id"></span></label>
|
||||
<input type="checkbox" name="qualifications" id="qualifications">
|
||||
<label class="expired" for="expired">Show expired qualifications</label>
|
||||
<input class="expired" type="checkbox" name="expired" id="expired">
|
||||
<label for="awards">Awards <span class="dashicons dashicons-awards"></span></label>
|
||||
<input type="checkbox" name="awards" id="awards">
|
||||
</div>
|
||||
</fieldset>
|
||||
<br>
|
||||
<input class="ui-button ui-widget ui-corner-all" id="refresh" type="submit" value="Refresh">
|
||||
</form>
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
</header>
|
||||
|
||||
|
@ -70,68 +73,68 @@ get_header(); ?>
|
|||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<script type="text/javascript">
|
||||
// Populates the organisations grid.
|
||||
jQuery(document).ready(function($) {
|
||||
// Sets up jQueryUI elements.
|
||||
$('input:checkbox').checkboxradio();
|
||||
$('.controlgroup').controlgroup();
|
||||
$('.refresh').button();
|
||||
// Populates the organisations grid.
|
||||
jQuery(document).ready(function($) {
|
||||
// Sets up jQueryUI elements.
|
||||
$('input:checkbox').checkboxradio();
|
||||
$('.controlgroup').controlgroup();
|
||||
$('.refresh').button();
|
||||
|
||||
// Displays the initial organisations grid.
|
||||
displayCompanies();
|
||||
// Displays the initial organisations grid.
|
||||
displayCompanies();
|
||||
|
||||
$('.expired').hide();
|
||||
$('.expired').hide();
|
||||
|
||||
$('input[type="checkbox"]').change(function() {
|
||||
$('#refresh').css('border-width', '5px');
|
||||
});
|
||||
$('input[type="checkbox"]').change(function() {
|
||||
$('#refresh').css('border-width', '5px');
|
||||
});
|
||||
|
||||
$('#jobs').change(function() {
|
||||
if($(this).is(":checked")) {
|
||||
$('.currentjobs').fadeIn(100);
|
||||
} else {
|
||||
$('.currentjobs').fadeOut(100);
|
||||
}
|
||||
});
|
||||
$('#jobs').change(function() {
|
||||
if($(this).is(":checked")) {
|
||||
$('.currentjobs').fadeIn(100);
|
||||
} else {
|
||||
$('.currentjobs').fadeOut(100);
|
||||
}
|
||||
});
|
||||
|
||||
$('#qualifications').change(function() {
|
||||
if($(this).is(":checked")) {
|
||||
$('.expired').fadeIn(100);
|
||||
} else {
|
||||
$('.expired').fadeOut(100);
|
||||
}
|
||||
});
|
||||
$('#qualifications').change(function() {
|
||||
if($(this).is(":checked")) {
|
||||
$('.expired').fadeIn(100);
|
||||
} else {
|
||||
$('.expired').fadeOut(100);
|
||||
}
|
||||
});
|
||||
|
||||
$('#refresh').click(function(event) {
|
||||
$(this).css('border-width', '1px');
|
||||
event.preventDefault();
|
||||
displayCompanies();
|
||||
});
|
||||
$('#refresh').click(function(event) {
|
||||
$(this).css('border-width', '1px');
|
||||
event.preventDefault();
|
||||
displayCompanies();
|
||||
});
|
||||
|
||||
function displayCompanies() {
|
||||
$('#organisations-grid').html('<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">');
|
||||
function displayCompanies() {
|
||||
$('#organisations-grid').html('<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">');
|
||||
|
||||
var settings = {
|
||||
'action': 'display_companies',
|
||||
'toplevel': $('#toplevel').is(':checked'),
|
||||
'job': $('#jobs').is(':checked'),
|
||||
'currentjobs': $('#currentjobs').is(':checked'),
|
||||
'post': $('#posts').is(':checked'),
|
||||
'website': $('#websites').is(':checked'),
|
||||
'program': $('#programs').is(':checked'),
|
||||
'writing': $('#writings').is(':checked'),
|
||||
'video': $('#videos').is(':checked'),
|
||||
'other': $('#other').is(':checked'),
|
||||
'qualification': $('#qualifications').is(':checked'),
|
||||
'showexpired': $('#expired').is(':checked'),
|
||||
'award': $('#awards').is(':checked'),
|
||||
};
|
||||
var settings = {
|
||||
'action': 'display_companies',
|
||||
'toplevel': $('#toplevel').is(':checked'),
|
||||
'job': $('#jobs').is(':checked'),
|
||||
'currentjobs': $('#currentjobs').is(':checked'),
|
||||
'post': $('#posts').is(':checked'),
|
||||
'website': $('#websites').is(':checked'),
|
||||
'program': $('#programs').is(':checked'),
|
||||
'writing': $('#writings').is(':checked'),
|
||||
'video': $('#videos').is(':checked'),
|
||||
'other': $('#other').is(':checked'),
|
||||
'qualification': $('#qualifications').is(':checked'),
|
||||
'showexpired': $('#expired').is(':checked'),
|
||||
'award': $('#awards').is(':checked'),
|
||||
};
|
||||
|
||||
$.post("/wp-admin/admin-ajax.php", settings, function(response) {
|
||||
$('#organisations-grid').html(response);
|
||||
});
|
||||
}
|
||||
});
|
||||
$.post("/wp-admin/admin-ajax.php", settings, function(response) {
|
||||
$('#organisations-grid').html(response);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying archive pages.
|
||||
*
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying archive pages.
|
||||
*
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
@ -12,74 +12,88 @@
|
|||
<?php $loop = new WP_Query( $args ); ?>
|
||||
<header class="entry-content tile location-block">
|
||||
<div class="post-header-title">
|
||||
<h1 id="page-title">Experience</h1>
|
||||
<h2 id="page-subtitle">by location</h2>
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<h1 id="page-title">Experience</h1>
|
||||
<h2 id="page-subtitle">by location</h2>
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
?>
|
||||
<div class="entry-content" id="taxonomy-description">
|
||||
<?php the_content() ?>
|
||||
<div>
|
||||
<a class="hyperlink-button" href="?view=countries">Countries</a>
|
||||
<!--<a class="hyperlink-button" href="?view=regions">Regions</a>-->
|
||||
<a class="hyperlink-button" href="?view=locations">Locations</a>
|
||||
</div>
|
||||
<?php the_content(); ?>
|
||||
<div>
|
||||
<a class="hyperlink-button" href="?view=countries">Countries</a>
|
||||
<!--<a class="hyperlink-button" href="?view=regions">Regions</a>-->
|
||||
<a class="hyperlink-button" href="?view=locations">Locations</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?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.
|
||||
$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">
|
||||
<main id="company-main" class="site-main" role="main">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div id="map" style="height:100vh; width:100%;"></div>
|
||||
</div>
|
||||
<?php if (!empty($locations)): ?>
|
||||
<?php if ($_GET['view'] == "countries"): ?>
|
||||
<?php
|
||||
$locationsSubset = array_filter($locations, function ($t) {
|
||||
return $t->parent != 0 && get_term($t->parent, 'location')->parent == 0;
|
||||
});
|
||||
?>
|
||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||
<script type="text/javascript">
|
||||
google.charts.load('current', {'packages':['geochart']});
|
||||
google.charts.setOnLoadCallback(drawMap);
|
||||
</div>
|
||||
<?php if ( ! empty( $locations ) ) : ?>
|
||||
<?php if ( $_GET['view'] == 'countries' ) : ?>
|
||||
<?php
|
||||
$locationsSubset = array_filter(
|
||||
$locations,
|
||||
function ( $t ) {
|
||||
return $t->parent != 0 && get_term( $t->parent, 'location' )->parent == 0;
|
||||
}
|
||||
);
|
||||
?>
|
||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||
<script type="text/javascript">
|
||||
google.charts.load('current', {'packages':['geochart']});
|
||||
google.charts.setOnLoadCallback(drawMap);
|
||||
|
||||
function drawMap() {
|
||||
function drawMap() {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Country'],
|
||||
<?php foreach ((array)$locationsSubset as $term): ?>
|
||||
['<?php echo $term->description ?>'],
|
||||
['Country'],
|
||||
<?php foreach ( (array) $locationsSubset as $term ) : ?>
|
||||
['<?php echo $term->description; ?>'],
|
||||
<?php endforeach; ?>
|
||||
]);
|
||||
var options = {};
|
||||
var chart = new google.visualization.GeoChart(document.getElementById('map'));
|
||||
|
||||
chart.draw(data, options);
|
||||
}
|
||||
</script>
|
||||
<?php elseif ($_GET['view'] == "locations"): ?>
|
||||
<?php
|
||||
$locationsSubset = array_filter($locations, function ($t) {
|
||||
return $t->parent != 0 && get_term($t->parent, 'location')->parent != 0 && get_term(get_term($t->parent, 'location')->parent, 'location')->parent != 0 && get_term(get_term(get_term($t->parent, 'location')->parent, 'location')->parent, 'location')->parent == 0;
|
||||
});
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var locations = [
|
||||
<?php foreach((array)$locationsSubset as $term): ?>
|
||||
{<?php echo $term->description ?>},
|
||||
<?php endforeach; ?>
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<?php elseif ( $_GET['view'] == 'locations' ) : ?>
|
||||
<?php
|
||||
$locationsSubset = array_filter(
|
||||
$locations,
|
||||
function ( $t ) {
|
||||
return $t->parent != 0 && get_term( $t->parent, 'location' )->parent != 0 && get_term( get_term( $t->parent, 'location' )->parent, 'location' )->parent != 0 && get_term( get_term( get_term( $t->parent, 'location' )->parent, 'location' )->parent, 'location' )->parent == 0;
|
||||
}
|
||||
);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var locations = [
|
||||
<?php foreach ( (array) $locationsSubset as $term ) : ?>
|
||||
{<?php echo $term->description; ?>},
|
||||
<?php endforeach; ?>
|
||||
]
|
||||
|
||||
function initMap() {
|
||||
function initMap() {
|
||||
var map = new google.maps.Map(document.getElementById('map'), {
|
||||
zoom: 3,
|
||||
center: {lat: 51.483462, lng: 0.0586198}
|
||||
zoom: 3,
|
||||
center: {lat: 51.483462, lng: 0.0586198}
|
||||
});
|
||||
|
||||
// Create an array of alphabetical characters used to label the markers.
|
||||
|
@ -90,22 +104,22 @@
|
|||
// create an array of markers based on a given "locations" array.
|
||||
// The map() method here has nothing to do with the Google Maps API.
|
||||
var markers = locations.map(function(location, i) {
|
||||
return new google.maps.Marker({
|
||||
return new google.maps.Marker({
|
||||
position: location,
|
||||
label: labels[i % labels.length]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Add a marker clusterer to manage the markers.
|
||||
var markerCluster = new MarkerClusterer(map, markers, {
|
||||
imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'
|
||||
imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
|
||||
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsMPnuCM59sC_n11CGxbpbqNY7FRUXnD0&callback=initMap"></script>
|
||||
}
|
||||
</script>
|
||||
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
|
||||
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsMPnuCM59sC_n11CGxbpbqNY7FRUXnD0&callback=initMap"></script>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</main><!-- .site-main -->
|
||||
</div><!-- .content-area -->
|
||||
|
||||
|
|
36
page.php
36
page.php
|
@ -1,32 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying pages.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying pages.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<main id="split-page" role="main">
|
||||
<?php
|
||||
// Start the loop.
|
||||
while (have_posts()):
|
||||
the_post();
|
||||
// Start the loop.
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
// Include the page content template.
|
||||
get_template_part('template-parts/content', 'page');
|
||||
// Include the page content template.
|
||||
get_template_part( 'template-parts/content', 'page' );
|
||||
|
||||
// If comments are open or we have at least one comment, load up the comment template.
|
||||
if (comments_open() || get_comments_number()) {
|
||||
comments_template();
|
||||
}
|
||||
// If comments are open or we have at least one comment, load up the comment template.
|
||||
if ( comments_open() || get_comments_number() ) {
|
||||
comments_template();
|
||||
}
|
||||
|
||||
// End of the loop.
|
||||
endwhile;
|
||||
?>
|
||||
// End of the loop.
|
||||
endwhile;
|
||||
?>
|
||||
</main>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
34
phpcs.xml
Normal file
34
phpcs.xml
Normal 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>
|
19
search.php
19
search.php
|
@ -20,7 +20,8 @@ get_header(); ?>
|
|||
|
||||
<?php
|
||||
// Start the loop.
|
||||
while ( have_posts() ) : the_post();
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
/**
|
||||
* Run the loop for the search to output the results.
|
||||
|
@ -29,17 +30,19 @@ get_header(); ?>
|
|||
*/
|
||||
get_template_part( 'template-parts/content', 'search' );
|
||||
|
||||
// End the loop.
|
||||
// End the loop.
|
||||
endwhile;
|
||||
|
||||
// Previous/next page navigation.
|
||||
the_posts_pagination( array(
|
||||
'prev_text' => __( 'Previous page', 'twentysixteen' ),
|
||||
'next_text' => __( 'Next page', 'twentysixteen' ),
|
||||
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
|
||||
) );
|
||||
the_posts_pagination(
|
||||
array(
|
||||
'prev_text' => __( 'Previous page', 'twentysixteen' ),
|
||||
'next_text' => __( 'Next page', 'twentysixteen' ),
|
||||
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
|
||||
)
|
||||
);
|
||||
|
||||
// If no content, include the "No posts found" template.
|
||||
// If no content, include the "No posts found" template.
|
||||
else :
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
|
||||
|
|
32
sidebar.php
32
sidebar.php
|
@ -1,26 +1,26 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for the sidebar.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for the sidebar.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<nav class="col-2" id="sidebar">
|
||||
<ul id="sidebar-list">
|
||||
<li <?php echo $wp->request == 'blog' ? 'class="current"' : ''; ?>>
|
||||
<li <?php echo $wp->request == 'blog' ? 'class="current"' : ''; ?>>
|
||||
<a href="/blog">Blog</a>
|
||||
<a href="/feed"><i class="fa fa-rss"></i></a>
|
||||
</li>
|
||||
<li><p>~</p></li>
|
||||
<li <?php echo $wp->request == 'website' ? 'class="current"' : ''; ?>><a href="/website">Websites</a></li>
|
||||
<li <?php echo $wp->request == 'program' ? 'class="current"' : ''; ?>><a href="/program">Programs</a></li>
|
||||
<li <?php echo $wp->request == 'writing' ? 'class="current"' : ''; ?>><a href="/writing">Writings</a></li>
|
||||
<li <?php echo $wp->request == 'video' ? 'class="current"' : ''; ?>><a href="/video">Videos</a></li>
|
||||
<li <?php echo $wp->request == 'other' ? 'class="current"' : ''; ?>><a href="/other">Other</a></li>
|
||||
<li><p>~</p></li>
|
||||
<li <?php echo $wp->request == 'experience' ? 'class="current"' : ''; ?>><a href="/experience">Experience (by organisation)</a></li>
|
||||
</li>
|
||||
<li><p>~</p></li>
|
||||
<li <?php echo $wp->request == 'website' ? 'class="current"' : ''; ?>><a href="/website">Websites</a></li>
|
||||
<li <?php echo $wp->request == 'program' ? 'class="current"' : ''; ?>><a href="/program">Programs</a></li>
|
||||
<li <?php echo $wp->request == 'writing' ? 'class="current"' : ''; ?>><a href="/writing">Writings</a></li>
|
||||
<li <?php echo $wp->request == 'video' ? 'class="current"' : ''; ?>><a href="/video">Videos</a></li>
|
||||
<li <?php echo $wp->request == 'other' ? 'class="current"' : ''; ?>><a href="/other">Other</a></li>
|
||||
<li><p>~</p></li>
|
||||
<li <?php echo $wp->request == 'experience' ? 'class="current"' : ''; ?>><a href="/experience">Experience (by organisation)</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
35
single.php
35
single.php
|
@ -1,29 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying all single Pages.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for displaying all single Pages.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<main id="split-page" role="main">
|
||||
<?php
|
||||
// Start the loop.
|
||||
while (have_posts()): the_post();
|
||||
// Include the single post content template.
|
||||
get_template_part( 'template-parts/content', 'single' );
|
||||
// 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;
|
||||
?>
|
||||
// If comments are open or we have at least one comment, load up the comment template.
|
||||
if ( comments_open() || get_comments_number() ) {
|
||||
comments_template();
|
||||
}
|
||||
// End of the loop.
|
||||
endwhile;
|
||||
?>
|
||||
</main><!-- .site-main -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for showing experience (by organisation).
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template for showing experience (by organisation).
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
@ -13,230 +13,259 @@
|
|||
<?php
|
||||
// Gets all of the roles attached to the given organisation.
|
||||
$company = get_queried_object();
|
||||
echo "<!-- ".$company->name."-->";
|
||||
$args= array(
|
||||
'post_type' => array( 'job' ),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'company',
|
||||
'field' => 'slug',
|
||||
'terms' => $company->slug,
|
||||
),
|
||||
),
|
||||
'posts_per_page' => -1
|
||||
echo '<!-- ' . $company->name . '-->';
|
||||
$args = array(
|
||||
'post_type' => array( 'job' ),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'company',
|
||||
'field' => 'slug',
|
||||
'terms' => $company->slug,
|
||||
),
|
||||
),
|
||||
'posts_per_page' => -1,
|
||||
);
|
||||
|
||||
$loop = new WP_Query( $args );
|
||||
?>
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
google.charts.load('current', {'packages':['timeline']});
|
||||
|
||||
<?php if ($loop->have_posts()): ?>
|
||||
<?php if ( $loop->have_posts() ) : ?>
|
||||
google.charts.setOnLoadCallback(drawChart);
|
||||
<?php endif; ?>
|
||||
|
||||
function drawChart() {
|
||||
var container = document.getElementById('timeline');
|
||||
var chart = new google.visualization.Timeline(container);
|
||||
var dataTable = new google.visualization.DataTable();
|
||||
var container = document.getElementById('timeline');
|
||||
var chart = new google.visualization.Timeline(container);
|
||||
var dataTable = new google.visualization.DataTable();
|
||||
|
||||
dataTable.addColumn({ type: 'string', id: 'Type' });
|
||||
dataTable.addColumn({ type: 'string', id: 'Job Title' });
|
||||
dataTable.addColumn({ type: 'date', id: 'Start' });
|
||||
dataTable.addColumn({ type: 'date', id: 'End' });
|
||||
dataTable.addRows([
|
||||
<?php while ($loop->have_posts()): $loop->the_post();
|
||||
// Gets all of the roles associated with this organisation and its
|
||||
// child organisations.
|
||||
$companies = wp_get_object_terms(get_the_ID(), 'company');
|
||||
$i = 0;
|
||||
$currSizeOf = -1;
|
||||
dataTable.addColumn({ type: 'string', id: 'Type' });
|
||||
dataTable.addColumn({ type: 'string', id: 'Job Title' });
|
||||
dataTable.addColumn({ type: 'date', id: 'Start' });
|
||||
dataTable.addColumn({ type: 'date', id: 'End' });
|
||||
dataTable.addRows([
|
||||
<?php
|
||||
while ( $loop->have_posts() ) :
|
||||
$loop->the_post();
|
||||
// Gets all of the roles associated with this organisation and its
|
||||
// child organisations.
|
||||
$companies = wp_get_object_terms( get_the_ID(), 'company' );
|
||||
$i = 0;
|
||||
$currSizeOf = -1;
|
||||
|
||||
foreach ($companies as $company) {
|
||||
if (sizeof(get_ancestors($company->term_id, 'company')) > $currSizeOf) {
|
||||
$currSizeOf = sizeof(get_ancestors($company->term_id, 'company'));
|
||||
$lowestDepthCompany = $i++;
|
||||
}
|
||||
}
|
||||
foreach ( $companies as $company ) {
|
||||
if ( sizeof( get_ancestors( $company->term_id, 'company' ) ) > $currSizeOf ) {
|
||||
$currSizeOf = sizeof( get_ancestors( $company->term_id, 'company' ) );
|
||||
$lowestDepthCompany = $i++;
|
||||
}
|
||||
}
|
||||
|
||||
$title = html_entity_decode(get_the_title());
|
||||
$start = get_the_date();
|
||||
$end = (!get_post_meta(get_the_ID(), 'end-date', true)) ? date('D M d Y H:i:s O') : get_post_meta(get_the_ID(), 'end-date', true);
|
||||
echo "[ '".html_entity_decode($companies[$lowestDepthCompany]->name)."', '$title', new Date('$start'), new Date('$end') ],\n";
|
||||
endwhile; ?>
|
||||
]);
|
||||
$title = html_entity_decode( get_the_title() );
|
||||
$start = get_the_date();
|
||||
$end = ( ! get_post_meta( get_the_ID(), 'end-date', true ) ) ? date( 'D M d Y H:i:s O' ) : get_post_meta( get_the_ID(), 'end-date', true );
|
||||
echo "[ '" . html_entity_decode( $companies[ $lowestDepthCompany ]->name ) . "', '$title', new Date('$start'), new Date('$end') ],\n";
|
||||
endwhile;
|
||||
?>
|
||||
]);
|
||||
|
||||
// Draws the table, then resizes the element height and re-draws it
|
||||
// to avoid needing to scroll vertically.
|
||||
chart.draw(dataTable);
|
||||
var realheight = parseInt(jQuery("#timeline div:first-child div:first-child div:first-child div svg").attr("height"))+70;
|
||||
var options = {};
|
||||
options.height = realheight;
|
||||
chart.draw(dataTable, options);
|
||||
// Draws the table, then resizes the element height and re-draws it
|
||||
// to avoid needing to scroll vertically.
|
||||
chart.draw(dataTable);
|
||||
var realheight = parseInt(jQuery("#timeline div:first-child div:first-child div:first-child div svg").attr("height"))+70;
|
||||
var options = {};
|
||||
options.height = realheight;
|
||||
chart.draw(dataTable, options);
|
||||
}
|
||||
</script>
|
||||
|
||||
<main id="split-page" role="main">
|
||||
<?php
|
||||
$companyLogo = apply_filters('taxonomy-images-queried-term-image-url', '', array('image_size' => 'full'));
|
||||
$companyLogo = apply_filters( 'taxonomy-images-queried-term-image-url', '', array( 'image_size' => 'full' ) );
|
||||
$companyName = get_queried_object()->name;
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<header style="background-image: url('<?php echo $companyLogo ?>'); background-color: <?php echo get_term_meta(get_queried_object()->term_id, 'color')[0] ?>; background-size: contain;">
|
||||
<div>
|
||||
<?php
|
||||
if (strlen($companyName) > 70) $small= "2em";
|
||||
elseif (strlen($companyName) > 35) $small = "3em";
|
||||
elseif (strlen($companyName) > 12) $small = "4em";
|
||||
else $small = "5em"
|
||||
?>
|
||||
<h1 id="post-title" style="font-size: <?php echo $small ?>;"><?php echo $companyName; ?></h1>
|
||||
</div>
|
||||
</header><!-- .entry-header -->
|
||||
<header style="background-image: url('<?php echo $companyLogo; ?>'); background-color: <?php echo get_term_meta( get_queried_object()->term_id, 'color' )[0]; ?>; background-size: contain;">
|
||||
<div>
|
||||
<?php
|
||||
if ( strlen( $companyName ) > 70 ) {
|
||||
$small = '2em';
|
||||
} elseif ( strlen( $companyName ) > 35 ) {
|
||||
$small = '3em';
|
||||
} elseif ( strlen( $companyName ) > 12 ) {
|
||||
$small = '4em';
|
||||
} else {
|
||||
$small = '5em';
|
||||
}
|
||||
?>
|
||||
<h1 id="post-title" style="font-size: <?php echo $small; ?>;"><?php echo $companyName; ?></h1>
|
||||
</div>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<main id="organisation-body" class="body">
|
||||
<section id="description">
|
||||
<?php the_archive_description(); ?>
|
||||
</section>
|
||||
<?php if ($loop->have_posts()): ?>
|
||||
<section id="timeline">
|
||||
<div class="row">
|
||||
<div id="timeline" class="col-12">
|
||||
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<section id="related" class="row">
|
||||
<div id="parents" class="col-6 col-m-12">
|
||||
<?php
|
||||
if (get_queried_object()->parent != 0) {
|
||||
$parents = apply_filters("taxonomy-images-get-terms", "",
|
||||
array(
|
||||
'having_images' => false,
|
||||
'taxonomy' => 'company',
|
||||
'term_args' => array(
|
||||
'include' => get_term_by('id', get_queried_object()->parent, 'company')->term_id
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
<main id="organisation-body" class="body">
|
||||
<section id="description">
|
||||
<?php the_archive_description(); ?>
|
||||
</section>
|
||||
<?php if ( $loop->have_posts() ) : ?>
|
||||
<section id="timeline">
|
||||
<div class="row">
|
||||
<div id="timeline" class="col-12">
|
||||
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<section id="related" class="row">
|
||||
<div id="parents" class="col-6 col-m-12">
|
||||
<?php
|
||||
if ( get_queried_object()->parent != 0 ) {
|
||||
$parents = apply_filters(
|
||||
'taxonomy-images-get-terms',
|
||||
'',
|
||||
array(
|
||||
'having_images' => false,
|
||||
'taxonomy' => 'company',
|
||||
'term_args' => array(
|
||||
'include' => get_term_by( 'id', get_queried_object()->parent, 'company' )->term_id,
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (count($parents) > 0): ?>
|
||||
<h2 class="subheading">Parent</h2>
|
||||
<ul class="index">
|
||||
<?php foreach ((array) $parents as $parent):
|
||||
$imgURL = wp_get_attachment_image_src($parent->image_id)[0];
|
||||
$colour = get_term_meta($parent->term_id, 'color', true);
|
||||
$colour = ($colour != "") ? $colour : "transparent"; ?>
|
||||
if ( count( $parents ) > 0 ) :
|
||||
?>
|
||||
<h2 class="subheading">Parent</h2>
|
||||
<ul class="index">
|
||||
<?php
|
||||
foreach ( (array) $parents as $parent ) :
|
||||
$imgURL = wp_get_attachment_image_src( $parent->image_id )[0];
|
||||
$colour = get_term_meta( $parent->term_id, 'color', true );
|
||||
$colour = ( $colour != '' ) ? $colour : 'transparent';
|
||||
?>
|
||||
|
||||
<li><a href="<?php echo esc_url(get_term_link($parent, $parent->taxonomy)) ?>"><?php echo get_term($parent->term_id, 'company')->name ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<li><a href="<?php echo esc_url( get_term_link( $parent, $parent->taxonomy ) ); ?>"><?php echo get_term( $parent->term_id, 'company' )->name; ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div id="children" class="col-6 col-m-12">
|
||||
<?php
|
||||
$children = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company', 'term_args' => array('parent' => get_queried_object()->term_id)));
|
||||
if (count($children) > 0): ?>
|
||||
<h2 class="subheading">Child<?php echo (count($children) != 1) ? "ren" : ""; ?></h2>
|
||||
<ul class="index">
|
||||
<?php foreach ( (array) $children as $child ):
|
||||
$imgURL = wp_get_attachment_image_src($child->image_id, 'detail')[0];
|
||||
$colour = get_term_meta($child->term_id, 'color', true);
|
||||
$colour = ($colour != "") ? $colour : "transparent"; ?>
|
||||
<div id="children" class="col-6 col-m-12">
|
||||
<?php
|
||||
$children = apply_filters(
|
||||
'taxonomy-images-get-terms',
|
||||
'',
|
||||
array(
|
||||
'having_images' => false,
|
||||
'taxonomy' => 'company',
|
||||
'term_args' => array( 'parent' => get_queried_object()->term_id ),
|
||||
)
|
||||
);
|
||||
if ( count( $children ) > 0 ) :
|
||||
?>
|
||||
<h2 class="subheading">Child<?php echo ( count( $children ) != 1 ) ? 'ren' : ''; ?></h2>
|
||||
<ul class="index">
|
||||
<?php
|
||||
foreach ( (array) $children as $child ) :
|
||||
$imgURL = wp_get_attachment_image_src( $child->image_id, 'detail' )[0];
|
||||
$colour = get_term_meta( $child->term_id, 'color', true );
|
||||
$colour = ( $colour != '' ) ? $colour : 'transparent';
|
||||
?>
|
||||
|
||||
<li><a href="<?php echo esc_url(get_term_link($child, $child->taxonomy)) ?>"><?php echo get_term($child->term_id, 'company')->name ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p>No children.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<li><a href="<?php echo esc_url( get_term_link( $child, $child->taxonomy ) ); ?>"><?php echo get_term( $child->term_id, 'company' )->name; ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php else : ?>
|
||||
<p>No children.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
$pageOrder = array( 'post', 'website', 'program', 'writing', 'video', 'other');
|
||||
foreach ($pageOrder as $currSec) {
|
||||
$args['post_type'] = array( $currSec );
|
||||
$i = 0;
|
||||
$loop = new WP_Query( $args );
|
||||
$pageOrder = array( 'post', 'website', 'program', 'writing', 'video', 'other' );
|
||||
foreach ( $pageOrder as $currSec ) {
|
||||
$args['post_type'] = array( $currSec );
|
||||
$i = 0;
|
||||
$loop = new WP_Query( $args );
|
||||
|
||||
if ( $loop->have_posts() ):
|
||||
echo '<section id="'.$currSec.'" class="org-items row">';
|
||||
echo '<h2 class="subheading">'.ucwords($currSec).'s <a href="/'.($currSec != "post" ? $currSec : "blog").'?company='.get_queried_object()->slug.'">View all '.$loop->post_count.'</a></h2>';
|
||||
echo '<div class="index">';
|
||||
while (($loop->have_posts()) && ($i++ < 4)) : $loop->the_post();
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
endwhile;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
endif;
|
||||
}
|
||||
echo '<section id="quals-and-awards">';
|
||||
echo '<div id="qualifications" class="org-items row">';
|
||||
$args['post_type'] = 'qualification';
|
||||
$loop = new WP_Query( $args );
|
||||
echo '<h2 class="subheading">Qualifications</h2>';
|
||||
if ( $loop->have_posts() ):
|
||||
echo '<ul class="index">';
|
||||
while ($loop->have_posts()) : $loop->the_post();
|
||||
$url = esc_url(get_permalink());
|
||||
echo '<li><a href="'.$url.'">'.get_the_title().'</a></li>';
|
||||
endwhile;
|
||||
echo '</ul>';
|
||||
else:
|
||||
echo '<p>No qualifications.</p>';
|
||||
endif;
|
||||
echo '</div>';
|
||||
if ( $loop->have_posts() ) :
|
||||
echo '<section id="' . $currSec . '" class="org-items row">';
|
||||
echo '<h2 class="subheading">' . ucwords( $currSec ) . 's <a href="/' . ( $currSec != 'post' ? $currSec : 'blog' ) . '?company=' . get_queried_object()->slug . '">View all ' . $loop->post_count . '</a></h2>';
|
||||
echo '<div class="index">';
|
||||
while ( ( $loop->have_posts() ) && ( $i++ < 4 ) ) :
|
||||
$loop->the_post();
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
endwhile;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
endif;
|
||||
}
|
||||
echo '<section id="quals-and-awards">';
|
||||
echo '<div id="qualifications" class="org-items row">';
|
||||
$args['post_type'] = 'qualification';
|
||||
$loop = new WP_Query( $args );
|
||||
echo '<h2 class="subheading">Qualifications</h2>';
|
||||
if ( $loop->have_posts() ) :
|
||||
echo '<ul class="index">';
|
||||
while ( $loop->have_posts() ) :
|
||||
$loop->the_post();
|
||||
$url = esc_url( get_permalink() );
|
||||
echo '<li><a href="' . $url . '">' . get_the_title() . '</a></li>';
|
||||
endwhile;
|
||||
echo '</ul>';
|
||||
else :
|
||||
echo '<p>No qualifications.</p>';
|
||||
endif;
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="awards" class="org-items row">';
|
||||
$args['post_type'] = 'award';
|
||||
$loop = new WP_Query( $args );
|
||||
echo '<h2 class="subheading">Awards</h2>';
|
||||
if ( $loop->have_posts() ):
|
||||
echo '<ul class="index">';
|
||||
while ($loop->have_posts()) : $loop->the_post();
|
||||
$url = esc_url(get_permalink());
|
||||
echo '<li><a href="'.$url.'">'.get_the_title().'</a></li>';
|
||||
endwhile;
|
||||
echo '</ul>';
|
||||
else:
|
||||
echo '<p>No awards.</p>';
|
||||
endif;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
echo '<div id="awards" class="org-items row">';
|
||||
$args['post_type'] = 'award';
|
||||
$loop = new WP_Query( $args );
|
||||
echo '<h2 class="subheading">Awards</h2>';
|
||||
if ( $loop->have_posts() ) :
|
||||
echo '<ul class="index">';
|
||||
while ( $loop->have_posts() ) :
|
||||
$loop->the_post();
|
||||
$url = esc_url( get_permalink() );
|
||||
echo '<li><a href="' . $url . '">' . get_the_title() . '</a></li>';
|
||||
endwhile;
|
||||
echo '</ul>';
|
||||
else :
|
||||
echo '<p>No awards.</p>';
|
||||
endif;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
|
||||
$args['post_type'] = 'appearance';
|
||||
$loop = new WP_Query( $args );
|
||||
if ( $loop->have_posts() ):
|
||||
echo '<section id="appearances" class="org-items row">';
|
||||
echo '<h2 class="subheading">Appearances <a href="/appearance?company='.get_queried_object()->slug.'">View all '.$loop->post_count.'</a></h2>';
|
||||
echo '<div class="index">';
|
||||
while (($loop->have_posts())) : $loop->the_post();
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
endwhile;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
endif;
|
||||
$args['post_type'] = 'appearance';
|
||||
$loop = new WP_Query( $args );
|
||||
if ( $loop->have_posts() ) :
|
||||
echo '<section id="appearances" class="org-items row">';
|
||||
echo '<h2 class="subheading">Appearances <a href="/appearance?company=' . get_queried_object()->slug . '">View all ' . $loop->post_count . '</a></h2>';
|
||||
echo '<div class="index">';
|
||||
while ( ( $loop->have_posts() ) ) :
|
||||
$loop->the_post();
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
endwhile;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
endif;
|
||||
|
||||
$args['post_type'] = 'correspondence';
|
||||
$loop = new WP_Query( $args );
|
||||
if ( $loop->have_posts() ):
|
||||
echo '<section id="correspondence" class="org-items row">';
|
||||
echo '<h2 class="subheading">Correspondence <a href="/correspondence?company='.get_queried_object()->slug.'">View all '.$loop->post_count.'</a></h2>';
|
||||
echo '<div class="index">';
|
||||
while (($loop->have_posts())) : $loop->the_post();
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
endwhile;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
endif;
|
||||
?>
|
||||
</main>
|
||||
$args['post_type'] = 'correspondence';
|
||||
$loop = new WP_Query( $args );
|
||||
if ( $loop->have_posts() ) :
|
||||
echo '<section id="correspondence" class="org-items row">';
|
||||
echo '<h2 class="subheading">Correspondence <a href="/correspondence?company=' . get_queried_object()->slug . '">View all ' . $loop->post_count . '</a></h2>';
|
||||
echo '<div class="index">';
|
||||
while ( ( $loop->have_posts() ) ) :
|
||||
$loop->the_post();
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
endwhile;
|
||||
echo '</div>';
|
||||
echo '</section>';
|
||||
endif;
|
||||
?>
|
||||
</main>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* The template part for displaying a message that posts cannot be found.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template part for displaying a message that posts cannot be found.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<section class="no-results not-found">
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* The template used for displaying page content.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Sixteen
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
* The template used for displaying page content.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Sixteen
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="wrapper" <?php post_class(); ?>>
|
||||
<header style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
|
||||
<div>
|
||||
<div>
|
||||
<h1 id="post-title"><?php echo get_the_title(); ?></h1>
|
||||
<?php if ($subtitle = get_post_meta(get_the_ID(), 'Subtitle', true)): ?>
|
||||
<h2 id="post-subtitle"><?php echo $subtitle ?></h2>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?>
|
||||
<h2 id="post-subtitle"><?php echo $subtitle; ?></h2>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<main id="page-body" class="body">
|
||||
<?php
|
||||
if (get_the_content()):
|
||||
the_content();
|
||||
else:
|
||||
echo get_the_excerpt();
|
||||
<?php
|
||||
if ( get_the_content() ) :
|
||||
the_content();
|
||||
else :
|
||||
echo get_the_excerpt();
|
||||
endif;
|
||||
?>
|
||||
?>
|
||||
</main><!-- .entry-content -->
|
||||
</article><!-- #post-## -->
|
||||
|
|
|
@ -1,106 +1,114 @@
|
|||
<?php
|
||||
/**
|
||||
* The template part for displaying single Posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template part for displaying single Posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="wrapper" <?php post_class(); ?>>
|
||||
<header style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
|
||||
<div>
|
||||
<h1 id="post-title"><?php echo get_the_title(); ?></h1>
|
||||
<?php if ($subtitle = get_post_meta(get_the_ID(), 'Subtitle', true)): ?>
|
||||
<h2 id="post-subtitle"><?php echo $subtitle ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php //the_date('F j\<\s\u\p\>S\<\/\s\u\p\>, 1,Y \H\.\E\.', '<h3>', '</h3>'); ?>
|
||||
</div>
|
||||
<div>
|
||||
<h1 id="post-title"><?php echo get_the_title(); ?></h1>
|
||||
<?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?>
|
||||
<h2 id="post-subtitle"><?php echo $subtitle; ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php // the_date('F j\<\s\u\p\>S\<\/\s\u\p\>, 1,Y \H\.\E\.', '<h3>', '</h3>'); ?>
|
||||
</div>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<main id="post-body" class="body">
|
||||
<?php $date1 = strtotime(get_the_date('Y-m-d')); ?>
|
||||
<?php $date2 = strtotime(date('Y-m-d')); ?>
|
||||
<?php if (has_category('series') || has_tag('ohwhatohjeez') || get_post_meta(get_the_ID(), 'Note(s)', true) || get_post_meta(get_the_ID(), 'License', true) || ($date1 < $date2 - 31557600)): ?>
|
||||
<div id="details">
|
||||
<ul>
|
||||
<?php
|
||||
if (has_category('thoughts')) $type = "thought";
|
||||
else if (has_category('reports')) $type = "report";
|
||||
else if (has_category('review')) $type = "review";
|
||||
<?php $date1 = strtotime( get_the_date( 'Y-m-d' ) ); ?>
|
||||
<?php $date2 = strtotime( date( 'Y-m-d' ) ); ?>
|
||||
<?php if ( has_category( 'series' ) || has_tag( 'ohwhatohjeez' ) || get_post_meta( get_the_ID(), 'Note(s)', true ) || get_post_meta( get_the_ID(), 'License', true ) || ( $date1 < $date2 - 31557600 ) ) : ?>
|
||||
<div id="details">
|
||||
<ul>
|
||||
<?php
|
||||
if ( has_category( 'thoughts' ) ) {
|
||||
$type = 'thought';
|
||||
} else if ( has_category( 'reports' ) ) {
|
||||
$type = 'report';
|
||||
} else if ( has_category( 'review' ) ) {
|
||||
$type = 'review';
|
||||
}
|
||||
|
||||
if (has_category('series')) {
|
||||
$catag = "is a part of the following series";
|
||||
$series = [];
|
||||
$s = get_category_by_slug('series');
|
||||
$seriesIDs = get_term_children($s->term_id, 'category');
|
||||
if ( has_category( 'series' ) ) {
|
||||
$catag = 'is a part of the following series';
|
||||
$series = array();
|
||||
$s = get_category_by_slug( 'series' );
|
||||
$seriesIDs = get_term_children( $s->term_id, 'category' );
|
||||
|
||||
foreach ($seriesIDs as $thisSeriesID) {
|
||||
if (has_category($thisSeriesID)) {
|
||||
array_push($series, get_category($thisSeriesID));
|
||||
}
|
||||
}
|
||||
if (count($series) > 1) $catag .= "’";
|
||||
$punct = ":";
|
||||
foreach ($series as $thisSeries) {
|
||||
$catag .= $punct.' ';
|
||||
if ($punct == ":") $punct = ";";
|
||||
$catag .= '<a href="/category/series/'.$thisSeries->slug.'">'.$thisSeries->name.'</a>';
|
||||
}
|
||||
$catag .= '.';
|
||||
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 .= '<a href="/category/series/' . $thisSeries->slug . '">' . $thisSeries->name . '</a>';
|
||||
}
|
||||
$catag .= '.';
|
||||
|
||||
echo "<li>This <a href='/category/{$type}s'>{$type}</a> {$catag}</li>";
|
||||
}
|
||||
?>
|
||||
echo "<li>This <a href='/category/{$type}s'>{$type}</a> {$catag}</li>";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($date1 < $date2 - 31557600): ?>
|
||||
<li>This piece was written over a year ago. It may no longer accurately reflect my views now, or may be factually outdated.</li>
|
||||
<?php if ( $date1 < $date2 - 31557600 ) : ?>
|
||||
<li>This piece was written over a year ago. It may no longer accurately reflect my views now, or may be factually outdated.</li>
|
||||
<?php endif; ?>
|
||||
<?php if (has_tag('ohwhatohjeez')): ?>
|
||||
<li>This piece was originally written for my old site, Oh What? Oh Jeez! As such, it may not have transferred over properly and some images and links might be broken (and, to a lesser extent, my writing from years ago is about 80% run-on sentences).</li>
|
||||
<?php endif; ?>
|
||||
<?php if ($notes = get_post_meta(get_the_ID(), 'Note(s)', true)): ?>
|
||||
<li><?php echo $notes ?></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($license = get_post_meta(get_the_ID(), 'License', true)): ?>
|
||||
<li>This work is licensed under <?php echo $license ?>. <a href="/2018/03/copywrong/">Sorry about that</a>.</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if ( has_tag( 'ohwhatohjeez' ) ) : ?>
|
||||
<li>This piece was originally written for my old site, Oh What? Oh Jeez! As such, it may not have transferred over properly and some images and links might be broken (and, to a lesser extent, my writing from years ago is about 80% run-on sentences).</li>
|
||||
<?php endif; ?>
|
||||
<?php if ( $notes = get_post_meta( get_the_ID(), 'Note(s)', true ) ) : ?>
|
||||
<li><?php echo $notes; ?></li>
|
||||
<?php endif; ?>
|
||||
<?php if ( $license = get_post_meta( get_the_ID(), 'License', true ) ) : ?>
|
||||
<li>This work is licensed under <?php echo $license; ?>. <a href="/2018/03/copywrong/">Sorry about that</a>.</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if (get_the_content()):
|
||||
the_content();
|
||||
else:
|
||||
echo get_the_excerpt();
|
||||
endif;
|
||||
?>
|
||||
if ( get_the_content() ) :
|
||||
the_content();
|
||||
else :
|
||||
echo get_the_excerpt();
|
||||
endif;
|
||||
?>
|
||||
</main><!-- .entry-content -->
|
||||
|
||||
<footer id="post-meta">
|
||||
<h1>Post Meta</h1>
|
||||
<?php if ($content = get_post_meta(get_the_ID(), 'ToC1', true)): ?>
|
||||
<section id="post-contents">
|
||||
<h2>Contents</h2>
|
||||
<ol>
|
||||
<?php $i = 1; ?>
|
||||
<?php while($content = get_post_meta(get_the_ID(), 'ToC'.$i, true)): ?>
|
||||
<li><a href="#section-<?php echo $i++ ?>"><?php echo $content ?></a></li>
|
||||
<?php endwhile; ?>
|
||||
</ol>
|
||||
</section>
|
||||
<h1>Post Meta</h1>
|
||||
<?php if ( $content = get_post_meta( get_the_ID(), 'ToC1', true ) ) : ?>
|
||||
<section id="post-contents">
|
||||
<h2>Contents</h2>
|
||||
<ol>
|
||||
<?php $i = 1; ?>
|
||||
<?php while ( $content = get_post_meta( get_the_ID(), 'ToC' . $i, true ) ) : ?>
|
||||
<li><a href="#section-<?php echo $i++; ?>"><?php echo $content; ?></a></li>
|
||||
<?php endwhile; ?>
|
||||
</ol>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php if ($tags = get_the_tags(get_the_ID())): ?>
|
||||
<section id="post-tags">
|
||||
<h2>Tags</h2>
|
||||
<?php foreach ($tags as $tag): ?>
|
||||
<a href="<?php echo get_tag_link($tag->term_id) ?>" title="<?php echo $tag->name ?> Tag" class="tag-link">
|
||||
<?php echo $tag->name ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
<?php if ( $tags = get_the_tags( get_the_ID() ) ) : ?>
|
||||
<section id="post-tags">
|
||||
<h2>Tags</h2>
|
||||
<?php foreach ( $tags as $tag ) : ?>
|
||||
<a href="<?php echo get_tag_link( $tag->term_id ); ?>" title="<?php echo $tag->name; ?> Tag" class="tag-link">
|
||||
<?php echo $tag->name; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</footer>
|
||||
</article><!-- #post-## -->
|
||||
|
|
|
@ -1,25 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* The template part for displaying content.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
* The template part for displaying content.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Omphaloskepsis
|
||||
* @since Omphaloskepsis 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<a class="item" href="<?php echo ($link = get_post_meta(get_the_ID(), 'External_Link', true)) ? $link : get_the_permalink(); ?>" <?php echo ($link) ? 'target="_blank"' : ''; ?>>
|
||||
<a class="item" href="<?php echo ( $link = get_post_meta( get_the_ID(), 'External_Link', true ) ) ? $link : get_the_permalink(); ?>" <?php echo ( $link ) ? 'target="_blank"' : ''; ?>>
|
||||
<article id="post-<?php the_ID(); ?>" class="tile col-m-6 col-4 col-w-3" style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
|
||||
<?php
|
||||
if (strlen(get_the_title()) > 70) $small= "vsmall";
|
||||
elseif (strlen(get_the_title()) > 35) $small = "small";
|
||||
elseif (strlen(get_the_title()) > 12) $small = "qsmall";
|
||||
?>
|
||||
<header>
|
||||
<h1 class="<?php echo $small ?> post-title"><?php echo get_the_title(); ?></h1>
|
||||
<?php if ($subtitle = get_post_meta(get_the_ID(), 'Subtitle', true)): ?>
|
||||
<h2><?php echo $subtitle ?></h2>
|
||||
<?php endif; ?>
|
||||
</header>
|
||||
if ( strlen( get_the_title() ) > 70 ) {
|
||||
$small = 'vsmall';
|
||||
} elseif ( strlen( get_the_title() ) > 35 ) {
|
||||
$small = 'small';
|
||||
} elseif ( strlen( get_the_title() ) > 12 ) {
|
||||
$small = 'qsmall';
|
||||
}
|
||||
?>
|
||||
<header>
|
||||
<h1 class="<?php echo $small; ?> post-title"><?php echo get_the_title(); ?></h1>
|
||||
<?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?>
|
||||
<h2><?php echo $subtitle; ?></h2>
|
||||
<?php endif; ?>
|
||||
</header>
|
||||
</article><!-- #post-## -->
|
||||
</a>
|
|
@ -1,51 +1,54 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying all single posts and attachments
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Sixteen
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
get_header();
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying all single posts and attachments
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Sixteen
|
||||
* @since Twenty Sixteen 1.0
|
||||
*/
|
||||
get_header();
|
||||
?>
|
||||
<?php
|
||||
function withinDates($jSDate, $jEDate)
|
||||
{
|
||||
$endYear = date("Y");
|
||||
$endDate = $endYear . "-12-31";
|
||||
$startDate = ($endYear - 2) . "-01-01";
|
||||
$jEDate = (!$jEDate) ? date('Y-m-d') : (($jEDate > $endDate) ? $endDate : $jEDate);
|
||||
return (((strtotime($jSDate) < strtotime($endDate)) && (strtotime($jSDate) > strtotime($startDate))) && (strtotime($jEDate) > strtotime($startDate)));
|
||||
}
|
||||
$args = array(
|
||||
'post_type' => array(
|
||||
'job'
|
||||
),
|
||||
'posts_per_page' => -1
|
||||
);
|
||||
$loop = new WP_Query($args);
|
||||
?>
|
||||
function withinDates( $jSDate, $jEDate ) {
|
||||
$endYear = date( 'Y' );
|
||||
$endDate = $endYear . '-12-31';
|
||||
$startDate = ( $endYear - 2 ) . '-01-01';
|
||||
$jEDate = ( ! $jEDate ) ? date( 'Y-m-d' ) : ( ( $jEDate > $endDate ) ? $endDate : $jEDate );
|
||||
return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) );
|
||||
}
|
||||
$args = array(
|
||||
'post_type' => array(
|
||||
'job',
|
||||
),
|
||||
'posts_per_page' => -1,
|
||||
);
|
||||
$loop = new WP_Query( $args );
|
||||
?>
|
||||
|
||||
<header class="post-header-title">
|
||||
<h1 id="page-title">Experience</h1>
|
||||
<h2 id="page-subtitle">or, a brief history of Ben</h2>
|
||||
<?php while (have_posts()): the_post(); ?>
|
||||
<div class="entry-content tile" id="taxonomy-description">
|
||||
<h1 id="page-title">Experience</h1>
|
||||
<h2 id="page-subtitle">or, a brief history of Ben</h2>
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
?>
|
||||
<div class="entry-content tile" id="taxonomy-description">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
</header>
|
||||
<div id="primary" class="content-area">
|
||||
<main id="company-main" class="site-main" role="main">
|
||||
<main id="company-main" class="site-main" role="main">
|
||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery(document).ready(function($) {
|
||||
$('#timeline').height($(window).height() - $('.post-header-title').height() - 50);
|
||||
});
|
||||
});
|
||||
|
||||
google.charts.load('current', {'packages':['timeline']});
|
||||
google.charts.setOnLoadCallback(drawChart);
|
||||
google.charts.load('current', {'packages':['timeline']});
|
||||
google.charts.setOnLoadCallback(drawChart);
|
||||
|
||||
function drawChart() {
|
||||
function drawChart() {
|
||||
var container = document.getElementById('timeline');
|
||||
var chart = new google.visualization.Timeline(container);
|
||||
var dataTable = new google.visualization.DataTable();
|
||||
|
@ -57,41 +60,46 @@
|
|||
dataTable.addColumn({ type: 'date', id: 'End' });
|
||||
dataTable.addRows([
|
||||
<?php
|
||||
while ($loop->have_posts()): $loop->the_post();
|
||||
?>
|
||||
<?php
|
||||
$isCurrent = (get_post_meta(get_the_ID(), 'end-date', true)) ? false : true;
|
||||
$company = wp_get_object_terms(get_the_ID(), 'company', array(
|
||||
'fields' => 'names'
|
||||
));
|
||||
$title = html_entity_decode(get_the_title());
|
||||
while ( $loop->have_posts() ) :
|
||||
$loop->the_post();
|
||||
?>
|
||||
<?php
|
||||
$isCurrent = ( get_post_meta( get_the_ID(), 'end-date', true ) ) ? false : true;
|
||||
$company = wp_get_object_terms(
|
||||
get_the_ID(),
|
||||
'company',
|
||||
array(
|
||||
'fields' => 'names',
|
||||
)
|
||||
);
|
||||
$title = html_entity_decode( get_the_title() );
|
||||
$start = get_the_date();
|
||||
$end = (!get_post_meta(get_the_ID(), 'end-date', true)) ? date('D M d Y H:i:s O') : get_post_meta(get_the_ID(), 'end-date', true);
|
||||
?>
|
||||
[
|
||||
'<?php echo ($isCurrent) ? "Current" : "Current"; ?>',
|
||||
'<?php echo $title . ', ' . html_entity_decode($company[0]); ?>',
|
||||
'<div style="padding: 20px"><h1><?php echo $title; ?></h1><h2><?php echo html_entity_decode($company[0]); ?></h2><ul><li><?php echo $start; ?>—<?php echo ($isCurrent) ? "present" : $end; ?></li></ul></div>',
|
||||
$end = ( ! get_post_meta( get_the_ID(), 'end-date', true ) ) ? date( 'D M d Y H:i:s O' ) : get_post_meta( get_the_ID(), 'end-date', true );
|
||||
?>
|
||||
[
|
||||
'<?php echo ( $isCurrent ) ? 'Current' : 'Current'; ?>',
|
||||
'<?php echo $title . ', ' . html_entity_decode( $company[0] ); ?>',
|
||||
'<div style="padding: 20px"><h1><?php echo $title; ?></h1><h2><?php echo html_entity_decode( $company[0] ); ?></h2><ul><li><?php echo $start; ?>—<?php echo ( $isCurrent ) ? 'present' : $end; ?></li></ul></div>',
|
||||
new Date('<?php echo $start; ?>'),
|
||||
new Date('<?php echo $end; ?>')
|
||||
],
|
||||
],
|
||||
<?php endwhile; ?>
|
||||
]);
|
||||
|
||||
var options = {
|
||||
tooltip: {isHtml: true},
|
||||
timeline: {
|
||||
tooltip: {isHtml: true},
|
||||
timeline: {
|
||||
showRowLabels: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
chart.draw(dataTable, options);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="slider-range"></div>
|
||||
<div id="timeline"></div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
<?php //get_sidebar(); ?>
|
||||
<?php // get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
|
|
Reference in a new issue