-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-pdf.php
160 lines (132 loc) · 5.95 KB
/
index-pdf.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/**
* Filename: index-pdf.php
* Project: WordPress PDF Templates
* Copyright: (c) 2014-2016 Antti Kuosmanen
* License: GPLv3
*
* Copy this file to your theme directory to start customising the PDF template.
*/
//$logo = '../../../wp-content/uploads/2017/06/logo.jpg';
//$logo = 'logo.jpg';
$logo = 'wp-content/uploads/2017/06/logo.jpg';
$gallery = get_field('image_gallery');
$term = array_shift(get_the_terms($post->ID, 'project_category'));
?>
<!DOCTYPE html>
<html>
<head>
<title><?php wp_title(); ?></title>
<?php wp_head(); ?>
<style>
@font-face {
font-family: 'Lato';
src: url('<?php echo get_site_url(); ?>/wp-content/uploads/dompdf-fonts/lato/Lato-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Lato';
src: url('<?php echo get_site_url(); ?>/wp-content/uploads/dompdf-fonts/lato/Lato-Heavy.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Lato Heavy';
src: url('<?php echo get_site_url(); ?>/wp-content/uploads/dompdf-fonts/lato/Lato-Heavy.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Lato Light';
src: url('<?php echo get_site_url(); ?>/wp-content/uploads/dompdf-fonts/lato/Lato-Light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@page{ margin: 0; }
body { font-family: 'Lato'; font-size: 10px; padding: 110px 0;}
.fh { position: fixed; width: 100%; height: 100px; background-color: #e2e4e2; }
.header { top: 0; width: 600px; }
.header-inner { padding: 20px;}
.footer { bottom: 0; width: 600px; }
.footer-inner { font-size: 10px; padding: 20px; }
.header svg { width: 200px; height: 30px; fill: #fff; }
.header svg path { fill: #FFFFFF; }
.title { font-family: 'Lato Heavy'; font-size: 25px; line-height: 18px; margin-top: 5px; }
.subtitle { font-family: 'Lato Light'; font-size: 12px; }
.logo { position: absolute; top: 0; right: -200px; width: 200px; height:100px; background: #282b28 url('<?php echo $logo; ?>') center center no-repeat; }
.container { padding: 0 20px; }
.post-content { float: left; width: 380px; margin-left: 20px; }
.header h1 { margin-left: 20px; font-family: 'Lato'; }
.footer-inner > div { margin-top: 5px; }
.thumbnail { clear: right; float: right; width: 350px; margin-right: 20px; margin-top: 10px; }
.thumbnail img { width: 100%; height: auto; }
.gallery-row { height: 180px; }
.item { float: left; margin-top: 5px; }
/* .item img { width: 100%; height: 100%; } */
.odd-1 { width: 232px; }
.odd-2 { width: 113px; margin-left: 237px; }
.odd-3 { margin-top: 95px; width: 113px; height: 70px; margin-left: 237px; }
.even-1 { width: 232px; margin-left: 118px; }
.even-2 { width: 113px; }
.even-3 { margin-top: 95px; width: 113px; height: 70px; }
.st0 { fill: #FFFFFF; }
</style>
</head>
<body>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="fh header">
<div class="logo">
</div>
<div class="header-inner">
<div class="subtitle"><?php echo strtoupper('Projects / ' . $term->name); ?></div>
<div class="title"><?php echo strtoupper(get_the_title()); ?></div>
</div>
</div>
<div class="fh footer">
<div class="logo"></div>
<div class="footer-inner">
<div itemscope="" itemprop="address" itemtype="http://schema.org/PostalAddress">
<b><span itemprop="addressLocality">KILDARE</span></b> -
<span itemprop="streetAddress"><?php echo ot_get_option( 'address_kildare' ); ?></span> |
<span itemprop="postalCode"><?php echo ot_get_option( 'eircode_kildare' ); ?></span>
<span itemprop="telephone"><?php echo ot_get_option( 'phone_no_kildare' ); ?></span> |
<a href='mailto:<?php echo ot_get_option( 'email_kildare' ); ?>' itemprop="email"><?php echo ot_get_option( 'email_kildare' ); ?></a>
</div>
<div itemscope="" itemprop="address" itemtype="http://schema.org/PostalAddress">
<b><span itemprop="addressLocality">CORK</span></b> -
<span itemprop="streetAddress"><?php echo ot_get_option( 'address_cork' ); ?></span> |
<span itemprop="postalCode"><?php echo ot_get_option( 'eircode_cork' ); ?></span>
<span itemprop="telephone"><?php echo ot_get_option( 'phone_no_cork' ); ?></span> |
<a href='mailto:<?php echo ot_get_option( 'email_cork' ); ?>' itemprop="email"><?php echo ot_get_option( 'email_cork' ); ?></a>
</div>
<div itemscope="" itemprop="address" itemtype="http://schema.org/PostalAddress">
<b><span itemprop="addressLocality">KERRY</span></b> -
<span itemprop="streetAddress"><?php echo ot_get_option( 'address_kerry' ); ?></span> |
<span itemprop="postalCode"><?php echo ot_get_option( 'eircode_kerry' ); ?></span>
<span itemprop="telephone"><?php echo ot_get_option( 'phone_no_kerry' ); ?></span> |
<a href='mailto:<?php echo ot_get_option( 'email_kerry' ); ?>' itemprop="email"><?php echo ot_get_option( 'email_kerry' ); ?></a>
</div>
</div>
</div>
<div class="thumbnail">
<?php the_post_thumbnail(); ?>
<div class="gallery-row">
<?php $evenodd = 'odd'; $idx=0; foreach($gallery as $obj) : ?>
<?php if($idx < 9) : ?>
<?php if ($idx && $idx % 3 == 0): $evenodd = $evenodd == 'odd' ? 'even' : 'odd'; ?>
</div><div class="gallery-row">
<?php endif; ?>
<div class="item <?php echo $evenodd . '-' . ($idx%3 + 1); ?>">
<img src="<?php echo array_shift( wp_get_attachment_image_src($obj['id'], 'arkil-object-list-pdf') ); ?>" />
</div>
<?php endif; ?>
<?php $idx++; endforeach; ?>
</div>
</div>
<div class="post-content">
<?php the_content(); ?>
</div>
<?php endwhile; endif; ?>
</body>
</html>