Commit 1710f208 authored by Simon's avatar Simon

position SEO schema, nginx stapling removed

parent f5bb8fcb
......@@ -169,7 +169,7 @@ http {
# server{} configuration files should be placed in the conf.d folder.
# The configurations should be disabled by prefixing files with a dot.
include h5bp/ssl/ocsp_stapling.conf;
# include h5bp/ssl/ocsp_stapling.conf;
include h5bp/ssl/policy_modern.conf;
include h5bp/ssl/ssl_engine.conf;
......
......@@ -319,6 +319,15 @@ function biuro_widger_areas() {
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Jobs: Hiring organization (schema.org)',
'id' => 'hiring_organization',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Recommend page: Content area',
'id' => 'recommend_page_content_area',
......@@ -974,24 +983,3 @@ function getDivisions($ID) {
return $wpdb->get_results($sql, ARRAY_A);
}
// function getCities() {
// global $wpdb;
// $langs = pll_the_languages(array('raw'=>1));
// $langID = $langs[pll_current_language('slug')]['id'];
// $prefix = $wpdb->prefix;
// $cities = get_terms( array(
// 'taxonomy' => 'city',
// 'hide_empty' => false,
// ) );
// delog($wpdb->last_query);
// delog('$cities');
// debug($cities);
// return [];
// }
<?php
/**
* Template Name: Search & Jobs page
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
get_header(); ?>
<div class="l-section l-section--search-page ">
<div class="l-section--inner">
<?php
get_search_form();
?>
</div>
</div>
<div class="c-search--filters">
<button class="js-toggle--aside-city o-btn c-btn--filter">
<svg width="16px" height="19px" class="c-ico--city">
<use xlink:href="#ico--city"></use>
</svg> <?php _e('City', 'biuro'); ?>
</button>
<button class="js-toggle--aside--additional o-btn c-btn--filter">
<svg width="17px" height="17px" class="c-ico--filter">
<use xlink:href="#ico--filter"></use>
</svg> <?php _e('Other filters', 'biuro'); ?>
</button>
</div>
<div id="content" class="l-main">
<div class="l-content l-content--heading">
<?php
if ( is_search() ):
?>
<h1><?php _e('Job offers', 'biuro'); ?>:</h1>
<?php
else:
while ( have_posts() ) :
the_post();
the_content();
endwhile;
endif;
?>
</div>
<div class="l-content">
<aside class="l-aside l-aside--search">
<?php
get_template_part( 'template-parts/layout/aside', 'job-list' );
?>
<span class="js-toggle--aside l-aside--close">
<svg width="13px" height="13px">
<use xlink:href="#ico--close"></use>
</svg>
</span>
</aside><!-- .l-aside -->
<main id="main" class="l-main">
<?php
global $query_string;
$keys = get_post_custom_keys();
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"';
if ( is_search() ):
wp_parse_str( $query_string, $searchQuery );
if ( $searchQuery ) :
if ( $searchQuery['city'] ) :
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' );
if ( $city ) :
$where = $where . ' AND city.term_id = ' . $city->term_id;
endif;
endif;
if ( $searchQuery['s'] ) :
$field = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'field' );
$type = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'type' );
if ( $field ) :
$where = $where . ' AND field.term_id = ' . $field->term_id;
elseif ( $type ) :
$where = $where . ' AND type.term_id = ' . $type->term_id;
else:
$where = $where . ' AND (t.post_title LIKE "%' . $searchQuery['s'] . '%" OR t.post_content LIKE "%' . $searchQuery['s'] . '%")';
endif;
endif;
endif;
// $where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND (t.post_title LIKE "%' . $searchQuery . '%" OR t.post_content LIKE "%' . $searchQuery . '%")';
elseif ($keys):
foreach ( $keys as $key => $value ) :
$val = trim($value);
$taxonomy = substr($val, 20);
if ( '_' == $val{0} || substr($val, 0, 20) != 'built_in_taxonomies_' || !$taxonomy):
continue;
endif;
$res = get_post_custom_values( $val );
if ( !$res ) :
continue;
endif;
$term = $res[0];
if ( !$term ) :
continue;
endif;
$where = $where . ' AND ' . $taxonomy . '.slug = "' . $term . '"';
endforeach;
endif;
// WP Pods fix for multisite
global $wpdb;
$params = array(
'orderby' => 'date DESC',
'where' => $where,
'limit' => 20
);
if (get_current_blog_id() != 1):
$langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id'];
$where = $where . ' AND ( `langs`.`object_id` IS NOT NULL )';
$params['join'] = ' LEFT JOIN `' . $wpdb->prefix . 'term_relationships` AS `langs` ON `langs`.`object_id` = `t`.`ID` AND `langs`.`term_taxonomy_id` = ' . $langID;
$params['where'] = $where;
endif;
// END WP Pods fix for multisite
$jobs = pods( 'job', $params );
if ( 0 < $jobs->total() ):
get_template_part( 'template-parts/jobs/jobs', 'list' );
else:
get_template_part( 'template-parts/jobs/jobs', 'not-found' );
endif;
?>
</main><!-- .l-main -->
</div><!-- .l-content -->
</div><!-- #content -->
<?php get_footer();
<?php
/**
* Template Name: Search & Jobs page
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
get_header(); ?>
<div class="l-section l-section--search-page ">
<div class="l-section--inner">
<?php
get_search_form();
?>
</div>
</div>
<div class="c-search--filters">
<button class="js-toggle--aside-city o-btn c-btn--filter">
<svg width="16px" height="19px" class="c-ico--city">
<use xlink:href="#ico--city"></use>
</svg> <?php _e('City', 'biuro'); ?>
</button>
<button class="js-toggle--aside--additional o-btn c-btn--filter">
<svg width="17px" height="17px" class="c-ico--filter">
<use xlink:href="#ico--filter"></use>
</svg> <?php _e('Other filters', 'biuro'); ?>
</button>
</div>
<div id="content" class="l-main">
<div class="l-content l-content--heading">
<?php
if ( is_search() ):
?>
<h1><?php _e('Job offers', 'biuro'); ?>:</h1>
<?php
else:
while ( have_posts() ) :
the_post();
the_content();
endwhile;
endif;
?>
</div>
<div class="l-content">
<aside class="l-aside l-aside--search">
<?php
get_template_part( 'template-parts/layout/aside', 'job-list' );
?>
<span class="js-toggle--aside l-aside--close">
<svg width="13px" height="13px">
<use xlink:href="#ico--close"></use>
</svg>
</span>
</aside><!-- .l-aside -->
<main id="main" class="l-main">
<?php
global $query_string;
$keys = get_post_custom_keys();
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"';
if ( is_search() ):
wp_parse_str( $query_string, $searchQuery );
if ( $searchQuery ) :
if ( $searchQuery['city'] ) :
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' );
if ( $city ) :
$where = $where . ' AND city.term_id = ' . $city->term_id;
endif;
endif;
if ( $searchQuery['s'] ) :
$field = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'field' );
$type = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'type' );
if ( $field ) :
$where = $where . ' AND field.term_id = ' . $field->term_id;
elseif ( $type ) :
$where = $where . ' AND type.term_id = ' . $type->term_id;
else:
$where = $where . ' AND (t.post_title LIKE "%' . $searchQuery['s'] . '%" OR t.post_content LIKE "%' . $searchQuery['s'] . '%")';
endif;
endif;
endif;
// $where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND (t.post_title LIKE "%' . $searchQuery . '%" OR t.post_content LIKE "%' . $searchQuery . '%")';
elseif ($keys):
foreach ( $keys as $key => $value ) :
$val = trim($value);
$taxonomy = substr($val, 20);
if ( '_' == $val{0} || substr($val, 0, 20) != 'built_in_taxonomies_' || !$taxonomy):
continue;
endif;
$res = get_post_custom_values( $val );
if ( !$res ) :
continue;
endif;
$term = $res[0];
if ( !$term ) :
continue;
endif;
$where = $where . ' AND ' . $taxonomy . '.slug = "' . $term . '"';
endforeach;
endif;
// WP Pods fix for multisite
global $wpdb;
$params = array(
'orderby' => 'date DESC',
'where' => $where,
'limit' => 20
);
if (get_current_blog_id() != 1):
$langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id'];
$where = $where . ' AND ( `langs`.`object_id` IS NOT NULL )';
$params['join'] = ' LEFT JOIN `' . $wpdb->prefix . 'term_relationships` AS `langs` ON `langs`.`object_id` = `t`.`ID` AND `langs`.`term_taxonomy_id` = ' . $langID;
$params['where'] = $where;
endif;
// END WP Pods fix for multisite
$jobs = pods( 'job', $params );
if ( 0 < $jobs->total() ):
get_template_part( 'template-parts/jobs/jobs', 'list' );
else:
get_template_part( 'template-parts/jobs/jobs', 'not-found' );
endif;
?>
</main><!-- .l-main -->
</div><!-- .l-content -->
</div><!-- #content -->
<?php get_footer();
......@@ -109,13 +109,17 @@ get_header();
$occupationalCategories = get_the_terms( $ID, 'field' );
foreach ($occupationalCategories as &$occupationalCategory) :
echo '<meta itemprop="occupationalCategory" content="' . $occupationalCategory->name . '" />';
?>
<meta itemprop="occupationalCategory" content="<?php echo $occupationalCategory->name ; ?>" />
<?php
endforeach;
$employmentTypes = get_the_terms( $ID, 'type' );
foreach ($employmentTypes as &$employmentType) :
echo '<meta itemprop="employmentType" content="' . $employmentType->name . '" />';
?>
<meta itemprop="employmentType" content="<?php echo $employmentType->name; ?>" />
<?php
endforeach;
?>
<ul class="c-categories">
......@@ -228,49 +232,14 @@ get_header();
endif;
endif;
if ( is_active_sidebar( 'hiring_organization' ) ) :
dynamic_sidebar( 'hiring_organization' );
endif;
$validPosition = date_i18n( 'Y-m-d', strtotime( $pod->field( 'valid' ) ) ) >= date('Y-m-d') ? true : false;
?>
<b><?php _e('Valid till', 'biuro'); ?>:</b> <time itemprop="validThrough" datetime="<?php echo date_i18n( 'Y-m-d', strtotime( $pod->field( 'valid' ) ) ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $pod->field( 'valid' ) ) ); ?></time>
<?php
$organizationName = 'UAB „Biuro“';
$organizationTelephone = '+37064902392';
$organizationEmail = 'info@biuro.lt';
$organizationStreetAddress = 'Gedimino pr. 26';
$organizationPostalCode = 'LT-01104';
$organizationAddressLocality = 'Vilnius, Lietuva';
$blogID = get_current_blog_id();
if ($blogID == 2):
$organizationName = 'UAB „Biuro“';
$organizationTelephone = '+37064902392';
$organizationEmail = 'info@biuro.lt';
$organizationStreetAddress = 'Gedimino pr. 26';
$organizationPostalCode = 'LT-01104';
$organizationAddressLocality = 'Vilnius, Lietuva';
endif;
if ($blogID == 3):
$organizationName = 'UAB „Biuro“';
$organizationTelephone = '+37064902392';
$organizationEmail = 'info@biuro.lt';
$organizationStreetAddress = 'Gedimino pr. 26';
$organizationPostalCode = 'LT-01104';
$organizationAddressLocality = 'Vilnius, Lietuva';
endif;
?>
<div itemprop="hiringOrganization" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="<?php echo $organizationName; ?>" />
<meta itemprop="telephone" content="<?php echo $organizationTelephone; ?>" />
<meta itemprop="email" content="<?php echo $organizationEmail; ?>" />
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="<?php echo $organizationStreetAddress; ?>" />
<meta itemprop="postalCode" content="<?php echo $organizationPostalCode; ?>" />
<meta itemprop="addressLocality" content="<?php echo $organizationAddressLocality; ?>" />
</div>
</div>
</div>
<?php
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment