-
Notifications
You must be signed in to change notification settings - Fork 3
/
translator-search.php
148 lines (116 loc) · 5.16 KB
/
translator-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
140
141
142
143
144
145
146
147
148
<?php
/**
* Template for displaying custom Search Results pages.
*
* @package WordPress Sverige
*/
get_header(); ?>
<section id="page-header" class="section">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="page-title">Översättningsvaliderare</h1>
</div>
</div>
</div>
</section>
<!-- Start Page Header -->
<!-- Start Page Content -->
<section id="page-full" class="section">
<div class="container">
<div class="row">
<?php if ( $post_type == 'wpsvse_projects' ) { ?>
<div id="translation-projects" class="col-md-9">
<p class="tp-breadcrumbs"><a href="<?php echo esc_url( home_url( '/oversattning/' ) ); ?>">Översättning</a> <i class="fa fa-angle-right"></i> <a href="<?php echo esc_url( home_url( '/oversattningsprojekt/' ) ); ?>">Översättningsprojekt</a> <i class="fa fa-angle-right"></i> <?php printf( __( 'Sökresultat för "%s"', 'wpsvse' ), '<span>' . get_search_query() . '</span>' ); ?></p>
<?php if ( $wp_query->have_posts() ) : ?>
<?php
// Find connected pages (for all posts)
p2p_type( 'translator_to_projects' )->each_connected( $wp_query );
?>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php get_template_part( 'template-parts/content', 'projects' ); ?>
<?php endwhile; ?>
<?php wpsvse_content_nav( 'nav-below' ); ?>
<?php else : ?>
<div id="translator-search" class="row">
<form action="<?php echo esc_url( home_url( '/' ) ); ?>" class="col-md-6">
<div>
<i class="fa fa-search"></i>
<label for="translator_search">Hitta projekt</label>
<div class="input-group">
<input class="form-control input-lg" type="text" id="translator_search" name="s" placeholder="Sök efter projekt...">
<input type="hidden" name="post_type" value="wpsvse_projects" />
<span class="input-group-btn">
<input type="submit" class="btn btn-primary input-lg" value="Sök">
</span>
</div>
</div>
</form>
<form action="<?php echo esc_url( home_url( '/' ) ); ?>" class="col-md-6">
<div>
<i class="fa fa-search"></i>
<label for="translator_search">Hitta validerare</label>
<div class="input-group">
<input class="form-control input-lg" type="text" id="translator_search" name="s" placeholder="Sök efter validerare...">
<input type="hidden" name="post_type" value="wpsvse_translators" />
<span class="input-group-btn">
<input type="submit" class="btn btn-primary input-lg" value="Sök">
</span>
</div>
</div>
</form>
</div>
<p>Inga resultat kunde hittas för din sökning.</p>
<?php endif; ?>
</div>
<?php } elseif ( $post_type == 'wpsvse_translators' ) { ?>
<div id="translation-projects" class="col-md-9 validators">
<p class="tp-breadcrumbs"><a href="<?php echo esc_url( home_url( '/oversattning/' ) ); ?>">Översättning</a> <i class="fa fa-angle-right"></i> <a href="<?php echo esc_url( home_url( '/oversattningsvaliderare/' ) ); ?>">Översättningsvaliderare</a> <i class="fa fa-angle-right"></i> <?php printf( __( 'Sökresultat för "%s"', 'wpsvse' ), '<span>' . get_search_query() . '</span>' ); ?></p>
<?php if ( $wp_query->have_posts() ) : ?>
<?php
// Find connected pages (for all posts)
p2p_type( 'translator_to_projects' )->each_connected( $wp_query );
?>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php get_template_part( 'template-parts/content', 'translators' ); ?>
<?php endwhile; ?>
<?php wpsvse_content_nav( 'nav-below' ); ?>
<?php else : ?>
<div id="translator-search" class="row">
<form action="<?php echo esc_url( home_url( '/' ) ); ?>" class="col-md-6">
<div>
<i class="fa fa-search"></i>
<label for="translator_search">Hitta projekt</label>
<div class="input-group">
<input class="form-control input-lg" type="text" id="translator_search" name="s" placeholder="Sök efter projekt...">
<input type="hidden" name="post_type" value="wpsvse_projects" />
<span class="input-group-btn">
<input type="submit" class="btn btn-primary input-lg" value="Sök">
</span>
</div>
</div>
</form>
<form action="<?php echo esc_url( home_url( '/' ) ); ?>" class="col-md-6">
<div>
<i class="fa fa-search"></i>
<label for="translator_search">Hitta validerare</label>
<div class="input-group">
<input class="form-control input-lg" type="text" id="translator_search" name="s" placeholder="Sök efter validerare...">
<input type="hidden" name="post_type" value="wpsvse_translators" />
<span class="input-group-btn">
<input type="submit" class="btn btn-primary input-lg" value="Sök">
</span>
</div>
</div>
</form>
</div>
<p>Inga resultat kunde hittas för din sökning.</p>
<?php endif; ?>
</div>
<?php } ?>
<?php get_sidebar(); ?>
</div>
</div>
</section>
<!-- End Page Content -->
<?php get_footer(); ?>