This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format-image.php
61 lines (55 loc) · 1.65 KB
/
format-image.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
<?php
/**
* Featured Image Post Format
*
* Output the featured image large at the top of the post
*
* @package Mayflower
*/
// Load Mayflower options into array.
$mayflower_options = mayflower_get_options();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
<h2 <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h2>
<?php
// Check if post date or author should be displayed.
if ( $mayflower_options['display_post_author'] || $mayflower_options['display_post_date'] ) :
?>
<p class="entry-date">
<?php
// Check if post date should be displayed.
if ( $mayflower_options['display_post_date'] ) :
?>
<?php
esc_attr_e( 'Date posted: ', 'mayflower' );
echo get_the_date();
?>
<?php
endif;
// Check if post author should be displayed.
if ( $mayflower_options['display_post_author'] ) :
?>
<span class="pull-right"><?php esc_attr_e( 'Author: ', 'mayflower' ); ?><?php the_author(); ?></span>
<?php endif; ?>
</p>
<?php endif; ?>
<?php
if ( has_post_thumbnail() ) :
$tn_id = get_post_thumbnail_id( $post->ID );
$img = wp_get_attachment_image_src( $tn_id, 'large' );
$width = $img[1];
?>
<div class="wp-block-image">
<figure class="aligncenter">
<?php the_post_thumbnail( 'large' ); ?>
<?php if ( get_post( get_post_thumbnail_id() )->post_excerpt ) : ?>
<figcaption class="featured-caption wp-caption-text"><?php echo wp_kses_post( get_post( get_post_thumbnail_id() )->post_excerpt ); ?></figcaption>
<?php endif; ?>
</figure><!-- wp-caption -->
</div>
<?php endif; ?>
<?php the_excerpt(); ?>
</article>
<hr>