-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop-search.php
More file actions
executable file
·59 lines (56 loc) · 2.01 KB
/
Copy pathloop-search.php
File metadata and controls
executable file
·59 lines (56 loc) · 2.01 KB
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
<?php
/**
* Loop Template
*
* Displays the entire post content.
*/
global $posts,$wpdb, $wp_query,$htmlvar_name;
$post_query = $wp_query;
// reset wp_query
if(strpos($_SERVER['REQUEST_URI'], 'admin-ajax.php'))
{
if(!isset($cus_post_type ) && is_search()){
if(function_exists('tmpl_get_category_list_customfields') && function_exists('tmpl_get_category_list_customfields'))
{
$heading_type = tmpl_fetch_heading_post_type($wp_query->query_vars['post_type']);
$wp_query = $post_query;
$htmlvar_name = tmpl_get_category_list_customfields($wp_query->query_vars['post_type'],$heading,$key);
$wp_query = $post_query;
}
}
} ?>
<div id="tmpl-search-results" class="list">
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
do_action( 'before_entry' ); // supreme_before_entry
$format = get_post_format( $post->ID ); ?>
<div id="post-<?php echo $post->ID; ?>" <?php post_class(); ?>>
<?php
if($post->post_type =='post'){
get_template_part( 'content', 'blog');
}else{
/* when it's go with wordpress search no custom fields will be display - because not get the custom post type */
if(!isset($cus_post_type ) && is_search() && !strpos($_SERVER['REQUEST_URI'], 'admin-ajax.php') ){
if(function_exists('tmpl_get_category_list_customfields') && function_exists('tmpl_get_category_list_customfields'))
{
$heading_type = tmpl_fetch_heading_post_type($post->post_type);
/* custom fields for custom post type.. */
$htmlvar_name = tmpl_get_category_list_customfields($post->post_type,$heading,$key);
}
}
if(file_exists(get_template_directory().'/content-'.$post->post_type.".php")){
get_template_part( 'content', $post->post_type);
}else{
get_template_part( 'content', get_post_format());
}
} ?>
</div>
<?php
do_action( 'after_entry' );
endwhile;
wp_reset_query();
else:
apply_filters('supreme-loop-error',get_template_part( 'loop-error' )); // Loads the loop-error.php template.
endif; ?>
</div>