-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
99 lines (81 loc) · 2.69 KB
/
single.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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ): ?>
<div class="" style="height: 450px; background-image: url(<?php echo get_the_post_thumbnail_url(); ?>); background-size: cover; background-position: center;"></div>
<?php endif; ?>
<div class="container mt-5 pb-5">
<div class="row">
<div class="col text-dark">
verfasst, am
<?php the_date() ?>
von
<?php the_author_meta('display_name') ?>
</div>
</div>
<div class="row">
<div class="col wp-post">
<h1><?php the_title() ?></h1>
<p>
<?php the_content(); ?>
</p>
</div>
</div>
<div class="row mt-5 border border-bottom-0 bg-white">
<div class="col-1 p-3 ms-author-avatar">
<?php echo get_avatar(get_the_author_meta('ID'), 512) ?>
</div>
<div class="col p-3 text-dark">
<h5 class="text-uppercase" style="font-size: 16px;">Über den Autor</h5>
<h4 class=""><?php the_author_meta('display_name') ?></h4>
</div>
</div>
<div class="row border border-top-0 bg-white">
<div class="col-1 p-0 ms-author-avatar"></div>
<div class="col p-3 text-dark">
<p><?php the_author_meta('description') ?></p>
</div>
</div>
</div>
<?php
$description = get_the_excerpt();
$description = str_replace('"', '\'', $description);
$description = str_replace('\r', ' ', $description);
$description = str_replace('\n', ' ', $description);
$description = trim($description);
$ldData = (object) array(
"description" => $description
);
?>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://google.com/article"
},
"headline": "<?php the_title() ?>",
<?php if ( has_post_thumbnail() ): ?>
"image": [
"<?php echo get_the_post_thumbnail_url(); ?>"
],
<?php endif; ?>
"datePublished": "<?php echo get_the_date("Y-m-dTH:i:00+02:00", $post); ?>",
"dateModified": "<?php echo get_the_date("Y-m-dTH:i:00+02:00", $post); ?>",
"author": {
"@type": "Person",
"name": "<?php the_author_meta('display_name') ?>"
},
"publisher": {
"@type": "Organization",
"name": "Maker Space Experimenta",
"logo": {
"@type": "ImageObject",
"url": "https://makerspace.experimenta.science/wp-content/themes/makerspace-wordpress-theme/assets/images/favicon.png"
}
},
"description": "<?php echo $ldData->description ?>"
}
</script>
<?php endwhile; ?>
<?php get_footer(); ?>