forked from cohhe/shopera
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent-featured-side-post.php
More file actions
executable file
·46 lines (45 loc) · 1.52 KB
/
content-featured-side-post.php
File metadata and controls
executable file
·46 lines (45 loc) · 1.52 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
<?php
/**
* The template for displaying featured posts on the front page
*
* @package WordPress
* @subpackage Shopera
* @since Shopera 1.0
*/
?>
<div id="post-<?php the_ID(); ?>" <?php post_class('swiper-slide side'); ?>>
<div class="slide-inner">
<?php
// Output the featured image.
if ( has_post_thumbnail() ) :
if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) { ?>
<a class="post-thumbnail" href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
<?php
} else {
$slide_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'shopera-post-picture' ); ?>
<div class="slide-image" style="background-image:url('<?php echo esc_url( $slide_image_url[0] ); ?>');"></div>
<?php
}
endif;
?>
<div class="slider-text-content">
<header class="entry-header">
<?php
$external_url = get_post_meta(get_the_ID(), 'shopera_external_url', true);
if ( !$external_url ) {
$post_link = get_permalink();
} else {
$post_link = $external_url;
}
?>
<?php the_title( '<h1 class="entry-title"><a href="' . esc_url( $post_link ) . '" rel="bookmark">','</a></h1>' ); ?>
<div class="clearfix"></div>
</header><!-- .entry-header -->
<div class="slider-content">
<?php the_excerpt(); ?>
<div class="clearfix"></div>
</div>
</div>
<!-- <a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark" class="featured-side"></a> -->
</div>
</div><!-- #post-## -->