-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshortcodes.php
71 lines (66 loc) · 2.72 KB
/
shortcodes.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
<?php
/*----- Shortcode ------*/
function esl_shortcode()
{
wp_enqueue_style('esl-style');
wp_enqueue_style('sliderPro-style');
wp_enqueue_script('sliderPro-js');
wp_enqueue_script('ecard-super-light-js');
wp_localize_script('ecard-super-light-js', 'esl_data', array(
'ajax_url' => admin_url('admin-ajax.php'),
));
// get images //
$options = get_option('esl_fields'); ?>
<div id="esl-wrapper">
<div class="rotator">
<div class="slider-pro" id="my-esl-slider">
<div class="sp-slides">
<?php
$i = 0;
foreach ($options['images'] as $key => $val) {
if ($val) {
$image_attributes = wp_get_attachment_image_src($options['images'][$key], array(600, 400));
$src = $image_attributes[0];
// echo '<img data-src="' . $src . '" src="' . $src . '" width="' . $width . 'px" height="' . $height . 'px" />';
echo '<!-- Slide ' . $i . ' -->
<div class="sp-slide">
<img class="sp-image" src="' . $src . '"/>
<p class="sp-layer">consectetur adipisicing elit</p>
</div>';
$i++;
}
} ?>
</div>
<div class="sp-thumbnails">
<?php
$i = 0;
foreach ($options['images'] as $key => $val) {
if ($val) {
$image_attributes = wp_get_attachment_image_src($options['images'][$key], array(600, 400));
$src = $image_attributes[0];
// echo '<img data-src="' . $src . '" src="' . $src . '" width="' . $width . 'px" height="' . $height . 'px" />';
echo '<!-- Slide ' . $i . ' thumbnail -->
<img class="sp-thumbnail" src="' . plugins_url('/public/images/loading.png', __FILE__) . '" data-src="' . $src . '"/>';
$i++;
}
} ?>
</div>
</div>
</div>
<div class="mail-form">
<form id="esl-form">
<input type="hidden" name="action" value="esL_send" />
<p><label for="fromName">Your Name:</label><input type="text" name="fromName" class="input"></p>
<p><label for="fromEmail">Your E-mail:</label><input type="text" name="fromEmail" class="input"></p>
<label for="toEmail1">To:<small>(up to 3 individuals may receive the e-card)</small></label>
<p><input type="text" name="toEmail[]" placeholder="email@domain.com" class="input"></p>
<p><input type="text" name="toEmail[]" placeholder="email@domain.com" class="input"></p>
<p><input type="text" name="toEmail[]" placeholder="email@domain.com" class="input"></p>
<?php wp_nonce_field('ecard-submit', 'ecard-super-light-save-nonce'); ?>
<p><input type="submit" value="Deliver Card" class="button" />
</form>
</div>
</div>
<?php
}
add_shortcode('esl-form', 'esl_shortcode');