Commit 7a2bd64d authored by Simon's avatar Simon

Optimization and accessibillity

parent 108898ca
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<?php <?php
endif; endif;
?> ?>
<script src="/wp-content/themes/biuro/js/main.min.js" async></script> <script src="/wp-content/themes/biuro/js/main-5fe88314.min.js" async></script>
<?php <?php
// global $time_start; // global $time_start;
......
<?php <?php
global $time_start;
$time_start = microtime(true);
function debug($arr) { function debug($arr) {
echo '<pre>'; echo '<pre>';
...@@ -17,6 +19,53 @@ function cc_mime_types($mimes) { ...@@ -17,6 +19,53 @@ function cc_mime_types($mimes) {
add_filter('upload_mimes', 'cc_mime_types'); add_filter('upload_mimes', 'cc_mime_types');
// 0.9 1.6 2.8 x2
// 0.9 1.6 1.2 x1
// 0.9 1.7 1.0 x1
// 0.9 1.6 1.0 x1
// 0.9 1.5 1.0 x3
remove_action('wp_head', 'feed_links_extra', 3); // removes links to rss categories
remove_action('wp_head', 'feed_links', 2); // minus links to the main rss and comments
remove_action('wp_head', 'rsd_link'); // Really Simple Discovery service
remove_action('wp_head', 'wlwmanifest_link'); // Windows Live Writer
remove_action('wp_head', 'wp_generator'); // hide the wordpress version
remove_action('wp_head','start_post_rel_link',10,0);
remove_action('wp_head','index_rel_link');
remove_action('wp_head','adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action('wp_head','wp_shortlink_wp_head', 10, 0 );
remove_action( 'wp_head', 'rest_output_link_wp_head');
remove_action( 'wp_head', 'wp_oembed_add_discovery_links');
// remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 );
// remove_action('wp_head', 'rsd_link') ;
// remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
function disable_embed(){
wp_dequeue_script( 'wp-embed' );
}
add_action( 'wp_footer', 'disable_embed' );
add_filter('xmlrpc_enabled', '__return_false');
// remove_action( 'wp_head', 'wp_generator' ) ;
// remove_action('wp_head', 'start_post_rel_link');
// remove_action('wp_head', 'index_rel_link');
// remove_action('wp_head', 'adjacent_posts_rel_link');
// remove_action( 'wp_head', 'wlwmanifest_link' ) ;
function disable_pingback( &$links ) {
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, get_option( 'home' ) ) )
unset($links[$l]);
}
add_action( 'pre_ping', 'disable_pingback' );
function wpdocs_dequeue_dashicon() {
if (current_user_can( 'update_core' )) {
return;
}
wp_deregister_style('dashicons');
}
add_action( 'wp_enqueue_scripts', 'wpdocs_dequeue_dashicon' );
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/* Enable more buttons in admin /* Enable more buttons in admin
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
...@@ -429,47 +478,47 @@ add_action('init', 'df_disable_comments_admin_bar'); ...@@ -429,47 +478,47 @@ add_action('init', 'df_disable_comments_admin_bar');
// require_once 'includes/disable_discussion'; // require_once 'includes/disable_discussion';
function getContacts ( $request ) { // function getContacts ( $request ) {
$res = array(); // $res = array();
array_push($res, array( // array_push($res, array(
'id' => 1, // 'id' => 1,
'date' => '2019-03-15 19:05:44', // 'date' => '2019-03-15 19:05:44',
'name' => 'Vardenis', // 'name' => 'Vardenis',
'surname' => 'Pavardenis', // 'surname' => 'Pavardenis',
'phone' => '+37060000000', // 'phone' => '+37060000000',
'email' => 'email@example.com', // 'email' => 'email@example.com',
'city' => '', // 'city' => '',
'comment' => '', // 'comment' => '',
'cv' => '' // 'cv' => ''
) ); // ) );
array_push($res, array( // array_push($res, array(
'id' => 2, // 'id' => 2,
'date' => '2019-04-01 08:08:17', // 'date' => '2019-04-01 08:08:17',
'name' => 'Jonas', // 'name' => 'Jonas',
'surname' => 'Jonaitis Kazlauskaitis', // 'surname' => 'Jonaitis Kazlauskaitis',
'phone' => '', // 'phone' => '',
'email' => 'jonas@example.com', // 'email' => 'jonas@example.com',
'city' => 'Vilnius', // 'city' => 'Vilnius',
'comment' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est ducimus iusto modi a, iure. Provident.', // 'comment' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est ducimus iusto modi a, iure. Provident.',
'cv' => '/path/to/000000000000000.pdf' // 'cv' => '/path/to/000000000000000.pdf'
) ); // ) );
array_push($res, array( // array_push($res, array(
'id' => 3, // 'id' => 3,
'date' => '2019-04-10 07:43:02', // 'date' => '2019-04-10 07:43:02',
'name' => 'Eglė', // 'name' => 'Eglė',
'surname' => 'Pavardenytė', // 'surname' => 'Pavardenytė',
'phone' => '', // 'phone' => '',
'email' => 'egle@example.com', // 'email' => 'egle@example.com',
'city' => 'Kaunas', // 'city' => 'Kaunas',
'comment' => '', // 'comment' => '',
'cv' => '' // 'cv' => ''
) ); // ) );
return new WP_REST_Response( $res, 200 ); // return new WP_REST_Response( $res, 200 );
} // }
add_action('init', 'start_session', 1); add_action('init', 'start_session', 1);
...@@ -527,23 +576,22 @@ add_action( 'rest_api_init', function () { ...@@ -527,23 +576,22 @@ add_action( 'rest_api_init', function () {
) )
)); ));
register_rest_route( 'api/v1', '/contacts', array( // register_rest_route( 'api/v1', '/contacts', array(
'methods' => WP_REST_Server::READABLE, // 'methods' => WP_REST_Server::READABLE,
'callback' => 'Biuro_Contacts_Public::getContacts', // 'callback' => 'Biuro_Contacts_Public::getContacts',
'args' => [ // 'args' => [
'from' => [ // 'from' => [
'validate_callback' => function($param, $request, $key) { // 'validate_callback' => function($param, $request, $key) {
return is_string( $param ); // return is_string( $param );
} // }
], // ],
'by' => [ // 'by' => [
'validate_callback' => function($param, $request, $key) { // 'validate_callback' => function($param, $request, $key) {
return is_string( $param ); // return is_string( $param );
} // }
] // ]
] // ]
)); // ));
}); });
......
...@@ -22,22 +22,24 @@ ...@@ -22,22 +22,24 @@
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php <?php
if (is_search() || get_post_type() == 'page'):
get_template_part( 'template-parts/meta/canonical'); get_template_part( 'template-parts/meta/canonical');
endif;
?> ?>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-500.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-500.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-regular.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-regular.woff2" crossorigin="anonymous" >
<style><?php include 'css/core.min.css'; ?></style> <style><?php include 'css/core-38a448fde0.min.css'; ?></style>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-300.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-300.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-700.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-700.woff2" crossorigin="anonymous" >
<link rel="preload" href="/wp-content/themes/biuro/css/main.min.css" as="style" onload="this.rel='stylesheet'"> <link rel="preload" href="/wp-content/themes/biuro/css/main-780377ec27.min.css" as="style" onload="this.rel='stylesheet'">
<noscript> <noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main.min.css"> <link rel="stylesheet" href="/wp-content/themes/biuro/css/main-780377ec27.min.css">
</noscript> </noscript>
<?php wp_head(); ?> <?php wp_head(); ?>
......
<?php <?php
// global $time_start; // global $time_start;
// $time_start = microtime(true); // $time_start = microtime(true);
// delog((microtime(true) - $time_start), 'Lorem ipsum');
?><!DOCTYPE html> ?><!DOCTYPE html>
<html <?php language_attributes(); ?>> <html <?php language_attributes(); ?>>
<head> <head>
...@@ -22,28 +23,30 @@ ...@@ -22,28 +23,30 @@
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php <?php
if (is_search() || get_post_type() == 'page'):
get_template_part( 'template-parts/meta/canonical'); get_template_part( 'template-parts/meta/canonical');
endif;
?> ?>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-500.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-500.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-regular.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-regular.woff2" crossorigin="anonymous" >
<style><?php include 'css/core.min.css'; ?></style> <style><?php include 'css/core-38a448fde0.min.css'; ?></style>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-300.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-300.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-700.woff2" crossorigin="anonymous" > <link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-700.woff2" crossorigin="anonymous" >
<link rel="preload" href="/wp-content/themes/biuro/css/main.min.css" as="style" onload="this.rel='stylesheet'"> <link rel="preload" href="/wp-content/themes/biuro/css/main-780377ec27.min.css" as="style" onload="this.rel='stylesheet'">
<noscript> <noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main.min.css"> <link rel="stylesheet" href="/wp-content/themes/biuro/css/main-780377ec27.min.css">
</noscript> </noscript>
<?php wp_head(); ?> <?php wp_head(); ?>
</head> </head>
<body> <body>
<?php include 'template-parts/svg/icons.php'; ?> <?php /* include 'template-parts/svg/icons.php'; */?>
<header class="l-header"> <header class="l-header">
<div class="l-inner l-inner--header"> <div class="l-inner l-inner--header">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -28,7 +28,7 @@ endif; ...@@ -28,7 +28,7 @@ endif;
?> ?>
<form id="search" class="c-search" action="<?php echo home_url(); ?>" method="get"> <form id="search" class="c-search" action="<?php echo home_url(); ?>" method="get">
<div class="c-search--col c-search--col-location"> <label for="search-city" class="c-search--col c-search--col-location">
<svg xmlns="http://www.w3.org/2000/svg" width="15px" height="21px" viewBox="0 0 15 21" class="c-ico--location"> <svg xmlns="http://www.w3.org/2000/svg" width="15px" height="21px" viewBox="0 0 15 21" class="c-ico--location">
<path fill="#B8BCC1" d="M7.5,4.25c2.068,0,3.75,1.682,3.75,3.75s-1.682,3.75-3.75,3.75S3.75,10.068,3.75,8 S5.432,4.25,7.5,4.25z M7.5,10.5C8.878,10.5,10,9.379,10,8S8.878,5.5,7.5,5.5C6.121,5.5,5,6.622,5,8C5,9.379,6.121,10.5,7.5,10.5z M7.5,0.5C11.642,0.5,15,3.858,15,8c0,3.024-1.054,3.868-6.729,12.096c-0.373,0.538-1.169,0.538-1.542,0C1.054,11.868,0,11.024,0,8 C0,3.858,3.358,0.5,7.5,0.5z M7.5,19.013c5.442-7.87,6.25-8.494,6.25-11.013c0-1.669-0.65-3.239-1.831-4.419 C10.739,2.4,9.169,1.75,7.5,1.75S4.261,2.4,3.081,3.581C1.9,4.761,1.25,6.331,1.25,8C1.25,10.519,2.059,11.144,7.5,19.013z"/> <path fill="#B8BCC1" d="M7.5,4.25c2.068,0,3.75,1.682,3.75,3.75s-1.682,3.75-3.75,3.75S3.75,10.068,3.75,8 S5.432,4.25,7.5,4.25z M7.5,10.5C8.878,10.5,10,9.379,10,8S8.878,5.5,7.5,5.5C6.121,5.5,5,6.622,5,8C5,9.379,6.121,10.5,7.5,10.5z M7.5,0.5C11.642,0.5,15,3.858,15,8c0,3.024-1.054,3.868-6.729,12.096c-0.373,0.538-1.169,0.538-1.542,0C1.054,11.868,0,11.024,0,8 C0,3.858,3.358,0.5,7.5,0.5z M7.5,19.013c5.442-7.87,6.25-8.494,6.25-11.013c0-1.669-0.65-3.239-1.831-4.419 C10.739,2.4,9.169,1.75,7.5,1.75S4.261,2.4,3.081,3.581C1.9,4.761,1.25,6.331,1.25,8C1.25,10.519,2.059,11.144,7.5,19.013z"/>
</svg> </svg>
...@@ -41,10 +41,10 @@ endif; ...@@ -41,10 +41,10 @@ endif;
endforeach; endforeach;
?> ?>
</datalist> </datalist>
<input list="search-cities" id="search-city" name="city" value="<?php echo (isset($searchQuery['city'])) ? trim(urldecode($searchQuery['city'])) : ''; ?>" placeholder="<?php _e('Locations', 'biuro'); ?>" class="c-search--input c-search--location" /> <input list="search-cities" id="search-city" aria-label="<?php _e('Locations', 'biuro'); ?>" name="city" value="<?php echo (isset($searchQuery['city'])) ? trim(urldecode($searchQuery['city'])) : ''; ?>" placeholder="<?php _e('Locations', 'biuro'); ?>" class="c-search--input c-search--location" />
</div><!-- .c-search--col c-search--col-location --> </label><!-- .c-search--col c-search--col-location -->
<div class="c-search--col c-search--col-keyword"> <label for="search-query" class="c-search--col c-search--col-keyword">
<svg xmlns="http://www.w3.org/2000/svg" width="20px" height="19px" viewBox="0 0 20 19" class="c-ico--area"> <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="19px" viewBox="0 0 20 19" class="c-ico--area">
<path fill="#B8BCC1" d="M18.125,4.5C19.16,4.5,20,5.339,20,6.375v10c0,1.036-0.839,1.875-1.875,1.875H1.875 C0.839,18.25,0,17.411,0,16.375v-10C0,5.339,0.839,4.5,1.875,4.5H6.25V1.688c0-0.518,0.42-0.937,0.937-0.937h5.625 c0.518,0,0.938,0.42,0.938,0.937V4.5H18.125z M7.5,2v2.5h5V2H7.5z M18.75,16.375V10.75H12.5v1.562c0,0.518-0.42,0.937-0.938,0.937 H8.437c-0.518,0-0.938-0.42-0.938-0.937V10.75H1.25v5.625C1.25,16.72,1.53,17,1.875,17h16.25C18.47,17,18.75,16.72,18.75,16.375z M8.75,12h2.5v-1.25h-2.5V12z M18.75,9.5V6.375c0-0.345-0.28-0.625-0.625-0.625H1.875C1.53,5.75,1.25,6.03,1.25,6.375V9.5H18.75z"/> <path fill="#B8BCC1" d="M18.125,4.5C19.16,4.5,20,5.339,20,6.375v10c0,1.036-0.839,1.875-1.875,1.875H1.875 C0.839,18.25,0,17.411,0,16.375v-10C0,5.339,0.839,4.5,1.875,4.5H6.25V1.688c0-0.518,0.42-0.937,0.937-0.937h5.625 c0.518,0,0.938,0.42,0.938,0.937V4.5H18.125z M7.5,2v2.5h5V2H7.5z M18.75,16.375V10.75H12.5v1.562c0,0.518-0.42,0.937-0.938,0.937 H8.437c-0.518,0-0.938-0.42-0.938-0.937V10.75H1.25v5.625C1.25,16.72,1.53,17,1.875,17h16.25C18.47,17,18.75,16.72,18.75,16.375z M8.75,12h2.5v-1.25h-2.5V12z M18.75,9.5V6.375c0-0.345-0.28-0.625-0.625-0.625H1.875C1.53,5.75,1.25,6.03,1.25,6.375V9.5H18.75z"/>
</svg> </svg>
...@@ -58,8 +58,8 @@ endif; ...@@ -58,8 +58,8 @@ endif;
endforeach; endforeach;
?> ?>
</datalist> </datalist>
<input list="search-queries" id="search-query" name="s" value="<?php echo (isset($searchQuery['s'])) ? trim(urldecode($searchQuery['s'])) : ''; ?>" placeholder="<?php _e('Keyword', 'biuro'); ?>" class="c-search--input c-search--keyword" /> <input list="search-queries" id="search-query" aria-label="<?php _e('Keyword', 'biuro'); ?>" name="s" value="<?php echo (isset($searchQuery['s'])) ? trim(urldecode($searchQuery['s'])) : ''; ?>" placeholder="<?php _e('Keyword', 'biuro'); ?>" class="c-search--input c-search--keyword" />
</div><!-- .c-search--col c-search--col-keyword --> </label><!-- .c-search--col c-search--col-keyword -->
<button class="o-btn c-btn--main <?php if ( is_front_page() ): ?>c-btn--search<?php else: ?>c-btn--search-small<?php endif; ?>" type="submit" value="1"> <button class="o-btn c-btn--main <?php if ( is_front_page() ): ?>c-btn--search<?php else: ?>c-btn--search-small<?php endif; ?>" type="submit" value="1">
<svg xmlns="http://www.w3.org/2000/svg" width="17px" height="17px" viewBox="0 0 17 17" class="c-ico--search"> <svg xmlns="http://www.w3.org/2000/svg" width="17px" height="17px" viewBox="0 0 17 17" class="c-ico--search">
<path fill="#FFFFFF" d="M16.884,15.694c0.156,0.156,0.156,0.408,0,0.564l-0.75,0.75c-0.156,0.156-0.408,0.156-0.564,0 l-4.031-4.031c-0.073-0.076-0.116-0.176-0.116-0.282v-0.438c-1.212,1.046-2.789,1.68-4.516,1.68C3.091,13.938,0,10.846,0,7.031 s3.091-6.906,6.906-6.906c3.815,0,6.906,3.091,6.906,6.906c0,1.727-0.634,3.304-1.68,4.516h0.438c0.106,0,0.206,0.04,0.282,0.116 L16.884,15.694z M6.906,12.344c2.935,0,5.313-2.377,5.313-5.312S9.841,1.719,6.906,1.719c-2.935,0-5.313,2.377-5.313,5.312 S3.971,12.344,6.906,12.344z"/> <path fill="#FFFFFF" d="M16.884,15.694c0.156,0.156,0.156,0.408,0,0.564l-0.75,0.75c-0.156,0.156-0.408,0.156-0.564,0 l-4.031-4.031c-0.073-0.076-0.116-0.176-0.116-0.282v-0.438c-1.212,1.046-2.789,1.68-4.516,1.68C3.091,13.938,0,10.846,0,7.031 s3.091-6.906,6.906-6.906c3.815,0,6.906,3.091,6.906,6.906c0,1.727-0.634,3.304-1.68,4.516h0.438c0.106,0,0.206,0.04,0.282,0.116 L16.884,15.694z M6.906,12.344c2.935,0,5.313-2.377,5.313-5.312S9.841,1.719,6.906,1.719c-2.935,0-5.313,2.377-5.313,5.312 S3.971,12.344,6.906,12.344z"/>
......
...@@ -10,22 +10,18 @@ ...@@ -10,22 +10,18 @@
*/ */
global $jobs; global $jobs;
$date_format = get_option( 'date_format' );
?> ?>
<table cellspacing="0" cellpadding="0" class="c-jobs--table"> <table cellspacing="0" cellpadding="0" class="c-jobs--table">
<?php <?php
$i = 0;
while ( $jobs->fetch() ) : while ( $jobs->fetch() ) :
$ID = $jobs->display( 'ID' ); $ID = $jobs->display( 'ID' );
$name = $jobs->display( 'name' ); $name = $jobs->display( 'name' );
//Primary city id
$primaryCities = get_post_meta($ID, '_yoast_wpseo_primary_city');
$i++;
?> ?>
<tr <?php if ( $i % 2 != 0 ) { echo 'class="c-jobs--row-odd"'; } ?>> <tr>
<td class="c-jobs--col c-jobs--col-position"> <td class="c-jobs--col c-jobs--col-position">
<a class="c-jobs--anchor" href="<?php echo get_post_permalink( $ID ); ?>" title="<?php echo $name; ?>"><?php echo $name; ?></a> <a class="c-jobs--anchor" href="<?php echo get_post_permalink( $ID ); ?>" title="<?php echo $name; ?>"><?php echo $name; ?></a>
</td> </td>
...@@ -34,6 +30,9 @@ global $jobs; ...@@ -34,6 +30,9 @@ global $jobs;
$cities = $jobs->field( 'city'); $cities = $jobs->field( 'city');
$count = 0; $count = 0;
//Primary city id
$primaryCities = get_post_meta($ID, '_yoast_wpseo_primary_city');
//Sort by primary city (put it first) //Sort by primary city (put it first)
if (is_array($cities)): if (is_array($cities)):
uasort($cities, function($a, $b) use ($primaryCities) { uasort($cities, function($a, $b) use ($primaryCities) {
...@@ -64,7 +63,7 @@ global $jobs; ...@@ -64,7 +63,7 @@ global $jobs;
?> ?>
</td> </td>
<td class="c-jobs--col c-jobs--col-valid"> <td class="c-jobs--col c-jobs--col-valid">
<?php echo date_i18n( get_option( 'date_format' ), strtotime( $jobs->field( 'valid' ) ) ); ?> <?php echo date_i18n( $date_format, strtotime( $jobs->field( 'valid' ) ) ); ?>
</td> </td>
</tr> </tr>
......
<?php <?php
if (isset($_GET['pg'])):
return;
endif;
global $query_string; global $query_string;
wp_parse_str( $query_string, $searchQuery ); wp_parse_str( $query_string, $searchQuery );
if ( is_search() && !isset($_GET['pg']) ) : if ( is_search()) :
if ( $searchQuery['city'] && !$searchQuery['s'] ) : if ( $searchQuery['city'] && !$searchQuery['s'] ) :
$term = get_term_by( 'name', $searchQuery['city'], 'city' ); $term = get_term_by( 'name', $searchQuery['city'], 'city' );
...@@ -12,9 +17,9 @@ if ( is_search() && !isset($_GET['pg']) ) : ...@@ -12,9 +17,9 @@ if ( is_search() && !isset($_GET['pg']) ) :
$page = get_term_meta( $term->term_id, 'page-id', true); $page = get_term_meta( $term->term_id, 'page-id', true);
if ( $page ) : if ( $page ) :
?> ?>
<link rel="canonical" href="<?php echo get_page_link( $page['ID'] ); ?>" /> <link rel="canonical" href="<?php echo get_page_link( $page['ID'] ); ?>" />
<?php <?php
return; return;
endif; endif;
endif; endif;
...@@ -31,23 +36,23 @@ if ( is_search() && !isset($_GET['pg']) ) : ...@@ -31,23 +36,23 @@ if ( is_search() && !isset($_GET['pg']) ) :
$page = get_term_meta( $term->term_id, 'page-id', true); $page = get_term_meta( $term->term_id, 'page-id', true);
if ( $page ) : if ( $page ) :
?> ?>
<link rel="canonical" href="<?php echo get_page_link( $page['ID'] ); ?>" /> <link rel="canonical" href="<?php echo get_page_link( $page['ID'] ); ?>" />
<?php <?php
return; return;
endif; endif;
endif; endif;
else: else:
?> ?>
<meta name="robots" content="noindex" /> <meta name="robots" content="noindex" />
<?php <?php
endif; endif;
elseif ( get_post_type() == 'page' ): elseif ( get_post_type() == 'page' ):
if ( !isset($_GET['pg']) && (get_post_meta( get_the_ID(), 'built_in_taxonomies_city', true ) || get_post_meta( get_the_ID(), 'built_in_taxonomies_type', true ) || get_post_meta( get_the_ID(), 'built_in_taxonomies_field', true )) ) : if ( get_post_meta( get_the_ID(), 'built_in_taxonomies_city', true ) || get_post_meta( get_the_ID(), 'built_in_taxonomies_type', true ) || get_post_meta( get_the_ID(), 'built_in_taxonomies_field', true ) ) :
?> ?>
<link rel="canonical" href="<?php echo get_permalink(); ?>" /> <link rel="canonical" href="<?php echo get_permalink(); ?>" />
<?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