Fix search on navbar

This commit is contained in:
Fabiano 2018-07-31 16:04:11 -03:00
parent 482dcf71e0
commit 4da83f771f
3 changed files with 17 additions and 11 deletions

View File

@ -135,10 +135,10 @@ function tainacan_get_form_search(){
}
$form = '';
$form .= '<form class="tainacan-form-search d-none align-items-center">';
$form .= '<form class="tainacan-form-search d-none align-items-center" action="'.home_url( '/' ).'">';
$form .= '<div id="test-form-search" class="d-flex justify-content-between">';
$form .= '<div id="input-search" class="w-100 pl-1">';
$form .= '<input class="form-control tainacan-input-search py-0 pr-0 '.$input.'" type="search" placeholder="'.__('Search in repository', 'tainacan-theme').'" style="height:31px">';
$form .= '<input class="form-control tainacan-input-search py-0 pr-0 '.$input.'" type="search" name="s" placeholder="'.__('Search in repository', 'tainacan-theme').'" style="height:31px">';
$form .= '</div>';
if(wp_is_mobile()){
$form .= '<div id="btn-reset" class="d-none">';

View File

@ -5,14 +5,21 @@
<div <?php if ( get_header_image() ) : ?>class="page-header header-filter clear-filter page-height" style="background-image: url('<?php header_image(); ?>')"<?php else: ?>class="page-header header-filter clear-filter align-items-center" style="background-image: url('<?php echo get_template_directory_uri() ?>/assets/images/capa.png')"<?php endif; ?>>
<div class="container-fluid max-large p-0 ph-title-description">
<div class="bg-white-title title-header <?php if(is_singular() || is_archive()) { echo 'singular-title'; }?>">
<div class="bg-white-title title-header <?php if(is_singular() || is_archive() || is_search()) { echo 'singular-title'; }?>">
<h1 class="mb-0 text-truncate">
<?php if(is_home()) { ?> Blog <?php bloginfo('title'); }?>
<?php if(is_singular()) {
<?php
if(is_home()) { ?> Blog <?php bloginfo('title'); }
elseif(is_singular()) {
/* echo mb_strimwidth(get_the_title(),0,25,'...'); */
the_title();
}?>
<?php if(is_archive()) { ?> <?php echo get_the_archive_title(); }?>
}
elseif(is_archive()) { echo get_the_archive_title(); }
elseif(is_search()){
_e('Search Results for ', 'tainacan-theme');
the_search_query();
}
?>
</h1>
<?php if(is_home()) {?> <span><?php bloginfo('description'); }?></span>
</div>

View File

@ -7,7 +7,6 @@
if(is_home()) echo 'Blog';
elseif(is_search()){
_e('Search Results for', 'tainacan-theme');
echo ' ';
the_search_query();
}
elseif(is_archive()){