PluginProbe
Powerkit – Supercharge your WordPress Site / 2.4.4
Powerkit – Supercharge your WordPress Site v2.4.4
3.1.1 3.1.0 3.0.9 3.0.8 trunk 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 All 87 releases
powerkit / modules / posts / public / posts-template.php

posts-template.php in Powerkit – Supercharge your WordPress Site 2.4.4, at modules/posts/public/posts-template.php

65 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Posts Template
4 *
5 * @link https://codesupply.co
6 * @since 1.0.0
7 *
8 * @package PowerKit
9 * @subpackage PowerKit/templates
10 */
11
12 /**
13 * Default Template
14 *
15 * @param array $posts Array of posts.
16 * @param array $params Array of params.
17 * @param array $instance Widget instance.
18 */
19 function powerkit_widget_featured_posts_template( $posts, $params, $instance ) {
20 ?>
21 <article <?php post_class(); ?>>
22 <div class="pk-post-outer">
23 <?php
24 $thumbnail_size = ( 'large' === $params['template'] ) ? 'pk-thumbnail' : 'pk-small';
25
26 $thumbnail_size = apply_filters( 'powerkit_widget_featured_posts_size', $thumbnail_size, $params, $instance );
27 ?>
28 <?php if ( has_post_thumbnail() ) { ?>
29 <div class="pk-post-inner pk-post-thumbnail">
30 <a href="<?php the_permalink(); ?>" class="post-thumbnail">
31 <?php the_post_thumbnail( $thumbnail_size ); ?>
32
33 <?php if ( 'numbered' === $params['template'] ) : ?>
34 <span class="pk-post-number pk-bg-primary">
35 <?php echo esc_html( $posts->current_post + 1 ); ?>
36 </span>
37 <?php endif; ?>
38 </a>
39 </div>
40 <?php } ?>
41
42 <div class="pk-post-inner pk-post-data">
43 <?php
44 powerkit_get_post_meta( 'category', (bool) $params['post_meta_compact'], true, $params['post_meta'] );
45 ?>
46
47 <?php
48 $tag = ( 'large' === $params['template'] ) ? 'h5' : 'h6';
49
50 $tag = apply_filters( 'powerkit_widget_featured_posts_title_tag', $tag, $params, $instance );
51 ?>
52
53 <<?php echo esc_html( $tag ); ?> class="entry-title">
54 <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
55 </<?php echo esc_html( $tag ); ?>>
56
57 <?php
58 powerkit_get_post_meta( powerkit_allowed_post_meta( true, 'category' ), (bool) $params['post_meta_compact'], true, $params['post_meta'] );
59 ?>
60 </div>
61 </div>
62 </article>
63 <?php
64 }
65