Commit 1710f208 authored by Simon's avatar Simon

position SEO schema, nginx stapling removed

parent f5bb8fcb
...@@ -169,7 +169,7 @@ http { ...@@ -169,7 +169,7 @@ http {
# server{} configuration files should be placed in the conf.d folder. # server{} configuration files should be placed in the conf.d folder.
# The configurations should be disabled by prefixing files with a dot. # 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/policy_modern.conf;
include h5bp/ssl/ssl_engine.conf; include h5bp/ssl/ssl_engine.conf;
......
...@@ -319,6 +319,15 @@ function biuro_widger_areas() { ...@@ -319,6 +319,15 @@ function biuro_widger_areas() {
'after_title' => '', '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( register_sidebar( array(
'name' => 'Recommend page: Content area', 'name' => 'Recommend page: Content area',
'id' => 'recommend_page_content_area', 'id' => 'recommend_page_content_area',
...@@ -974,24 +983,3 @@ function getDivisions($ID) { ...@@ -974,24 +983,3 @@ function getDivisions($ID) {
return $wpdb->get_results($sql, ARRAY_A); 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 <?php
/** /**
* Template Name: Search & Jobs page * Template Name: Search & Jobs page
* *
* This is the most generic template file in a WordPress theme * 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). * 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. * 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. * E.g., it puts together the home page when no home.php file exists.
* *
* @link https://codex.wordpress.org/Template_Hierarchy * @link https://codex.wordpress.org/Template_Hierarchy
* *
* @package WordPress * @package WordPress
* @subpackage Biuro * @subpackage Biuro
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
get_header(); ?> get_header(); ?>
<div class="l-section l-section--search-page "> <div class="l-section l-section--search-page ">
<div class="l-section--inner"> <div class="l-section--inner">
<?php <?php
get_search_form(); get_search_form();
?> ?>
</div> </div>
</div> </div>
<div class="c-search--filters"> <div class="c-search--filters">
<button class="js-toggle--aside-city o-btn c-btn--filter"> <button class="js-toggle--aside-city o-btn c-btn--filter">
<svg width="16px" height="19px" class="c-ico--city"> <svg width="16px" height="19px" class="c-ico--city">
<use xlink:href="#ico--city"></use> <use xlink:href="#ico--city"></use>
</svg> <?php _e('City', 'biuro'); ?> </svg> <?php _e('City', 'biuro'); ?>
</button> </button>
<button class="js-toggle--aside--additional o-btn c-btn--filter"> <button class="js-toggle--aside--additional o-btn c-btn--filter">
<svg width="17px" height="17px" class="c-ico--filter"> <svg width="17px" height="17px" class="c-ico--filter">
<use xlink:href="#ico--filter"></use> <use xlink:href="#ico--filter"></use>
</svg> <?php _e('Other filters', 'biuro'); ?> </svg> <?php _e('Other filters', 'biuro'); ?>
</button> </button>
</div> </div>
<div id="content" class="l-main"> <div id="content" class="l-main">
<div class="l-content l-content--heading"> <div class="l-content l-content--heading">
<?php <?php
if ( is_search() ): if ( is_search() ):
?> ?>
<h1><?php _e('Job offers', 'biuro'); ?>:</h1> <h1><?php _e('Job offers', 'biuro'); ?>:</h1>
<?php <?php
else: else:
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
the_content(); the_content();
endwhile; endwhile;
endif; endif;
?> ?>
</div> </div>
<div class="l-content"> <div class="l-content">
<aside class="l-aside l-aside--search"> <aside class="l-aside l-aside--search">
<?php <?php
get_template_part( 'template-parts/layout/aside', 'job-list' ); get_template_part( 'template-parts/layout/aside', 'job-list' );
?> ?>
<span class="js-toggle--aside l-aside--close"> <span class="js-toggle--aside l-aside--close">
<svg width="13px" height="13px"> <svg width="13px" height="13px">
<use xlink:href="#ico--close"></use> <use xlink:href="#ico--close"></use>
</svg> </svg>
</span> </span>
</aside><!-- .l-aside --> </aside><!-- .l-aside -->
<main id="main" class="l-main">
<main id="main" class="l-main"> <?php
global $query_string;
<?php
global $query_string; $keys = get_post_custom_keys();
$keys = get_post_custom_keys(); $where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"';
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"'; if ( is_search() ):
if ( is_search() ): wp_parse_str( $query_string, $searchQuery );
wp_parse_str( $query_string, $searchQuery ); if ( $searchQuery ) :
if ( $searchQuery ) : if ( $searchQuery['city'] ) :
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' );
if ( $searchQuery['city'] ) :
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' ); if ( $city ) :
$where = $where . ' AND city.term_id = ' . $city->term_id;
if ( $city ) : endif;
$where = $where . ' AND city.term_id = ' . $city->term_id; endif;
endif;
endif; if ( $searchQuery['s'] ) :
if ( $searchQuery['s'] ) : $field = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'field' );
$type = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'type' );
$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;
if ( $field ) : elseif ( $type ) :
$where = $where . ' AND field.term_id = ' . $field->term_id; $where = $where . ' AND type.term_id = ' . $type->term_id;
elseif ( $type ) : else:
$where = $where . ' AND type.term_id = ' . $type->term_id; $where = $where . ' AND (t.post_title LIKE "%' . $searchQuery['s'] . '%" OR t.post_content LIKE "%' . $searchQuery['s'] . '%")';
else: endif;
$where = $where . ' AND (t.post_title LIKE "%' . $searchQuery['s'] . '%" OR t.post_content LIKE "%' . $searchQuery['s'] . '%")';
endif; endif;
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 . '%")';
// $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 ) :
elseif ($keys): $val = trim($value);
foreach ( $keys as $key => $value ) : $taxonomy = substr($val, 20);
$val = trim($value);
$taxonomy = substr($val, 20); if ( '_' == $val{0} || substr($val, 0, 20) != 'built_in_taxonomies_' || !$taxonomy):
continue;
if ( '_' == $val{0} || substr($val, 0, 20) != 'built_in_taxonomies_' || !$taxonomy): endif;
continue;
endif; $res = get_post_custom_values( $val );
$res = get_post_custom_values( $val ); if ( !$res ) :
continue;
if ( !$res ) : endif;
continue;
endif; $term = $res[0];
$term = $res[0]; if ( !$term ) :
continue;
if ( !$term ) : endif;
continue;
endif; $where = $where . ' AND ' . $taxonomy . '.slug = "' . $term . '"';
endforeach;
$where = $where . ' AND ' . $taxonomy . '.slug = "' . $term . '"'; endif;
endforeach;
endif; // WP Pods fix for multisite
global $wpdb;
// WP Pods fix for multisite
global $wpdb; $params = array(
'orderby' => 'date DESC',
$params = array( 'where' => $where,
'orderby' => 'date DESC', 'limit' => 20
'where' => $where, );
'limit' => 20
); if (get_current_blog_id() != 1):
$langs = pll_the_languages(array('raw'=>1));
if (get_current_blog_id() != 1): $langID = $langs[pll_current_language('slug')]['id'];
$langs = pll_the_languages(array('raw'=>1)); $where = $where . ' AND ( `langs`.`object_id` IS NOT NULL )';
$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;
$params['join'] = ' LEFT JOIN `' . $wpdb->prefix . 'term_relationships` AS `langs` ON `langs`.`object_id` = `t`.`ID` AND `langs`.`term_taxonomy_id` = ' . $langID; endif;
$params['where'] = $where; // END WP Pods fix for multisite
endif;
// END WP Pods fix for multisite $jobs = pods( 'job', $params );
$jobs = pods( 'job', $params ); if ( 0 < $jobs->total() ):
if ( 0 < $jobs->total() ): get_template_part( 'template-parts/jobs/jobs', 'list' );
get_template_part( 'template-parts/jobs/jobs', 'list' ); else:
else: get_template_part( 'template-parts/jobs/jobs', 'not-found' );
get_template_part( 'template-parts/jobs/jobs', 'not-found' ); endif;
?>
endif;
?> </main><!-- .l-main -->
</div><!-- .l-content -->
</main><!-- .l-main -->
</div><!-- .l-content --> </div><!-- #content -->
</div><!-- #content --> <?php get_footer();
<?php get_footer();
...@@ -109,13 +109,17 @@ get_header(); ...@@ -109,13 +109,17 @@ get_header();
$occupationalCategories = get_the_terms( $ID, 'field' ); $occupationalCategories = get_the_terms( $ID, 'field' );
foreach ($occupationalCategories as &$occupationalCategory) : foreach ($occupationalCategories as &$occupationalCategory) :
echo '<meta itemprop="occupationalCategory" content="' . $occupationalCategory->name . '" />'; ?>
<meta itemprop="occupationalCategory" content="<?php echo $occupationalCategory->name ; ?>" />
<?php
endforeach; endforeach;
$employmentTypes = get_the_terms( $ID, 'type' ); $employmentTypes = get_the_terms( $ID, 'type' );
foreach ($employmentTypes as &$employmentType) : foreach ($employmentTypes as &$employmentType) :
echo '<meta itemprop="employmentType" content="' . $employmentType->name . '" />'; ?>
<meta itemprop="employmentType" content="<?php echo $employmentType->name; ?>" />
<?php
endforeach; endforeach;
?> ?>
<ul class="c-categories"> <ul class="c-categories">
...@@ -228,49 +232,14 @@ get_header(); ...@@ -228,49 +232,14 @@ get_header();
endif; endif;
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; $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> <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> </div>
<?php <?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