Commit f5bb8fcb authored by Simon's avatar Simon

in progress

parent 8c702379
...@@ -975,24 +975,23 @@ function getDivisions($ID) { ...@@ -975,24 +975,23 @@ function getDivisions($ID) {
return $wpdb->get_results($sql, ARRAY_A); return $wpdb->get_results($sql, ARRAY_A);
} }
function getCities() { // function getCities() {
global $wpdb; // global $wpdb;
$langs = pll_the_languages(array('raw'=>1)); // $langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id']; // $langID = $langs[pll_current_language('slug')]['id'];
$prefix = $wpdb->prefix; // $prefix = $wpdb->prefix;
$cities = get_terms( array( // $cities = get_terms( array(
'taxonomy' => 'city', // 'taxonomy' => 'city',
'hide_empty' => false, // 'hide_empty' => false,
) ); // ) );
delog($wpdb->last_query);
delog('$cities'); // delog($wpdb->last_query);
debug($cities);
return []; // delog('$cities');
// debug($cities);
} // return [];
// }
...@@ -29,7 +29,7 @@ get_header(); ...@@ -29,7 +29,7 @@ get_header();
while ( have_posts() ) : while ( have_posts() ) :
?> ?>
<meta itemprop="datePosted" content="<?php echo get_the_date(); ?>" /> <meta itemprop="datePosted" content="<?php echo get_the_date('Y-m-d'); ?>" />
<ul class="c-breadcrumbs"> <ul class="c-breadcrumbs">
<li> <li>
...@@ -61,52 +61,7 @@ get_header(); ...@@ -61,52 +61,7 @@ get_header();
</li> </li>
</ul> </ul>
<?php
/*
<meta itemprop="title" content="Santechnikos darbų vadovas (-ė) (Vilniuje arba Klaipėdoje) - UAB „Soprana Personnel International“ | cv.lt" />
<meta itemprop="hiringOrganization" content="UAB „Soprana Personnel International“" />
<meta itemprop="jobLocation" content="Vilnius" />
<meta itemprop="description" content="Įmonė: UAB „Soprana Personnel International“, skelbimas galioja iki 2019-12-21" />
<meta itemprop="employmentType" content="FULL_TIME" />
<meta itemprop="url" content="https://www.cv.lt/statybos-darbai/santechnikos-darbu-vadovas-e-vilniuje-arba-klaipedoje-1-344562534?ref=share" />
<div itemprop="validThrough" content="2019-11-18 06:45:50">validThrough: <?php echo $pod->field( 'valid' ); ?> 23:59:59</div>
new DateTime($published))->format("%a")
if (!is_array($pod->field( 'salary_from' )) && $pod->field( 'salary_from' ) > 0 || !is_array($pod->field( 'salary_to' )) && $pod->field( 'salary_to' ) > 0):
if ($pod->field( 'salary_from' ) > 0 || $pod->field( 'salary_to' ) > 0):
?>
<b><?php _e('Salary', 'biuro'); ?>:</b>
<?php
if ($pod->field( 'salary_from' ) > 0):
echo __('from', 'biuro') . ' ' .$pod->field( 'salary_from' );
endif;
?>
<?php
if ($pod->field( 'salary_to' ) > 0):
echo __('to', 'biuro') . ' ' . $pod->field( 'salary_to' );
endif;
?>
<?php _e('(neto)', 'biuro'); ?>
<br>
<?php
endif;
endif;
$validPosition = date_i18n( 'Y-m-d', strtotime( $pod->field( 'valid' ) ) ) >= date('Y-m-d') ? true : false;
?>
<b><?php _e('Valid till', 'biuro'); ?>:</b> <?php echo date_i18n( get_option( 'date_format' ), strtotime( $pod->field( 'valid' ) ) ); ?>
</div>
*/
?>
<h1 class="c-job--title" itemprop="title"><?php the_title(); ?></h1> <h1 class="c-job--title" itemprop="title"><?php the_title(); ?></h1>
<?php <?php
function getCategory($ID, $str) { function getCategory($ID, $str) {
...@@ -138,8 +93,31 @@ get_header(); ...@@ -138,8 +93,31 @@ get_header();
return $res; return $res;
} }
$jobLocations = get_the_terms( $ID, 'city' );
foreach ($jobLocations as &$jobLocation) :
?> ?>
<div itemprop="jobLocation" itemscope itemtype="http://schema.org/Place">
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="addressLocality" content="<?php echo $jobLocation->name; ?>" />
</div>
</div>
<?php
endforeach;
$occupationalCategories = get_the_terms( $ID, 'field' );
foreach ($occupationalCategories as &$occupationalCategory) :
echo '<meta itemprop="occupationalCategory" content="' . $occupationalCategory->name . '" />';
endforeach;
$employmentTypes = get_the_terms( $ID, 'type' );
foreach ($employmentTypes as &$employmentType) :
echo '<meta itemprop="employmentType" content="' . $employmentType->name . '" />';
endforeach;
?>
<ul class="c-categories"> <ul class="c-categories">
<?php <?php
$city = getCategory($ID, 'city'); $city = getCategory($ID, 'city');
...@@ -147,7 +125,7 @@ get_header(); ...@@ -147,7 +125,7 @@ get_header();
if ($city['name'] != ''): if ($city['name'] != ''):
?> ?>
<li> <li>
<a href="<?php echo $city['pageURL']; ?>" ><?php echo $city['name']; ?></a> <a href="<?php echo $city['pageURL']; ?>"><?php echo $city['name']; ?></a>
</li> </li>
<?php <?php
endif; endif;
...@@ -253,6 +231,46 @@ get_header(); ...@@ -253,6 +231,46 @@ get_header();
$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