PluginProbe
Powerkit – Supercharge your WordPress Site / 3.1.1
Powerkit – Supercharge your WordPress Site v3.1.1
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 3.1.1, at modules/posts/public/posts-template.php

70 lines 1.9 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 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 /**
18 * Default Template
19 *
20 * @param array $posts Array of posts.
21 * @param array $params Array of params.
22 * @param array $instance Widget instance.
23 */
24 function powerkit_widget_featured_posts_template( $posts, $params, $instance ) {
25 ?>
26 <article <?php post_class(); ?>>
27 <div class="pk-post-outer">
28 <?php
29 $thumbnail_size = ( 'large' === $params['template'] ) ? 'pk-thumbnail' : 'pk-small';
30
31 $thumbnail_size = apply_filters( 'powerkit_widget_featured_posts_size', $thumbnail_size, $params, $instance );
32 ?>
33 <?php if ( has_post_thumbnail() ) { ?>
34 <div class="pk-post-inner pk-post-thumbnail">
35 <a href="<?php the_permalink(); ?>" class="post-thumbnail">
36 <?php the_post_thumbnail( $thumbnail_size ); ?>
37
38 <?php if ( 'numbered' === $params['template'] ) : ?>
39 <span class="pk-post-number pk-bg-primary">
40 <?php echo esc_html( $posts->current_post + 1 ); ?>
41 </span>
42 <?php endif; ?>
43 </a>
44 </div>
45 <?php } ?>
46
47 <div class="pk-post-inner pk-post-data">
48 <?php
49 powerkit_get_post_meta( 'category', (bool) $params['post_meta_compact'], true, $params['post_meta'] );
50 ?>
51
52 <?php
53 $tag = ( 'large' === $params['template'] ) ? 'h5' : 'h6';
54
55 $tag = apply_filters( 'powerkit_widget_featured_posts_title_tag', $tag, $params, $instance );
56 ?>
57
58 <<?php echo esc_html( $tag ); ?> class="entry-title">
59 <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
60 </<?php echo esc_html( $tag ); ?>>
61
62 <?php
63 powerkit_get_post_meta( powerkit_allowed_post_meta( true, 'category' ), (bool) $params['post_meta_compact'], true, $params['post_meta'] );
64 ?>
65 </div>
66 </div>
67 </article>
68 <?php
69 }
70