This repository has been archived on 2022-08-01. You can view files and clone it, but cannot push or open issues or pull requests.
Oldphaloskepsis/page-experience-by-companies.php
2017-01-12 23:10:07 +00:00

65 lines
2.6 KiB
PHP

<?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)));
}
$loop = new WP_Query( $args );
?>
<div class="post-header-title"><h2>Experience</h2><h5 style="text-align: center;">by company</h5></div>
<?php
$terms = apply_filters("taxonomy-images-get-terms", "", array('having_images' => false, 'taxonomy' => 'company', 'term_args' => array('parent' => 0)));
if ( ! empty( $terms ) ) {
echo "<div class=\"row\" id=\"companies-grid\">";
echo "<ul>";
foreach ( (array) $terms as $term ) {
$imgURL = wp_get_attachment_image_src($term->image_id, 'detail')[0];
$colour = get_term_meta($term->term_id, 'color', true);
$colour = ($colour != "") ? $colour : "var(--light)";
if (!$imgURL) {
echo "<a href=\"".esc_url(get_term_link($term, $term->taxonomy ))."\"><li class=\"col-2 col-m-4\" style=\"background-color: ".$colour.";\"><h5>".$term->name."</h5></li></a>";
} else {
echo "<a href=\"".esc_url(get_term_link($term, $term->taxonomy ))."\"><li class=\"col-2 col-m-4\" style=\"background-image: url(".strtok($imgURL, '?')."); background-color: ".$colour.";\"></li></a>";
}
}
echo "</ul>";
echo "</div>";
}
?>
<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>
$(function() {
$( "#slider-range" ).slider({
range: true,
min: 2008,
max: 2016,
values: [ 2014, 2016 ],
slide: function( event, ui ) {
drawChart();
}
});
$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
" - $" + $( "#slider-range" ).slider( "values", 1 ) );
});
</script>
<div id="slider-range"></div>
<?php //get_sidebar(); ?>
<?php get_footer(); ?>