add search and archive to loop

This commit is contained in:
Fabiano Alencar 2018-04-03 13:51:15 -03:00
parent d66211b090
commit 0c7ed46274
1 changed files with 9 additions and 2 deletions

View File

@ -6,17 +6,24 @@
<?php
if(is_home()) echo 'Blog';
elseif(is_single()) the_title();
elseif(is_search()){
_e('Search Results for', 'tainacan-theme');
echo ' ' . the_search_query();
}
elseif(is_archive()){
echo ' ' . get_the_archive_title();
}
?>
</li>
<li class="list-inline-item float-right"><a href=""><?php _e('Back'); ?></a></li>
</ul>
</div>
</div>
<div class="<?php if(is_home()) echo 'mt-5 tainacan-list-post'; elseif(is_single()) echo 'mt-3 tainacan-single-post'; ?>">
<div class="<?php if(is_home() || is_search() || is_category() || is_archive()) echo 'mt-5 tainacan-list-post'; elseif(is_single()) echo 'mt-3 tainacan-single-post'; ?>">
<?php while(have_posts()):
the_post();
//List Post
if(is_home()){
if(is_home() || is_search() || is_category() || is_archive()){
get_template_part('template-parts/list-post');
}
//View Post