-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
132 lines (100 loc) · 4.55 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
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
<?php /*
Template Name: Single
*/
?>
<?php get_header(); ?>
<?php get_template_part('partials/social-meta'); ?>
<main>
<?php
$next_post = get_field('next_post');
?>
<article itemscope itemType="http://schema.org/BlogPosting">
<meta itemprop="inLanguage" content="en-US"/>
<?php get_template_part('partials/social-meta'); ?>
<header id="header-section" class="header-single" itemprop="headline">
<div class="article-header-content">
<h1 class="title"><?php the_field('sub_title'); ?><?php echo get_the_title(); ?></h1>
<div class="svg-wrapper"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="45.945 488.513 1310.813 245.271" enable-background="new 45.945 488.513 1310.813 245.271" xml:space="preserve"><path d="M918.919 652.703c-2.702 0-5.405 0-8.108-2.703L700 520.271L489.189 650c-5.405 2.703-10.812 2.703-13.515 0 L270.271 520.271L62.162 650l-16.216-24.324l216.216-132.433c5.405-2.702 10.811-2.702 13.5 0l208.108 127.026l210.811-129.729 c5.405-2.703 10.812-2.703 13.5 0L918.92 622.972l208.108-129.729c5.404-2.702 10.811-2.702 13.5 0l216.216 135.1 L1343.243 650l-208.108-129.729L927.027 650C924.324 650 921.6 652.7 918.9 652.703z" class="svg-fill"/> <path d="M918.919 733.784c-2.702 0-5.405 0-8.108-2.703L700 601.351L489.189 731.1 c-5.405 2.703-10.812 2.703-13.515 0L270.271 601.351L59.459 731.081l-13.514-24.324l216.216-132.433 c5.405-2.702 10.811-2.702 13.5 0L481.08 704.052l210.811-129.729c5.405-2.702 10.812-2.702 13.5 0l210.811 129.7 l208.108-129.729c5.404-2.702 10.811-2.702 13.5 0l216.216 135.135l-13.513 21.622l-205.406-129.729L927.027 731.1 C924.324 731.1 921.6 733.8 918.9 733.784z" class="svg-fill"/></svg></div>
<h2 class="tags">
<ul>
<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) {
echo '<li><a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a></li>';
}
?>
<?php
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
$link = get_tag_link($tag->term_id);
$name = $tag->name . ' ';
echo '<li><a href="' . $link . '">' . $name . '</a></li>';
}
}
?>
</ul>
</h2>
</div>
</header>
<?php while( have_posts()): the_post(); ?>
<div class="content-wrapper">
<section itemprop="articleBody">
<?php $zl_date = get_the_date( 'd M Y' );?>
<div class="inline-grid meta-header">
<div class="col-6 date-wrapper">
<time class="date" pubdate datetime="<?php echo $zl_date; ?>"><?php echo $zl_date; ?></time>
</div>
<div class="col-6 share-img-wrapper">
<div class="share-img">
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<h3>Share:</h3>
<?php
$image_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'sm_img' );
?>
<!-- <img <?php echo responsive_image($image_id,'md_img','(min-width: 768px) 8em, 6em'); ?> alt="<?php echo get_the_title(); ?>" rel="share"> -->
<img src="<?php echo $image[0]; ?>" alt="<?php echo wp_strip_all_tags(get_the_title())?>" rel="share">
<?php endif; ?>
</div>
</div>
</div>
<div id="article_body">
<?php if(get_field('iframe_url')): ?>
<div class="iframe-loader">
<div class="loader">
<p>Loading</p>
<span class="loading dots" aria-hidden="true" aria-label="Loading…"></span>
<a href="https://twitter.com/LearnRubyio" target="_blank">@LearnRubyio</a>
</div>
<iframe id="quiz" style="border: 0;" src="<?php the_field('iframe_url'); ?>" height="410" width="100%"></iframe>
</div>
<?php endif; ?>
<?php if(get_field('intro')): ?>
<p><?php the_field('intro'); ?></p>
<?php endif; ?>
<?php if($next_post): ?>
<h4>Next Tutorial:</h4>
<a href="<?php the_permalink($next_post); ?>" class="next">
<span class="next__title"><?php echo get_the_title($next_post); ?></span>
<span class="next__link">Continue <span class="heart" aria-hidden="true"></span></span>
</a>
<hr>
<?php endif; ?>
<?php the_content();?>
</div>
</section>
<section id="comments">
<hr/>
<h3>Comments:</h3>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
</section>
</div>
</article>
<?php endwhile; ?>
</main>
<?php get_footer();?>