-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontent-page.php
More file actions
86 lines (74 loc) · 2.81 KB
/
content-page.php
File metadata and controls
86 lines (74 loc) · 2.81 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
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
<?php
/**
* The default template for displaying content
*
* Used for pages.
*
* @author Kim-Christian Meyer <kim.meyer@palasthotel.de>
* @package digitale-pracht
*/
$article_classes = array( 'ph-article' );
$title = get_the_title();
$thumbnail_id = get_post_thumbnail_id();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $article_classes ); ?>>
<header class="entry-header ph-article-header">
<h1 class="entry-title ph-article-title"><?php the_title(); ?></h1>
<div class="ph-article-date-author">
<?php edit_post_link( __( 'Edit article', 'digitale-pracht' ), '<span class="edit-link">', '</span>' ); ?>
</div>
</header><!-- .entry-header -->
<?php
if ( has_post_thumbnail() ):
// Link to large thumbnail image, not original
$large_image_url = wp_get_attachment_image_src( $thumbnail_id, 'large' );
$large_image_attachment = get_post( $thumbnail_id );
$large_image_title = '';
$large_image_caption = '';
if ( ! empty( $large_image_attachment ) ) {
$large_image_title = $large_image_attachment->post_title;
$large_image_caption = $large_image_attachment->post_excerpt;
}
?>
<div class="entry-thumbnail ph-article-image-wrapper ph-article-featured-image">
<?php if ( ! empty( $large_image_url ) ) : ?>
<a class="ph-article-image-link" href="<?php echo esc_attr( $large_image_url[0] ); ?>" title="<?php echo esc_attr( $large_image_title ); ?>">
<?php echo wp_get_attachment_image( $thumbnail_id, 'digitalepracht-featured-image', 0, array( 'class' => 'ph-article-image' ) ); ?>
</a>
<?php endif; ?>
<?php if ( ! empty( $large_image_caption ) ): ?>
<p class="ph-article-image-caption entry-thumbnail"><?php echo $large_image_caption; ?></p>
<?php endif; ?>
</div><!-- end .entry-thumbnail -->
<?php endif; ?>
<div class="entry-content ph-article-text">
<?php
// Check for the more tag and wrap html before more tag inside wrapper
if ( mb_strpos( get_the_content(), '<span id="more-' ) ) : ?>
<div class="ph-article-text-lead">
<?php global $more;
$more = 0;
the_content( '', true );
$more = 1; ?>
</div>
<div class="ph-article-text-body">
<?php the_content( '', true ); ?>
</div>
<?php else: ?>
<div class="ph-article-text-body">
<?php the_content(); ?>
</div>
<?php
endif;
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'digitale-pracht' ) . '</span>',
'after' => '</div>',
'link_before' => '<span class="page-links-item">',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'digitale-pracht' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
) );
?>
</div><!-- .entry-content -->
<?php comments_template(); ?>
</article><!-- #post-## -->