-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
137 lines (115 loc) · 6.09 KB
/
single.php
File metadata and controls
137 lines (115 loc) · 6.09 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* Single Blog Post Template
*/
get_header(); ?>
<?php if (function_exists('elementor_theme_do_location') && elementor_theme_do_location('single')) : ?>
<?php elementor_theme_do_location('single'); ?>
<?php else : ?>
<?php while (have_posts()) : the_post(); ?>
<article class="single-post">
<!-- Hero Section -->
<section class="post-hero" style="padding: 80px 0; background: var(--card);">
<div class="container">
<div class="text-center" style="max-width: 800px; margin: 0 auto;">
<div class="post-meta" style="margin-bottom: 1.5rem;">
<span style="color: var(--primary); font-weight: 600;"><?php echo get_the_date('M j, Y'); ?></span>
<span style="color: var(--muted-foreground); margin: 0 1rem;">•</span>
<span style="color: var(--muted-foreground);"><?php echo get_the_author(); ?></span>
<?php if (get_the_category()) : ?>
<span style="color: var(--muted-foreground); margin: 0 1rem;">•</span>
<span style="color: var(--primary);"><?php echo get_the_category()[0]->name; ?></span>
<?php endif; ?>
</div>
<h1 class="post-title" style="font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1.5rem; line-height: 1.2;">
<?php the_title(); ?>
</h1>
<?php if (has_excerpt()) : ?>
<p class="post-excerpt" style="font-size: 1.25rem; color: var(--muted-foreground); line-height: 1.6;">
<?php the_excerpt(); ?>
</p>
<?php endif; ?>
</div>
</div>
</section>
<!-- Featured Image -->
<?php if (has_post_thumbnail()) : ?>
<section class="post-featured-image" style="padding: 0;">
<div class="container">
<div style="max-width: 1000px; margin: 0 auto;">
<?php the_post_thumbnail('large', array('style' => 'width: 100%; height: 400px; object-fit: cover; border-radius: 1rem;')); ?>
</div>
</div>
</section>
<?php endif; ?>
<!-- Content Section -->
<section class="post-content" style="padding: 80px 0;">
<div class="container">
<div class="content-wrapper" style="max-width: 800px; margin: 0 auto;">
<div class="post-body" style="line-height: 1.8; font-size: 1.125rem;">
<?php the_content(); ?>
</div>
<!-- Tags -->
<?php if (has_tag()) : ?>
<div class="post-tags" style="margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);">
<h4 style="margin-bottom: 1rem; color: var(--foreground);">Tags:</h4>
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap;">
<?php foreach (get_the_tags() as $tag) : ?>
<span style="background: var(--muted); color: var(--muted-foreground); padding: 0.25rem 0.75rem; border-radius: 1rem; font-size: 0.875rem;">
<?php echo $tag->name; ?>
</span>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</section>
<!-- Related Posts -->
<section class="related-posts" style="padding: 80px 0; background: var(--card);">
<div class="container">
<div class="text-center" style="margin-bottom: 3rem;">
<h2>Related Articles</h2>
</div>
<div class="grid grid-cols-3" style="gap: 2rem;">
<?php
$related_posts = get_posts(array(
'numberposts' => 3,
'post__not_in' => array(get_the_ID()),
'category__in' => wp_get_post_categories(get_the_ID()),
'orderby' => 'rand'
));
foreach ($related_posts as $related_post) : setup_postdata($related_post); ?>
<article class="related-post-card">
<a href="<?php echo get_permalink($related_post->ID); ?>" style="text-decoration: none; color: inherit;">
<?php if (has_post_thumbnail($related_post->ID)) : ?>
<div style="margin-bottom: 1rem;">
<?php echo get_the_post_thumbnail($related_post->ID, 'medium', array('style' => 'width: 100%; height: 200px; object-fit: cover; border-radius: 0.5rem;')); ?>
</div>
<?php endif; ?>
<h3 style="margin-bottom: 0.5rem; font-size: 1.25rem;"><?php echo get_the_title($related_post->ID); ?></h3>
<p style="color: var(--muted-foreground); font-size: 0.875rem; margin-bottom: 0.5rem;"><?php echo get_the_date('M j, Y', $related_post->ID); ?></p>
<p style="color: var(--muted-foreground);"><?php echo wp_trim_words(get_the_excerpt($related_post->ID), 20); ?></p>
</a>
</article>
<?php endforeach;
wp_reset_postdata(); ?>
</div>
</div>
</section>
<!-- CTA Section -->
<section class="post-cta" style="padding: 80px 0; background: var(--primary); text-align: center;">
<div class="container">
<h2 style="color: white; margin-bottom: 1rem;">Need DevOps Expertise?</h2>
<p style="color: rgba(255,255,255,0.9); font-size: 1.25rem; margin-bottom: 2rem;">
Let's discuss how we can help optimize your infrastructure.
</p>
<a href="/contact" class="btn" style="background: white; color: var(--primary); padding: 1rem 2rem; border-radius: 0.5rem; text-decoration: none; font-weight: 600;">
Get In Touch
</a>
</div>
</section>
</article>
<?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>