-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
executable file
·82 lines (44 loc) · 1.91 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
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package USTR
*/
get_header();
?>
<main id="primary" class="site-main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="container mb-4">
<div class="row">
<div class="col-lg-2">
</div>
<div class="col-lg-8">
<header class="text-center">
<p>Press Room link</p>
<h2><?php single_post_title(); ?></h2>
<p><?php echo get_the_date(); ?> - Categories</p>
<?php
$postTitleEncoded = urlencode(get_the_title());
$postUrlEncoded = urlencode(get_permalink());
$twitterShareUrl = "https://twitter.com/intent/tweet?url=" . $postUrlEncoded . "&text=" . $postTitleEncoded . "&via=USTR";
$facebookShareUrl = "http://www.facebook.com/sharer.php?u=" . $postUrlEncoded;
?>
<p><a href="<?php echo $facebookShareUrl; ?>" target="_blank" rel="noopener">Facebook</a> <a href="<?php echo $twitterShareUrl; ?> " target="_blank" rel="noopener">Twitter</a></p>
<!-- http://www.facebook.com/sharer.php?u=yourlink
http://twitter.com/share?text=yourtext&url=yourlink
https://plus.google.com/share?url=yourlink -->
</header>
<?php the_content(); ?>
</div>
<div class="col-lg-2">
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</main><!-- #main -->
<?php
get_sidebar();
get_footer();