forked from Codeinwp/Parallax-One
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.php
114 lines (105 loc) · 4.54 KB
/
content.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
<?php
/**
* The default template for displaying content.
*
* @package parallax-one
*/
?>
<?php /* translators: %s is post name */ ?>
<article itemscope itemprop="blogPosts" itemtype="http://schema.org/BlogPosting" itemtype="http://schema.org/BlogPosting" <?php post_class( 'border-bottom-hover blog-post-wrap' ); ?> title="<?php printf( esc_html__( 'Blog post: %s', 'parallax-one' ), get_the_title() )?>">
<?php parallax_hook_entry_top(); ?>
<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,'parallax-one-post-thumbnail-big', true );
$image_url_mobile = wp_get_attachment_image_src( $image_id,'parallax-one-post-thumbnail-mobile', true );
?>
<picture itemscope itemprop="image">
<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 itemscope itemprop="image">
<source media="(max-width: 600px)" srcset="<?php echo parallax_get_file( '/images/no-thumbnail-mobile.jpg' );?> ">
<img src="<?php echo parallax_get_file( '/images/no-thumbnail.jpg' ); ?>" alt="<?php the_title_attribute(); ?>">
</picture>
<?php } ?>
</a>
<div class="post-date entry-published updated">
<span class="post-date-day"><?php the_time( 'd' ); ?></span>
<span class="post-date-month"><?php the_time( 'M' ); ?></span>
</div>
<?php
if ( function_exists( 'cwppos_calc_overall_rating' ) ) {
$review_score = cwppos_calc_overall_rating( get_the_ID() );
if ( ! empty( $review_score['overall'] ) ) {
$review_score = $review_score['overall'];
if ( ! empty( $review_score ) ) {
echo '<div class="wppr-rating-wrap">';
echo '<div class="wppr-rating-wrap-text">' . esc_html__( 'Rating', 'parallax-one' ) . '</div>';
echo '<div class="wppr-rating-wrap-score">' . ( floor( $review_score ) / 10 ) . '</div>';
echo '</div>';
}
}
}
?>
</div>
<div class="entry-meta list-post-entry-meta">
<span itemscope itemprop="author" itemtype="http://schema.org/Person" class="entry-author post-author">
<span itemprop="name" class="entry-author author vcard">
<i class="icon-man-people-streamline-user"></i><a itemprop="url" class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author"><?php the_author(); ?> </a>
</span>
</span>
<span class="posted-in entry-terms-categories" itemprop="articleSection">
<i class="icon-basic-elaboration-folder-check"></i>Posted in
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'parallax-one' ) );
$pos = strpos( $categories_list, ',' );
if ( $pos ) {
echo substr( $categories_list, 0, $pos );
} else {
echo $categories_list;
}
?>
</span>
<a href="<?php comments_link(); ?>" class="post-comments">
<i class="icon-comment-alt"></i><?php comments_number( esc_html__( 'No comments','parallax-one' ), esc_html__( 'One comment','parallax-one' ), esc_html__( '% comments','parallax-one' ) ); ?>
</a>
</div><!-- .entry-meta -->
<?php the_title( sprintf( '<h2 class="entry-title" itemprop="headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<div class="colored-line-left"></div>
<div class="clearfix"></div>
</header><!-- .entry-header -->
<div itemprop="description" class="entry-content entry-summary">
<?php
$ismore = strpos( $post->post_content, '<!--more-->' );
if ( $ismore ) :
the_content(
/* translators: %s is post name in text reader */
sprintf( esc_html__( 'Read more %s ...','parallax-one' ),
/* translators: %s is post title */
sprintf( '<span class="screen-reader-text"> %s </span>',
esc_html__( 'about ', 'parallax-one' ) . get_the_title()
)
)
);
else : the_excerpt();
endif;
?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'parallax-one' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<?php parallax_hook_entry_bottom(); ?>
</article><!-- #post-## -->