-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
68 lines (68 loc) · 2.36 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
<?php
/**
* The template for displaying search results.
*
* @package Theme Freesia
* @subpackage Pixgraphy
* @since Pixgraphy 1.0
*/
get_header();
$pixgraphy_settings = pixgraphy_get_theme_options();
if($pixgraphy_settings['pixgraphy_photography_layout'] != 'photography_layout'){
global $pixgraphy_content_layout;
if( $post ) {
$layout = get_post_meta( get_queried_object_id(), 'pixgraphy_sidebarlayout', true );
}
if( empty( $layout ) || is_archive() || is_search() || is_home() ) {
$layout = 'default';
}
if( 'default' == $layout ) { //Settings from customizer
if(($pixgraphy_settings['pixgraphy_sidebar_layout_options'] != 'nosidebar') && ($pixgraphy_settings['pixgraphy_sidebar_layout_options'] != 'fullwidth')){ ?>
<div id="primary">
<?php }
}?>
<main id="main" class="site-main clearfix">
<?php
$pixgraphy_stickies = get_option('sticky_posts');
if( $pixgraphy_stickies ) {
$pixgraphy_args = array( 'ignore_sticky_posts' => 1, 'post__not_in' => $pixgraphy_stickies );
query_posts( array_merge($wp_query->query, $pixgraphy_args) );
}
if( have_posts() ) {
while(have_posts() ) {
the_post();
get_template_part( 'content', get_post_format() );
}
}
else { ?>
<h2 class="entry-title"> <?php esc_html_e( 'No Posts Found.', 'pixgraphy' ); ?> </h2>
<?php } ?>
<?php get_template_part( 'pagination', 'none' ); ?>
</main> <!-- #main -->
<?php
if( 'default' == $layout ) { //Settings from customizer
if(($pixgraphy_settings['pixgraphy_sidebar_layout_options'] != 'nosidebar') && ($pixgraphy_settings['pixgraphy_sidebar_layout_options'] != 'fullwidth')): ?>
</div> <!-- #primary -->
<?php endif;
}
get_sidebar();
}else{ ?>
<!-- post_masonry ============================================= -->
<section id="post_masonry" class="<?php echo esc_attr($pixgraphy_settings['pixgraphy_column_post']);?>-column-post clearfix">
<?php
$pixgraphy_stickies = get_option('sticky_posts');
if( $pixgraphy_stickies ) {
$pixgraphy_args = array( 'ignore_sticky_posts' => 1, 'post__not_in' => $pixgraphy_stickies );
query_posts( array_merge($wp_query->query, $pixgraphy_args) );
}
if( have_posts() ) {
while(have_posts() ) {
the_post();
get_template_part( 'content');
}
} ?>
</section>
<?php get_template_part( 'pagination', 'none' ); ?>
<!-- end #post_masonry -->
<?php }
get_footer();