Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dev.biuro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Biuro
dev.biuro
Commits
990225d1
Commit
990225d1
authored
Feb 22, 2019
by
Simonas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Awesomplete added
parent
16d6a5fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
17 deletions
+25
-17
search.php
wp-content/themes/biuro/search.php
+6
-2
searchform.php
wp-content/themes/biuro/searchform.php
+11
-11
canonical.php
wp-content/themes/biuro/template-parts/meta/canonical.php
+8
-4
No files found.
wp-content/themes/biuro/search.php
View file @
990225d1
...
...
@@ -105,8 +105,12 @@ get_header(); ?>
if
(
$searchQuery
)
:
if
(
$searchQuery
[
'city'
]
&&
intval
(
$searchQuery
[
'city'
]
)
)
:
$where
=
$where
.
' AND city.term_id = '
.
intval
(
$searchQuery
[
'city'
]
);
if
(
$searchQuery
[
'city'
]
)
:
$city
=
get_term_by
(
'name'
,
$searchQuery
[
'city'
],
'city'
);
if
(
$city
)
:
$where
=
$where
.
' AND city.term_id = '
.
$city
->
term_id
;
endif
;
endif
;
if
(
$searchQuery
[
's'
]
)
:
...
...
wp-content/themes/biuro/searchform.php
View file @
990225d1
...
...
@@ -8,7 +8,7 @@
* @version 1.0
*/
// global $searchPageURL
;
global
$query_string
;
?>
<?php
/*
...
...
@@ -27,6 +27,11 @@
endwhile
;
endif
;
if
(
is_search
()
)
:
wp_parse_str
(
$query_string
,
$searchQuery
);
endif
;
?>
<datalist
id=
"search-cities"
>
...
...
@@ -46,7 +51,7 @@
foreach
(
$cities
as
$city
)
:
$name
=
$city
->
name
;
$termID
=
$city
->
term_id
;
$selected
=
(
$cityID
==
$termID
)
?
'selected="selected"'
:
''
;
//
$selected = ($cityID == $termID) ? 'selected="selected"' : '';
$where
=
'valid.meta_value > "'
.
date
(
'Y-m-d'
,
strtotime
(
'-1 days'
))
.
'" AND city.term_id = '
.
$termID
;
...
...
@@ -60,14 +65,14 @@
if
(
0
<
$jobsIn
->
total
()
)
:
?>
<option
value=
"
<?php
echo
$
termID
;
?>
"
<?php
echo
$selected
;
?>
>
<?php
echo
$name
;
?>
(
<?php
echo
$jobsIn
->
total
();
?>
)
</option>
<option
value=
"
<?php
echo
$
name
;
?>
"
<?php
echo
$selected
;
?>
>
<?php
echo
$name
;
?>
(
<?php
echo
$jobsIn
->
total
();
?>
)
</option>
<?php
endif
;
endforeach
;
endif
;
?>
</datalist>
<input
list=
"search-cities"
id=
"search-city"
name=
"city"
value=
"
<?php
echo
cityID
;
?>
"
placeholder=
"Vietovė"
/>
<input
list=
"search-cities"
id=
"search-city"
name=
"city"
value=
"
<?php
echo
(
$searchQuery
)
?
$searchQuery
[
'city'
]
:
''
;
?>
"
placeholder=
"Vietovė"
/>
<datalist
id=
"search-queries"
>
<?php
...
...
@@ -161,17 +166,12 @@
?>
</datalist>
<input
list=
"search-queries"
id=
"search-query"
name=
"s"
value=
"
<?php
echo
searchQuery
;
?>
"
placeholder=
"Raktažodis"
/>
<input
list=
"search-queries"
id=
"search-query"
name=
"s"
value=
"
<?php
echo
(
$searchQuery
)
?
$searchQuery
[
's'
]
:
''
;
?>
"
placeholder=
"Raktažodis"
/>
<input
type=
"submit"
value=
"Ieškoti"
class=
"filter-button"
/>
<?php
/*
<a href="<?php echo pll_home_url(); ?>" class="filter-button"><?php pll_e('Clear'); ?></a>
*/
?>
</form>
<?php
/*
...
...
wp-content/themes/biuro/template-parts/meta/canonical.php
View file @
990225d1
...
...
@@ -5,14 +5,18 @@ wp_parse_str( $query_string, $searchQuery );
if
(
is_search
()
)
:
if
(
$searchQuery
[
'city'
]
&&
intval
(
$searchQuery
[
'city'
]
)
&&
!
$searchQuery
[
's'
]
)
:
$
page
=
get_term_meta
(
$searchQuery
[
'city'
],
'page-id'
,
true
);
if
(
$searchQuery
[
'city'
]
&&
!
$searchQuery
[
's'
]
)
:
$
term
=
get_term_by
(
'name'
,
$searchQuery
[
'city'
],
'city'
);
if
(
$page
)
:
if
(
$term
)
:
$page
=
get_term_meta
(
$term
->
term_id
,
'page-id'
,
true
);
if
(
$page
)
:
?>
<link
rel=
"canonical"
href=
"
<?php
echo
get_page_link
(
$page
[
'ID'
]
);
?>
"
/>
<?php
return
;
return
;
endif
;
endif
;
elseif
(
!
$searchQuery
[
'city'
]
&&
$searchQuery
[
's'
]
)
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment