This repository has been archived by the owner on Mar 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
content-search.php
100 lines (90 loc) · 3.6 KB
/
content-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
<?php
/**
* The template part for displaying results in search pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package llorix-one-lite
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'border-bottom-hover' ); ?>>
<header class="entry-header">
<div class="post-img-wrap">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
?>
<?php
$image_id = get_post_thumbnail_id();
$image_url_big = wp_get_attachment_image_src( $image_id, 'llorix-one-lite-post-thumbnail-big', true );
$image_url_mobile = wp_get_attachment_image_src( $image_id, 'llorix-one-lite-post-thumbnail-mobile', true );
?>
<picture>
<source media="(max-width: 600px)" srcset="<?php echo esc_url( $image_url_mobile[0] ); ?>">
<img src="<?php echo esc_url( $image_url_big[0] ); ?>" alt="<?php the_title_attribute(); ?>">
</picture>
<?php
} else {
?>
<picture>
<source media="(max-width: 600px)" srcset=" <?php echo llorix_one_lite_get_file( '/images/no-thumbnail-mobile.jpg' ); ?> ">
<img src="<?php echo llorix_one_lite_get_file( '/images/no-thumbnail.jpg' ); ?>" alt="<?php the_title_attribute(); ?>">
</picture>
<?php } ?>
</a>
<?php llorix_one_lite_post_date_search_box_trigger(); ?>
</div>
<?php llorix_one_lite_before_entry_meta_content_trigger(); ?>
<div class="entry-meta list-post-entry-meta">
<span class="post-author">
<i class="fa fa-user" aria-hidden="true"></i>
<?php the_author_posts_link(); ?>
</span>
<?php llorix_one_lite_after_author_in_entry_meta_trigger(); ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'llorix-one-lite' ) );
if ( ! empty( $categories_list ) ) {
?>
<span class="posted-in">
<i class="fa fa-folder-open-o" aria-hidden="true"></i>
<?php
esc_html_e( 'Posted in ', 'llorix-one-lite' );
$pos = strpos( $categories_list, ',' );
if ( $pos ) {
echo substr( $categories_list, 0, $pos );
} else {
echo $categories_list;
}
echo '</span>';
}
llorix_one_lite_after_categories_in_entry_meta_trigger();
?>
<a href="<?php comments_link(); ?>" class="post-comments">
<i class="fa fa-comment" aria-hidden="true"></i>
<?php comments_number( esc_html__( 'No comments', 'llorix-one-lite' ), esc_html__( 'One comment', 'llorix-one-lite' ), esc_html__( '% comments', 'llorix-one-lite' ) ); ?>
</a>
</div><!-- .entry-meta -->
<?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>', apply_filters( 'llorix_one_lite_filter_article_title_on_search', true ) ); ?>
<div class="colored-line-left"></div>
<div class="clearfix"></div>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
$ismore = strpos( $post->post_content, '<!--more-->' );
if ( $ismore ) {
the_content( /* translators: %s is the post title */
sprintf( esc_html__( 'Read more %s ...', 'llorix-one-lite' ), '<span class="screen-reader-text">' . esc_html__( 'about ', 'llorix-one-lite' ) . get_the_title() . '</span>' )
);
} else {
the_excerpt();
}
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'llorix-one-lite' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
</article><!-- #post-## -->