Completed
Push — master ( d71a73...8db731 )
by Md. Mozahidur
03:18
created
includes/shortcodes.php 2 patches
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -4,19 +4,19 @@  discard block
 block discarded – undo
4 4
 /**
5 5
  * Shortcode: Announcement Slider
6 6
  */
7
-function announcement_slider($atts, $content = null){
7
+function announcement_slider($atts, $content = null) {
8 8
 
9 9
 	ob_start();
10 10
 
11 11
 	echo '<div class="messages"> <div id="announcement_slider" class="owl-carousel">';
12 12
 
13
-	if( have_rows('announcement', 'option') ):
14
-		while ( have_rows('announcement', 'option') ) : the_row();
13
+	if (have_rows('announcement', 'option')):
14
+		while (have_rows('announcement', 'option')) : the_row();
15 15
 	$message = get_sub_field('messages');
16 16
 	$message_link = get_sub_field('link');
17 17
 
18 18
 	echo '<div class="col-xs-12">';
19
-	echo '<a href=" ' . $message_link .' " " title="Click to read full messages"> ' . $message .' </a>';
19
+	echo '<a href=" '.$message_link.' " " title="Click to read full messages"> '.$message.' </a>';
20 20
 	echo '</div>';
21 21
 	endwhile;
22 22
 	else :
@@ -28,21 +28,21 @@  discard block
 block discarded – undo
28 28
 	return $output;
29 29
 }
30 30
 
31
-add_shortcode('announcement','announcement_slider');
31
+add_shortcode('announcement', 'announcement_slider');
32 32
 
33 33
 
34 34
 
35 35
 /**
36 36
  * Shortcode: Recent Post Slider
37 37
  */
38
-function recent_post_slider($atts, $content = null){
38
+function recent_post_slider($atts, $content = null) {
39 39
 
40 40
 	ob_start();
41 41
 
42 42
 	echo '<div class="post-slider row"><div id="recent-posts" class="owl-carousel">';
43 43
 
44 44
 	global $post;
45
-	$post_query = new WP_Query( array(
45
+	$post_query = new WP_Query(array(
46 46
 		'post_type' => 'post',
47 47
 		'posts_per_page' => 12,
48 48
 		'order'=>'DESC',
@@ -50,21 +50,21 @@  discard block
 block discarded – undo
50 50
 		)
51 51
 	);
52 52
 
53
-	if( $post_query->have_posts() ) : while( $post_query->have_posts() ) : $post_query->the_post();
54
-	$thumb_post = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_related_post');
53
+	if ($post_query->have_posts()) : while ($post_query->have_posts()) : $post_query->the_post();
54
+	$thumb_post = wp_get_attachment_image_src(get_post_thumbnail_id(), 'lighthouse_related_post');
55 55
 	$url_post = $thumb_post[0];
56 56
 	$content = get_the_content();
57 57
 
58 58
 	echo '<div class="col-xs-12"><div class="thumbnail thumbnail-hover">';
59
-	echo '<img class="img-responsive" src=" ' . $url_post . '">';
60
-	echo '<a href=" ' . get_permalink() .' " " title=" ' .  get_the_title() .' " class="overlay"></a>';
59
+	echo '<img class="img-responsive" src=" '.$url_post.'">';
60
+	echo '<a href=" '.get_permalink().' " " title=" '.get_the_title().' " class="overlay"></a>';
61 61
 	echo '</div>';
62 62
 	echo '<div class="entry">';
63
-	echo '<h3><a href=" ' . get_permalink() . ' "> ' . get_the_title() . '</a></h3>';
64
-	echo '<span class="date"> <i class="fa fa-clock-o"></i> ' . get_the_time(get_option('date_format')) .'</span>';
65
-	echo '<div class="entry-content">' . wp_trim_words( $content , '27' ) . '</div>';
63
+	echo '<h3><a href=" '.get_permalink().' "> '.get_the_title().'</a></h3>';
64
+	echo '<span class="date"> <i class="fa fa-clock-o"></i> '.get_the_time(get_option('date_format')).'</span>';
65
+	echo '<div class="entry-content">'.wp_trim_words($content, '27').'</div>';
66 66
 	echo '<div class="read-more">';
67
-	echo '<a href="' . get_permalink() . ' " class="btn read-more-btn">View Article</a>';
67
+	echo '<a href="'.get_permalink().' " class="btn read-more-btn">View Article</a>';
68 68
 	echo '</div>';
69 69
 	echo '</div></div>';
70 70
 
@@ -78,26 +78,26 @@  discard block
 block discarded – undo
78 78
 	return $output;
79 79
 }
80 80
 
81
-add_shortcode('recent_posts','recent_post_slider');
81
+add_shortcode('recent_posts', 'recent_post_slider');
82 82
 
83 83
 
84 84
 /**
85 85
  * Shortcode: Member logo slider
86 86
  */
87
-function member_logo_slider($atts, $content = null){
87
+function member_logo_slider($atts, $content = null) {
88 88
 
89 89
 	ob_start();
90 90
 
91 91
 	echo '<div class="members-logo row"> <div id="logo-slider" class="owl-carousel">';
92 92
 
93
-	if( have_rows('members_logo', 'option') ):
94
-		while ( have_rows('members_logo', 'option') ) : the_row();
93
+	if (have_rows('members_logo', 'option')):
94
+		while (have_rows('members_logo', 'option')) : the_row();
95 95
 	$logo_url = get_sub_field('logo');
96 96
 	$company_link = get_sub_field('link');
97 97
 
98 98
 	echo '<div class="thumbnail thumbnail-hover">';
99
-	echo '<img class="img-responsive" src=" ' . $logo_url . '">';
100
-	echo '<a href=" ' . $company_link .' " " title=" ' .  $company_link .' " class="link-full"></a>';
99
+	echo '<img class="img-responsive" src=" '.$logo_url.'">';
100
+	echo '<a href=" '.$company_link.' " " title=" '.$company_link.' " class="link-full"></a>';
101 101
 	echo '</div>';
102 102
 
103 103
 	endwhile;
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
 	return $output;
111 111
 }
112 112
 
113
-add_shortcode('members_logo','member_logo_slider');
113
+add_shortcode('members_logo', 'member_logo_slider');
114 114
 
115 115
 
116 116
 /**
117 117
  * Shortcode: Share Price
118 118
  */
119
-function share_price_feed($atts, $content = null){
119
+function share_price_feed($atts, $content = null) {
120 120
 
121 121
 	ob_start();
122 122
 
@@ -127,18 +127,18 @@  discard block
 block discarded – undo
127 127
 	$xml 	= simplexml_load_file($url);
128 128
 	$price 	= $xml->CurrentPrice;
129 129
 	$change = $xml->Change;
130
-	$change_pcent 	= $xml->PercentageChange;
130
+	$change_pcent = $xml->PercentageChange;
131 131
 	$volume = $xml->Volume;
132 132
 	$Date 	= $xml->Date; 
133 133
 	$time 	= $xml->time; 
134 134
 
135 135
 	echo '<div class="share_price_feed">';
136 136
 
137
-	echo '<div class="feed_options"><div class="share_data_title">Share Price:</div><div class="share_data">' . $price . '</div></div>';
138
-	echo '<div class="feed_options"><div class="share_data_title">Change:</div><div class="share_data">' . $change . 'p</div></div>';
139
-	echo '<div class="feed_options"><div class="share_data_title">Volume:</div><div class="share_data">' . $volume . '</div></div>';
140
-	echo '<div class="feed_options"><div class="share_data_title">Date:</div><div class="share_data">' . $Date . '</div></div>';
141
-	echo '<div class="feed_options"><div class="share_data_title">Time:</div><div class="share_data">' . $time . '</div></div>';
137
+	echo '<div class="feed_options"><div class="share_data_title">Share Price:</div><div class="share_data">'.$price.'</div></div>';
138
+	echo '<div class="feed_options"><div class="share_data_title">Change:</div><div class="share_data">'.$change.'p</div></div>';
139
+	echo '<div class="feed_options"><div class="share_data_title">Volume:</div><div class="share_data">'.$volume.'</div></div>';
140
+	echo '<div class="feed_options"><div class="share_data_title">Date:</div><div class="share_data">'.$Date.'</div></div>';
141
+	echo '<div class="feed_options"><div class="share_data_title">Time:</div><div class="share_data">'.$time.'</div></div>';
142 142
 
143 143
 	echo '</div>';
144 144
 
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
 	return $output;
147 147
 }
148 148
 
149
-add_shortcode('share_price','share_price_feed');
149
+add_shortcode('share_price', 'share_price_feed');
150 150
 
151 151
 
152 152
 
153 153
 /**
154 154
  * Shortcode: RNS Feeds
155 155
  */
156
-function rns_feed_fn($atts, $content = null){
156
+function rns_feed_fn($atts, $content = null) {
157 157
 
158 158
 	ob_start();
159 159
 
@@ -176,4 +176,4 @@  discard block
 block discarded – undo
176 176
 	return $output;
177 177
 }
178 178
 
179
-add_shortcode('rns_feed','rns_feed_fn');
180 179
\ No newline at end of file
180
+add_shortcode('rns_feed', 'rns_feed_fn');
181 181
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,10 @@  discard block
 block discarded – undo
19 19
 	echo '<a href=" ' . $message_link .' " " title="Click to read full messages"> ' . $message .' </a>';
20 20
 	echo '</div>';
21 21
 	endwhile;
22
-	else :
23
-		echo '<div class="col-xs-12">No Messages to Show!</div>';
22
+	else {
23
+		:
24
+		echo '<div class="col-xs-12">No Messages to Show!</div>';
25
+	}
24 26
 	endif;
25 27
 	echo '</div></div>';
26 28
 
@@ -101,8 +103,10 @@  discard block
 block discarded – undo
101 103
 	echo '</div>';
102 104
 
103 105
 	endwhile;
104
-	else :
105
-		echo '<div class="col-xs-12">Members Logo Slider not found! <be> please add some logo in theme setting page</div>';
106
+	else {
107
+		:
108
+		echo '<div class="col-xs-12">Members Logo Slider not found! <be> please add some logo in theme setting page</div>';
109
+	}
106 110
 	endif;
107 111
 	echo '</div></div>';
108 112
 
Please login to merge, or discard this patch.