Commit 53aae2ea authored by Simonas's avatar Simonas

SEO fixes in progress

parent 65038724
......@@ -105,8 +105,8 @@ services:
- ./wordpress:/var/www/html
- './wp-init.sh:/usr/local/bin/wp-init.sh'
# command:
# - wp-init.sh
command:
- wp-init.sh
networks:
front:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,7 +20,7 @@
// https://pods.io/docs/code/pods/find/
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"';
// $where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND t.post_title LIKE "%' . $search . '%"';
// $where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND (t.post_title LIKE "%' . searchQuery . '%" OR t.post_content LIKE "%' . searchQuery . '%")';
$params = array(
'orderby' => 'date DESC',
......
......@@ -6,6 +6,10 @@ function debug($arr) {
echo '</pre>';
}
function delog($str, $label = 'Label') {
echo '<h1 style="white-space: nowrap;">' . $label . ': ' . $str . '</h1>';
}
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
......@@ -225,6 +229,8 @@ function init_biuro_theme() {
pll_register_string('biuro-language', 'Language', 'Biuro');
pll_register_string('biuro-next', 'Next ', 'Biuro');
pll_register_string('biuro-previous', 'Previous', 'Biuro');
pll_register_string('biuro-home', 'Home page', 'Biuro');
endif;
}
add_action('init', 'init_biuro_theme');
......
<!DOCTYPE html>
<?php
$searchQuery = get_search_query();
$cityID = get_query_var('city');
$cityID = is_numeric($cityID) ? $cityID : '';
define('searchQuery', $searchQuery);
define('cityID', $cityID);
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
......@@ -66,22 +75,15 @@
<div class="l-inner" style="box-shadow: inset 0 0 0 1px blue; padding: 1em 0;">
<?php
/*
<h1><?php echo get_post_type(); ?></h1>
*/
get_search_form();
?>
<?php
// https://torquemag.io/2017/10/add-breadcrumbs-wordpress-website/
if ( function_exists('yoast_breadcrumb') && !is_front_page() ) {
yoast_breadcrumb('<div class="c-breadcrumbs"><a href="' . pll_home_url() . '">' . get_the_title( get_option('page_on_front') ) . '</a> › ','</div>');
}
get_template_part( 'template-parts/layout/breadcrumb' );
?>
</div>
<div id="main" class="l-content">
<?php
if (get_post_type() == 'job'):
if ( !searchQuery && !cityID && get_post_type() == 'job' ):
?>
<aside class="l-aside">
<?php
......@@ -92,3 +94,5 @@
endif;
?>
<main id="content" class="l-main">
......@@ -15,11 +15,6 @@
* @version 1.0
*/
$search = get_query_var('s');
$cityID = get_query_var('city');
$cityID = is_numeric($cityID) ? $cityID : '';
get_header(); ?>
<?php
......@@ -30,11 +25,11 @@ get_header(); ?>
// Use for search
// https://pods.io/docs/code/pods/find/
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND t.post_title LIKE "%' . $search . '%"';
// 'where' => 't.post_title LIKE "%' . $keyword . '%" OR my_field.meta_value LIKE "%' . $keyword . '%"'
// $where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND t.post_title 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 . '%")';
if ($cityID):
$where = $where . ' AND city.term_id = ' . $cityID;
if (cityID):
$where = $where . ' AND city.term_id = ' . cityID;
endif;
$params = array(
......@@ -51,7 +46,7 @@ get_header(); ?>
else:
get_template_part( 'template-parts/jobs/jobs', 'none' );
get_template_part( 'template-parts/jobs/jobs', 'not-found' );
endif;
?>
......
......@@ -31,7 +31,8 @@ get_header(); ?>
$ID = get_the_ID();
$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')) . '"';
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND (t.post_title LIKE "%' . searchQuery . '%" OR t.post_content LIKE "%' . searchQuery . '%")';
$taxonomies = array();
......@@ -72,7 +73,7 @@ get_header(); ?>
else:
get_template_part( 'template-parts/jobs/jobs', 'none' );
get_template_part( 'template-parts/jobs/jobs', 'not-found' );
endif;
?>
......
......@@ -8,10 +8,6 @@
* @version 1.0
*/
$search = get_query_var('s');
$cityID = get_query_var('city');
$cityID = is_numeric($cityID) ? $cityID : '';
?>
<form class="c-search" action="<?php echo pll_home_url(); ?>" method="get">
......@@ -56,9 +52,9 @@
endif;
?>
</datalist>
<input list="search-cities" id="search-city" name="city" value="<?php echo $cityID; ?>" placeholder="" />
<input list="search-cities" id="search-city" name="city" value="<?php echo cityID; ?>" placeholder="" />
<input type="text" name="s" id="search" value="<?php echo $search; ?>" />
<input type="text" name="s" id="search" value="<?php echo searchQuery; ?>" />
<input type="submit" value="Ieškoti" class="filter-button" />
<a href="<?php echo pll_home_url(); ?>" class="filter-button"><?php pll_e('Clear'); ?></a>
......
......@@ -11,4 +11,4 @@
?>
<p>Pagal Jūsų paiešką rezultatų neradome.</p>
<p>Darbo skelbimų nėra.</p>
<?php
/**
* Template part for displaying a message that jobs cannot be found
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage Twenty_Nineteen
* @since 1.0.0
*/
?>
<p>Pagal Jūsų paiešką rezultatų neradome.</p>
<?php
// https://torquemag.io/2017/10/add-breadcrumbs-wordpress-website/
if ( !function_exists('yoast_breadcrumb') || is_front_page() || searchQuery) :
return;
endif;
if ( cityID ) :
$page = get_term_meta( cityID, 'page-id', true);
if ( $page ) :
yoast_breadcrumb('<div class="c-breadcrumbs"><a href="' . pll_home_url() . '">' . pll__('Home page') . '</a> › ' . get_the_title( $page['ID'] ) . ' ','</div>');
endif;
else:
yoast_breadcrumb('<div class="c-breadcrumbs"><a href="' . pll_home_url() . '">' . pll__('Home page') . '</a> › ','</div>');
endif;
<?php
$search = get_query_var('s');
$cityID = get_query_var('city');
$cityID = is_numeric($cityID) ? $cityID : '';
if ( $cityID && !$search ) :
$page = get_term_meta( $cityID, 'page-id', true);
if ( cityID && !searchQuery ) :
$page = get_term_meta( cityID, 'page-id', true);
if ( $page ) :
?>
<link rel="canonical" href="<?php echo get_page_link( $page['ID'] ); ?>" />
<?
endif;
<?php
endif;
elseif ( !cityID && !searchQuery && get_post_type() == 'page' && get_post_meta( get_the_ID(), 'built_in_taxonomies_city', true ) ):
?>
<link rel="canonical" href="<?php echo get_permalink(); ?>" />
<?php
endif;
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