-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
139 lines (136 loc) · 3.93 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
$search = new homepage_product();
get_header('login-register');
?>
<main class="author_main" class="site-main ajax_posts" role="main">
<div class="row author_product">
<aside class="col-md-3 aside_left">
<div class="col-md-12 animatedParent position-fixed fixed-top hold_search_socail">
<?php
echo '<img class="dyepie_logo" src="/wp-content/themes/dyepie/images/all-about-handmade.png" >'; ?>
<a class="back-home" href="<?php echo home_url() ?>"><< Back To dyepie</a>
<?php
_e('<h2 class="col-md-12 search_results ">best matches results for' . '<br> "' . get_query_var('s') . '"' .'</h2>');
get_search_form();
$search->social_media();
?>
</div>
</aside>
<aside class="col-md-9 search-content">
<div class="row container">
<?php
$s=get_search_query();
$args = array(
's' =>$s,
'posts_per_page' => -1,
'post_type' => $search::POSTTYPE,
'tax_query' => array(
array(
'taxonomy' => $search->dyepie_tax,
'feild' => $search->slug(),
'terms' => $search->term_name(),
)
),
);
// The Query
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
?>
<div class="col-md-4 post-info">
<div class="author-products-container">
<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
?>
<?php echo '<img class="img_prod" src="'. $url .'" alt="">'; ?>
<div class="author-products-overlay hold-title">
<h2 class="title-h2">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
<?php echo $search->term_name(); ?>
</h2>
</div>
</div>
</div>
<?php
}
}else{
?>
<div class="search_results missing_search_results">
<h2 class="">Oh,Nothing Found</h2>
<?php
echo'
<p>Sorry, but nothing matched "'. get_search_query($s) .'" Please try again with some different keywords.</p>'; ?>
</div>
<?php } ?>
</div>
</aside>
</div><!-- end col-md-8 -->
</main>
<?php get_footer('login-register'); ?>
<?php // dyepie Template
if(is_search()){ ?>
<style>
#wpadminbar{
display: none;
}
body{
background: none;
}
html{
background-image: url(/wp-content/themes/dyepie/images/login-bg.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: right;
min-height: 100%;
margin: 0 auto !important;
background-attachment: fixed;
}
.dyepie_logo{
height: auto;
}
/* search page styles */
.aside_left
{
background: #fff;
}
.search_results{
font-size: 21px;
text-transform: capitalize;
background: rgba(0, 0, 0, 0.1);
color: #212529;
padding: .5em;
text-align: center;
}
.missing_search_results{
width: 100%;
text-align: center;
padding: 1em;
background: rgba(0, 0, 0, 0.3);
color: #fff;
text-transform: capitalize;
margin: auto;
position: absolute;
left: 0;
right: 0;
bottom: 35%;
}
.search-content{
min-height: 100vh;
}
.hold_search_socail{
min-height: 100%;
width: 25%;
display: grid;
justify-items: center;
align-items: center;
}
.socail_i {
font-size: 35px;
margin-top: .5em;
}
/* end search page */
</style>
<?php
} ?>