PageRenderTime 71ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/themes/lifeline/framework/helpers/shortcodes.php

https://bitbucket.org/acipriani/madeinapulia.com
PHP | 2876 lines | 2546 code | 153 blank | 177 comment | 265 complexity | 834353c4d733dc37f5b571ce0c749483 MD5 | raw file
Possible License(s): GPL-3.0, MIT, BSD-3-Clause, LGPL-2.1, GPL-2.0, Apache-2.0
  1. <?php
  2. class SH_Shortcodes
  3. {
  4. protected $keys;
  5. protected $toggle_count = 0;
  6. function __construct()
  7. {
  8. $GLOBALS['sh_toggle_count'] = 0;
  9. add_action('init', array($this, 'add'));
  10. }
  11. function add()
  12. {
  13. include(SH_FRW_DIR . 'resource/shortcodes.php');
  14. $this->keys = array_keys($options);
  15. foreach ($this->keys as $k) {
  16. if (method_exists($this, $k)) add_shortcode('sh_' . $k, array($this, $k));
  17. }
  18. }
  19. function recent_news($atts, $content = null)
  20. {
  21. extract(shortcode_atts(array(
  22. 'number' => '',
  23. 'title' => __('Recent News', SH_NAME),
  24. 'category' => '',
  25. 'sort_by' => 'date',
  26. 'sorting_order' => 'DESC',
  27. 'heading_style' => 'simple',
  28. ), $atts)
  29. );
  30. $News = $Thumb = '';
  31. wp_reset_query();
  32. $args = array('post_type' => 'post', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order, 'cat' => (int)$category);
  33. //if($category != '') $args['category'] = array($category);
  34. $query = new WP_Query($args);
  35. //printr($query);
  36. $i = 1;
  37. if ($query->have_posts()): while ($query->have_posts()): $query->the_post();
  38. $Settings = get_post_meta(get_the_ID(), '_post_settings', true);
  39. if ($video_link = sh_set($Settings, 'video_link')) {
  40. $opt = get_post_meta(get_the_ID(), '_dictate_gal_videos', true);
  41. $video_data = sh_grab_video($video_link, $opt);
  42. $PostMedia = '<div class="image">
  43. <img src="' . sh_set($video_data, 'thumb') . '" style="width:261px; height:207px;" alt="' . sh_set($video_data, 'title') . '" />
  44. <a class="html5lightbox" rel="prettyPhoto" href="' . $video_link . '" title="' . sh_set($video_data, 'title') . '">
  45. <span><i class="icon-play"></i></span>
  46. </a>
  47. </div>';
  48. $CarouselThumb = '<img src="' . sh_set($video_data, 'thumb') . '" style="width:131px; height:78px;" alt="' . sh_set($video_data, 'title') . '" />';
  49. } else {
  50. $PostAttchment = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'large');
  51. $PostMedia = '<div class="image">
  52. ' . get_the_post_thumbnail(get_the_ID(), '370x252') . '
  53. <a title="" href="' . sh_set($PostAttchment, 0) . '" rel="prettyPhoto" class="html5lightbox"><i class="icon-picture"></i></a>
  54. </div>';
  55. $CarouselThumb = get_the_post_thumbnail(get_the_ID(), '270x155');
  56. }
  57. $News .= '<div id="news' . $i . '">
  58. <div class="row">
  59. <div class="col-md-6 desc">
  60. <h3><a href="' . get_permalink() . '" title="">' . sh_character_limit(35, get_the_title()) . '</a></h3>
  61. <p>' . sh_character_limit(340, get_the_content()) . '</p>
  62. </div>
  63. <div class="col-md-6">
  64. ' . $PostMedia . '
  65. </div>
  66. </div>
  67. </div>';
  68. $Thumb .= '<a href="#news' . $i . '">' . $CarouselThumb . '<span class="carusal-our-news">' . sh_character_limit(17, get_the_title()) . '</span></a>';
  69. $i++;
  70. endwhile;
  71. endif;
  72. wp_reset_query();
  73. wp_enqueue_script('carofredcsel');
  74. $output = '';
  75. $output .= '<div class="carusal-slider">
  76. <div id="carousel-wrapper">
  77. <div id="carousel">
  78. ' . $News . '
  79. </div>
  80. </div>
  81. <div id="thumbs-wrapper">
  82. <div id="thumbs">' . $Thumb . '</div>
  83. <a id="prev" href="#"><i class="icon-angle-left"></i></a> <a id="next" href="#"><i class="icon-angle-right"></i></a> </div>
  84. </div>
  85. <script>
  86. jQuery(document).ready(function($){
  87. $(\'#carousel\').carouFredSel({
  88. responsive: true,
  89. circular: false,
  90. auto: false,
  91. items: {
  92. visible: 1,
  93. width: 20,
  94. },
  95. scroll: {
  96. fx: \'directscroll\'
  97. }
  98. });
  99. $(\'#thumbs\').carouFredSel({
  100. responsive: true,
  101. circular: false,
  102. infinite: false,
  103. auto: false,
  104. prev: \'#prev\',
  105. next: \'#next\',
  106. items: {
  107. visible: {
  108. min: 1,
  109. max: 6
  110. },
  111. width: 200,
  112. height: \'80%\'
  113. }
  114. });
  115. $(\'#thumbs a\').click(function() {
  116. $(\'#carousel\').trigger(\'slideTo\', \'#\' + this.href.split(\'#\').pop() );
  117. $(\'#thumbs a\').removeClass(\'selected\');
  118. $(this).addClass(\'selected\');
  119. return false;
  120. });
  121. });
  122. </script>
  123. ';
  124. return $output;
  125. }
  126. function our_causes($atts, $content = null)
  127. {
  128. extract(shortcode_atts(array(
  129. 'number' => '',
  130. 'title' => __('Our Causes', SH_NAME),
  131. 'cat' => '',
  132. 'sort_by' => 'date',
  133. 'sorting_order' => 'ASC',
  134. 'donate_sec' => '',
  135. 'heading_style' => 'simple',
  136. ), $atts)
  137. );
  138. $paypal_res = '';
  139. $single_page = (sh_set($_SESSION, 'sh_causes_page')) ? sh_set($_SESSION, 'sh_causes_page') : false;
  140. if ($single_page == true) unset($_SESSION['sh_causes_page']);
  141. if (isset($_GET['recurring_pp_return']) && $_GET['recurring_pp_return'] == 'return') {
  142. $paypal_res = require_once(get_template_directory() . '/framework/modules/pp_recurring/review.php');
  143. }
  144. $return_url = (is_home()) ? home_url() : get_permalink();
  145. $args = array('post_type' => 'post', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  146. if ($cat != '') $args['tax_query'] = array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => (int)$cat));
  147. $Posts = query_posts($args);
  148. $chunk_num = ($donate_sec == 'true') ? 3 : 4;
  149. $col_class_outer = ($donate_sec == 'true') ? 'col-md-9' : 'col-md-12';
  150. $col_class_inner = ($donate_sec == 'true') ? 'col-md-4' : 'col-md-4';
  151. $postdate =
  152. $chunk = array_chunk($Posts, $chunk_num);
  153. $output = '';
  154. $output .= '<div class="row"><div class="' . $col_class_outer . '">';
  155. $output .= '<div class="our-causes">
  156. <ul class="slides">';
  157. foreach ($chunk as $p) {
  158. $output .= '<li><div class="row">';
  159. foreach ($p as $pos) {
  160. $output .= '<div class="' . $col_class_inner . '">
  161. <div class="causes-image">'
  162. . get_the_post_thumbnail(sh_set($pos, 'ID'), '') . '
  163. <div class="cause-heading">
  164. <h3>' . sh_excerpt(sh_set($pos, 'post_title'), 50) . '</h3>
  165. <div class="meta-news">' .mysql2date('d F Y', sh_set($pos, 'post_date')). '</div>
  166. </div>
  167. <a href="' . get_permalink(sh_set($pos, 'ID')) . '" title="' . sh_set($pos, 'post_title') . '">
  168. <div class="our-causes-hover">
  169. <h3>' . sh_excerpt(sh_set($pos, 'post_title'), 27) . '</h3>
  170. <div class="meta-news">' .mysql2date('d F Y', sh_set($pos, 'post_date')). '</div>
  171. <p>' . sh_excerpt($pos, 150) . '</p>
  172. </div>
  173. </a>
  174. </div>
  175. </div>';
  176. }
  177. $output .= '</div></li>
  178. <script>
  179. jQuery(document).ready(function($){
  180. if( $(\'.our-causes\').length ){
  181. $(\'.our-causes\').flexslider({
  182. animation: "slide",
  183. animationLoop: false,
  184. controlNav: true,
  185. maxItems: 1,
  186. pausePlay: false,
  187. mousewheel:false,
  188. start: function(slider){
  189. $(\'body\').removeClass(\'loading\');
  190. }
  191. });
  192. }
  193. });
  194. </script>
  195. ';
  196. }
  197. wp_reset_query();
  198. $paypal = $GLOBALS['_sh_base']->donation;
  199. if ($notif = $paypal->_paypal->handleNotification()) $paypal_res = $paypal->single_pament_result($notif);
  200. $output .= '</ul></div></div>';
  201. $donation_data = get_option(SH_NAME);
  202. $percent = (sh_set($donation_data, 'paypal_target')) ? (int)str_replace(',', '', sh_set($donation_data, 'paypal_raised')) / (int)str_replace(',', '', sh_set($donation_data, 'paypal_target')) : 0;
  203. $donation_percentage = $percent * 100;
  204. $symbol = (sh_set($donation_data, 'paypal_currency')) ? sh_set($donation_data, 'paypal_currency') : '$';
  205. $donation = '<div class="col-md-3">';
  206. $donation .= '<div class="donate-us-box">
  207. <h5>' . __('Give Your Donations', SH_NAME) . '</h5>
  208. <span>' . __('Donation Needed', SH_NAME) . '</span> <span class="amount-figures"><strong>' . $symbol . '</strong> ' . sh_set($donation_data, 'paypal_target') . '!</span> <span>' . __('Collected Donation', SH_NAME) . '</span> <span class="amount-figures coloured"><strong>' . $symbol . '</strong> ' . sh_set($donation_data, 'paypal_raised') . '!</span>
  209. <span class="cell"><i class="icon-phone"></i>' . sh_set($donation_data, 'paypal_contact') . '</span>';
  210. if (sh_set($donation_data, 'donate_method') == 'true') {
  211. $donation .= '<a data-toggle="modal" data-target="#myModal" class="donate-btn" title="">Donate Us</a>';
  212. } else {
  213. $donation .= $paypal->button(array('currency_code' => sh_set($donation_data, 'paypal_currency_code'), 'item_name' => get_bloginfo('name'), 'return' => $return_url));
  214. }
  215. $donation .= '</div>
  216. </div>';
  217. $output .= ($donate_sec == 'true') ? $donation : '';
  218. $output .= '<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">';
  219. if (isset($_GET['recurring_pp_return']) && $_GET['recurring_pp_return'] == 'return') {
  220. $output .= '<div class="donate-popup">' . $paypal_res . '</div>';
  221. $output .= '<script>
  222. jQuery(document).ready(function($){
  223. $(".donate-us-box a.donate-btn").trigger("click");
  224. });
  225. </script>';
  226. } elseif ($notif = $paypal->_paypal->handleNotification() && isset($notif->ok)) {
  227. $output .= '<div class="donate-popup">' . $paypal_res . '</div>';
  228. $output .= '<script>
  229. jQuery(document).ready(function($){
  230. $(".donate-us-box a.donate-btn").trigger("click");
  231. });
  232. </script>';
  233. } else {
  234. $Settings = get_option(SH_NAME);
  235. //printr($Settings);
  236. $value = sh_set($Settings, 'transactions_detail');
  237. $output .= '<div class="donate-popup">
  238. <div class="cause-bar">
  239. <div class="cause-box"><h3><span>' . $symbol . '</span>' . sh_set($donation_data, 'paypal_target') . '</h3><i>' . __('NEEDED DONATION', SH_NAME) . '</i></div>
  240. <div class="cause-progress">
  241. <div class="progress-report">
  242. <h6>' . __('PHASES', SH_NAME) . '</h6>
  243. <span>' . $donation_percentage . '%</span>
  244. <div class="progress pattern">
  245. <div class="progress-bar" style="width: ' . $donation_percentage . '%"></div>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="cause-box"><h3><span>' . $symbol . '</span>' . sh_set($donation_data, 'paypal_raised') . '</h3><i>' . __('COLLECTED DONATION', SH_NAME) . '</i></div>
  250. <div class="cause-box donate-drop-btn"><h4>' . __('DONATE NOW', SH_NAME) . '</h4></div>
  251. </div>
  252. <div class="donate-drop-down">
  253. <div class="recursive-periods" align="center">';
  254. if ($value) {
  255. foreach ($value as $val) {
  256. $output .= '<a style="cursor:pointer;">' . ucwords(str_replace('_', ' ', $val)) . '</a>';
  257. }
  258. }
  259. $output .= '</div>
  260. <div class="amount-btns">';
  261. if (intval(sh_set($Settings, 'pop_up_1st_value')) != '') $output .= '<a style="cursor:pointer;">' . $symbol . '<span>' . sh_set($Settings, 'pop_up_1st_value') . '</span></a>';
  262. if (intval(sh_set($Settings, 'pop_up_2nd_value')) != '') $output .= '<a style="cursor:pointer;">' . $symbol . '<span>' . sh_set($Settings, 'pop_up_2nd_value') . '</span></a>';
  263. if (intval(sh_set($Settings, 'pop_up_3rd_value')) != '') $output .= '<a style="cursor:pointer;">' . $symbol . '<span>' . sh_set($Settings, 'pop_up_3rd_value') . '</span></a>';
  264. if (intval(sh_set($Settings, 'pop_up_4th_value')) != '') $output .= '<a style="cursor:pointer;">' . $symbol . '<span>' . sh_set($Settings, 'pop_up_4th_value') . '</span></a>';
  265. if (intval(sh_set($Settings, 'pop_up_5th_value')) != '') $output .= '<a style="cursor:pointer;">' . $symbol . '<span>' . sh_set($Settings, 'pop_up_5th_value') . '</span></a>';
  266. $output .= '</div><div class="other-amount">
  267. ' . $paypal->button(array('item_name' => get_bloginfo('name'), 'amount' => 30, 'return' => $return_url)) . '
  268. </div>';
  269. if (!is_user_logged_in()) {
  270. $output .= '<form id="login" action="" method="post">
  271. <h1>Please Login OR Register first to make recursive donation</h1>
  272. <p class="status"></p>
  273. <label for="username">Username</label>
  274. <input id="username" type="text" name="username">
  275. <label for="password">Password</label>
  276. <input id="password" type="password" name="password">
  277. <a class="lost" href="' . wp_registration_url() . '">Register Now</a>
  278. <input class="submit_button" type="submit" value="Login" name="submit">
  279. <a class="close" href="">(close)</a>
  280. ' . wp_nonce_field('ajax-login-nonce', 'security') . '
  281. </form>';
  282. }
  283. $output .= '</div>
  284. </div>
  285. </div></div>';
  286. }
  287. return $output;
  288. }
  289. function our_causes_2($atts, $content = null)
  290. {
  291. extract(shortcode_atts(array(
  292. 'number' => '',
  293. 'title' => 'Our Causes',
  294. 'bg' => '',
  295. 'blackish' => '',
  296. 'cat' => '',
  297. 'sort_by' => 'date',
  298. 'heading_style' => 'simple',
  299. 'sorting_order' => 'ASC'), $atts)
  300. );
  301. wp_enqueue_script('layersliderscript1');
  302. wp_enqueue_script('layersliderscript2');
  303. $args = array('post_type' => 'dict_causes', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  304. if ($cat != '') $args['tax_query'] = array(array('taxonomy' => 'causes_category', 'field' => 'id', 'terms' => $cat));
  305. $black_layer = ($blackish) ? 'blackish' : '';
  306. $Posts = query_posts($args);
  307. $attach = ($bg) ? wp_get_attachment_image_src($bg, 'large') : '';
  308. $bgimg = ($attach) ? sh_set($attach, 0) : get_template_directory_uri() . '/images/moving-bg.png';
  309. $output = '';
  310. $output .= '<div class="posts-carousel">
  311. <ul class="slides">';
  312. $chunk = array_chunk($Posts, 4);
  313. foreach ($chunk as $p) {
  314. $output .= '<li><div class="row">';
  315. foreach ($p as $pos) {
  316. $Settings = get_post_meta(sh_set($pos, 'ID'), '_dict_causes_settings', true);
  317. if (sh_set($Settings, 'video_link') && sh_set($Settings, 'video_link') != '') {
  318. $video_link = sh_set($Settings, 'video_link');
  319. $video_data = sh_grab_video($video_link, $Settings);
  320. $PostMedia = '<div class="carou-post-img">
  321. <img src="' . sh_set($video_data, 'thumb') . '" style="width:277px; height:190px;" alt="' . sh_set($video_data, 'title') . '" />
  322. <a title="' . sh_set($video_data, 'title') . '" href="' . $video_link . '" class="html5lightbox"><i class="icon-play"></i></a>
  323. </div>';
  324. } else if (sh_set($Settings, 'gallery')) {
  325. $GalleryAttachments = get_posts(array('post_type' => 'attachment', 'post__in' => explode(',', sh_set($Settings, 'gallery'))));
  326. $Slides = '';
  327. foreach ($GalleryAttachments as $Attachment) {
  328. $Thumb = sh_set(wp_get_attachment_image_src($Attachment->ID, '370x252'), '0');
  329. $LargeImage = sh_set(wp_get_attachment_image_src($Attachment->ID, 'large'), '0');
  330. $Slides .= '<li data-masterspeed="500" data-slotamount="7" data-transition="curtain-1">
  331. <img data-bgrepeat="no-repeat" data-bgposition="left top" data-bgfit="cover" alt="slidebg1" src="' . $Thumb . '" draggable="false"> </li>';
  332. //$i++;
  333. }
  334. $PostMedia = '<div class="carou-post-img"><div class="tp-banner2">
  335. <ul>
  336. ' . $Slides . '
  337. </ul>
  338. </div></div>';
  339. } else {
  340. $PostAttchment = wp_get_attachment_image_src(get_post_thumbnail_id(sh_set($pos, 'ID')), 'large');
  341. $PostMedia = '<div class="carou-post-img">
  342. ' . get_the_post_thumbnail(sh_set($pos, 'ID'), '370x252') . '
  343. <a title="" href="' . sh_set($PostAttchment, 0) . '" class="html5lightbox"><i class="icon-picture"></i></a>
  344. </div>';
  345. }
  346. $output .= '<div class="col-md-3">
  347. <div class="carou-post">
  348. ' . $PostMedia . '
  349. <h4>' . substr(strip_tags(sh_set($pos, 'post_title')), 0, 30) . '</h4>
  350. <p>' . substr(strip_tags(sh_set($pos, 'post_content')), 0, 200) . '</p>
  351. <a href="' . get_permalink(sh_set($pos, 'ID')) . '" title="">' . __('Read More', SH_NAME) . '</a>
  352. </div>
  353. </div>';
  354. }
  355. $output .= '</div></li>';
  356. }
  357. $output .= ' </ul>
  358. </div>
  359. </div>
  360. <script>
  361. jQuery(document).ready(function($){
  362. if( $(".posts-carousel").length > 0 ){
  363. $(".posts-carousel").flexslider({
  364. animation: "slide",
  365. animationLoop: false,
  366. controlNav: false,
  367. maxItems: 1,
  368. pausePlay: false,
  369. mousewheel:false,
  370. start: function(slider){
  371. $("body").removeClass("loading");
  372. }
  373. });
  374. }
  375. });
  376. </script>
  377. ';
  378. wp_reset_query();
  379. return $output;
  380. }
  381. function our_causes_3($atts, $content = null)
  382. {
  383. extract(shortcode_atts(array(
  384. 'number' => '',
  385. 'title' => 'Our Causes',
  386. 'cat' => '',
  387. 'sort_by' => 'date',
  388. 'sorting_order' => 'ASC',
  389. 'heading_style' => 'simple',
  390. ), $atts)
  391. );
  392. wp_enqueue_script(array('bootstrap'));
  393. $args = array('post_type' => 'dict_causes', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  394. if ($cat != '') $args['tax_query'] = array(array('taxonomy' => 'causes_category', 'field' => 'id', 'terms' => $cat));
  395. $Posts = query_posts($args);
  396. $i = 1;
  397. $Cause = '';
  398. $PostNav = '';
  399. if (have_posts()): while (have_posts()): the_post();
  400. $PostClass = ($i == 1) ? 'tab-pane fade in active' : 'tab-pane fade';
  401. $NavClass = ($i == 1) ? 'active' : '';
  402. $Settings = get_post_meta(get_the_ID(), '_dict_causes_settings', true);
  403. $Cause .= '<div id="tab' . $i . '" class="' . $PostClass . '">
  404. <div class="cause-image">
  405. ' . get_the_post_thumbnail(get_the_ID(), '1170x312') . '
  406. <div class="meta"> <span>' . __('In', SH_NAME) . ' <i>' . sh_set($Settings, 'location') . '</i></span> </div>
  407. <div class="cause-title">
  408. <h2><a href="' . get_permalink() . '">' . sh_excerpt(get_the_title(), 100) . '</a></h2>
  409. </div>
  410. </div>
  411. <div class="details">
  412. <div class="needed-amount">
  413. <h5><i>' . sh_set($Settings, 'currency_symbol') . '</i>' . sh_set($Settings, 'donation_needed') . '<span>' . __('Donation Needed', SH_NAME) . '</span></h5>
  414. </div>
  415. <p>' . sh_excerpt(get_the_content(), 500) . '</p>
  416. </div>
  417. </div>';
  418. $PostNav[] = '<li class="col-md-4"> <a data-toggle="tab" href="#tab' . $i . '"> ' . get_the_post_thumbnail(get_the_ID(), '1170x455') . ' <span>' . sh_excerpt(get_the_title(), 35) . '</span> </a> </li>';
  419. $i++;
  420. endwhile;
  421. endif;
  422. wp_reset_query();
  423. $nav = '';
  424. if ($PostNav) {
  425. foreach (array_chunk($PostNav, 3) as $chunk) {
  426. $nav .= '<li>
  427. <ul class="nav nav-tabs cause-tabber">';
  428. if (is_array($chunk)) {
  429. foreach ($chunk as $ch) {
  430. $nav .= $ch;
  431. }
  432. }
  433. $nav .= '</ul>
  434. </li>';
  435. }
  436. }
  437. $output = '';
  438. $output .= '<div class="our-cause-sec">';
  439. $output .= '<div class="tab-content" id="myTabContent">' . $Cause . '</div>
  440. <div class="causes-carousel">
  441. <ul class="slides">
  442. ' . $nav . '
  443. </ul>
  444. </div>
  445. </div>
  446. <script>
  447. jQuery(document).ready(function($){
  448. if( $(\'.causes-carousel\').length > 0 )
  449. {
  450. $(\'.causes-carousel\').flexslider({
  451. animation: "slide",
  452. animationLoop: false,
  453. controlNav: false,
  454. pausePlay: false,
  455. mousewheel:false,
  456. start: function(slider){
  457. $(\'body\').removeClass(\'loading\');
  458. }
  459. });
  460. }
  461. });
  462. </script>
  463. ';
  464. return $output;
  465. }
  466. function our_causes_4($atts, $content = null)
  467. {
  468. extract(shortcode_atts(array(
  469. 'number' => '',
  470. 'title' => 'Our Causes',
  471. 'cat' => '',
  472. 'sort_by' => 'date',
  473. 'sorting_order' => 'ASC',
  474. 'heading_style' => 'simple',
  475. ), $atts)
  476. );
  477. $args = array('post_type' => 'dict_causes', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  478. if ($cat != '') $args['tax_query'] = array(array('taxonomy' => 'causes_category', 'field' => 'id', 'terms' => $cat));
  479. $Posts = query_posts($args);
  480. $TotalPosts = count($Posts);
  481. $PostBatch = 2;
  482. $EndingTagAppended = FALSE;
  483. $StrtingTag = '<div class="col-md-4">';
  484. $CloseTag = '</div>';
  485. $i = 1;
  486. $Cause = '';
  487. $NextBatch = TRUE;
  488. if (have_posts()): while (have_posts()): the_post();
  489. $NewSecStrtTag = ($TotalPosts < $PostBatch || $i == 1 || $EndingTagAppended === TRUE) ? $StrtingTag : '';
  490. if (!empty($NewSecStrtTag) && $NextBatch === TRUE) {
  491. $ImageSize = '370x491';
  492. $NextBatch = FALSE;
  493. $AlterStyle = TRUE;
  494. } else if (!empty($NewSecStrtTag) && $NextBatch === FALSE) {
  495. $ImageSize = '370x252';
  496. $NextBatch = TRUE;
  497. $AlterStyle = FALSE;
  498. } else if (empty($NewSecStrtTag) && $AlterStyle === TRUE) {
  499. $ImageSize = '370x252';
  500. $AlterStyle = FALSE;
  501. } else if (empty($NewSecStrtTag) && $AlterStyle === FALSE) {
  502. $ImageSize = '370x491';
  503. $AlterStyle = TRUE;
  504. }
  505. $NewSecCloseTag = ($i == $TotalPosts || ($TotalPosts < $PostBatch && $i == $TotalPosts) || ($i % $PostBatch == 0 && $i !== 1)) ? $CloseTag : '';
  506. $EndingTagAppended = ($i == $TotalPosts || ($TotalPosts < $PostBatch && $i == $TotalPosts) || ($i % $PostBatch == 0 && $i !== 1)) ? TRUE : FALSE;
  507. $Cause .= $NewSecStrtTag .
  508. '<div class="portfolio" data-cat="' . $i . '">
  509. <a href="' . get_permalink() . '">' . get_the_post_thumbnail(get_the_ID(), $ImageSize) . '</a>
  510. <div class="port-desc">
  511. <h4><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . sh_excerpt(get_the_title(), 40) . '</a></h4>
  512. <p>' . sh_excerpt(get_the_content(), 300) . '</p>
  513. </div>
  514. </div>'
  515. . $NewSecCloseTag;
  516. $i++;
  517. endwhile;
  518. endif;
  519. wp_reset_query();
  520. $output = '';
  521. $output .= '
  522. <div id="Grid">
  523. <div class="row">
  524. ' . $Cause . '
  525. </div>
  526. </div>';
  527. return $output;
  528. }
  529. function donation($atts, $content = null)
  530. {
  531. extract(shortcode_atts(array(
  532. 'title' => 'Donate Us',
  533. 'heading_style' => 'simple',
  534. ), $atts));
  535. $paypal = $GLOBALS['_sh_base']->donation;
  536. $donation_data = get_option(SH_NAME);
  537. $output = '';
  538. $output .= '<div class="pull-right">';
  539. $output .= '
  540. <div class="donate-us-box">
  541. <h5>' . __('Give Your Donations', SH_NAME) . '</h5>
  542. <span>' . __('Donation Needed', SH_NAME) . '</span> <span class="amount-figures"><strong>' . sh_set($donation_data, 'paypal_currency') . '</strong>
  543. ' . sh_set($donation_data, 'paypal_target') . '!</span> <span>' . __('Collection Donation', SH_NAME) . '</span>
  544. <span class="amount-figures coloured"><strong>' . sh_set($donation_data, 'paypal_currency') . '</strong>
  545. ' . sh_set($donation_data, 'paypal_raised') . '!</span> <span class="cell"><i class="icon-phone"></i>
  546. ' . sh_set($donation_data, 'paypal_contact') . '</span>
  547. <a data-toggle="modal" data-target="#myModal" class="donate-btn" title="">Donate Us</a>
  548. </div>
  549. </div>';
  550. return $output;
  551. }
  552. function donation_2($atts, $content = null)
  553. {
  554. extract(shortcode_atts(array(
  555. ), $atts));
  556. $paypal = $GLOBALS['_sh_base']->donation;
  557. $paypal_res = '';
  558. $single_page = (sh_set($_SESSION, 'sh_causes_page')) ? sh_set($_SESSION, 'sh_causes_page') : false;
  559. if ($single_page == true) unset($_SESSION['sh_causes_page']);
  560. if (isset($_GET['recurring_pp_return']) && $_GET['recurring_pp_return'] == 'return') {
  561. $paypal_res = require_once(get_template_directory() . '/framework/modules/pp_recurring/review.php');
  562. }
  563. $donation_data = get_option(SH_NAME);
  564. if ($notif = $paypal->_paypal->handleNotification()) $paypal_res = $paypal->single_pament_result($notif);
  565. $return_url = (is_home()) ? home_url() : get_permalink();
  566. $percent = (sh_set($donation_data, 'paypal_target')) ? (int)str_replace(',', '', sh_set($donation_data, 'paypal_raised')) / (int)str_replace(',', '', sh_set($donation_data, 'paypal_target')) : 0;
  567. $donation_percentage = $percent * 100;
  568. $symbol = (sh_set($donation_data, 'paypal_currency')) ? sh_set($donation_data, 'paypal_currency') : '$';
  569. $output = '';
  570. $output .= '<div class="donation-bar">
  571. <div class="amount pull-left">
  572. <p>' . __('Dontaions Needed', SH_NAME) . '</p>
  573. <span><strong>' . sh_set($donation_data, 'paypal_currency') . '</strong> ' . sh_set($donation_data, 'paypal_target') . '!</span> </div>
  574. <div class="donate-now">';
  575. if (sh_set($donation_data, 'donate_method') == 'true') {
  576. $output .= '<a data-toggle="modal" data-target="#myModal" class="donate-btn" title="">Donate Us</a>';
  577. } else {
  578. $output .= $paypal->button(array('currency_code' => sh_set($donation_data, 'paypal_currency_code'), 'item_name' => get_bloginfo('name'), 'return' => $return_url));
  579. }
  580. $output .= '</div>
  581. <div class="amount pull-right">
  582. <p>' . __('Collected Donations', SH_NAME) . '</p>
  583. <span><strong>' . sh_set($donation_data, 'paypal_currency') . '</strong> ' . sh_set($donation_data, 'paypal_raised') . '!</span>
  584. </div>
  585. </div>';
  586. $output .= '<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">';
  587. if (isset($_GET['recurring_pp_return']) && $_GET['recurring_pp_return'] == 'return') {
  588. $output .= '<div class="donate-popup">' . $paypal_res . '</div>';
  589. $output .= '<script>
  590. jQuery(document).ready(function($){
  591. $(".donation-bar a.donate-btn").trigger("click");
  592. });
  593. </script>';
  594. } elseif ($notif = $paypal->_paypal->handleNotification() && isset($notif->ok)) {
  595. $output .= '<div class="donate-popup">' . $paypal_res . '</div>';
  596. $output .= '<script>
  597. jQuery(document).ready(function($){
  598. $(".donation-bar a.donate-btn").trigger("click");
  599. });
  600. </script>';
  601. } else {
  602. $output .= '<div class="donate-popup">
  603. <div class="cause-bar">
  604. <div class="cause-box"><h3><span>' . $symbol . '</span>' . sh_set($donation_data, 'paypal_target') . '</h3><i>' . __('NEEDED DONATION', SH_NAME) . '</i></div>
  605. <div class="cause-progress">
  606. <div class="progress-report">
  607. <h6>' . __('PHASES', SH_NAME) . '</h6>
  608. <span>' . $donation_percentage . '%</span>
  609. <div class="progress pattern">
  610. <div class="progress-bar" style="width: ' . $donation_percentage . '%"></div>
  611. </div>
  612. </div>
  613. </div>
  614. <div class="cause-box"><h3><span>' . $symbol . '</span>' . sh_set($donation_data, 'paypal_raised') . '</h3><i>' . __('COLLECTED DONATION', SH_NAME) . '</i></div>
  615. <div class="cause-box donate-drop-btn"><h4>' . __('DONATE NOW', SH_NAME) . '</h4></div>
  616. </div>
  617. <div class="donate-drop-down">
  618. <div class="recursive-periods">';
  619. $Settings = get_option(SH_NAME);
  620. $value = sh_set($Settings , 'transactions_detail');
  621. if($value)
  622. {
  623. foreach($value as $val )
  624. {
  625. $txt = ucwords(str_replace('_', ' ', $val));
  626. $output .= '<a style="cursor:pointer;">'.__( $txt, SH_NAME ).'</a>';
  627. }
  628. }
  629. $output .='</div>
  630. <div class="amount-btns">';
  631. if( intval ( sh_set($Settings , 'pop_up_1st_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_1st_value').'</span></a>';
  632. if(intval ( sh_set($Settings , 'pop_up_2nd_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_2nd_value').'</span></a>';
  633. if(intval ( sh_set($Settings , 'pop_up_3rd_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_3rd_value').'</span></a>';
  634. if(intval ( sh_set($Settings , 'pop_up_4th_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_4th_value').'</span></a>';
  635. if(intval ( sh_set($Settings , 'pop_up_5th_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_5th_value').'</span></a>';
  636. $output .= '</div>';
  637. $output .= '<div class="other-amount">
  638. ' . $paypal->button(array('item_name' => get_bloginfo('name'), 'amount' => 30, 'return' => $return_url)) . '
  639. </div>';
  640. if (!is_user_logged_in()) {
  641. $output .= '<form id="login" action="" method="post">
  642. <h1>Please Login OR Register first to make recursive donation</h1>
  643. <p class="status"></p>
  644. <label for="username">Username</label>
  645. <input id="username" type="text" name="username">
  646. <label for="password">Password</label>
  647. <input id="password" type="password" name="password">
  648. <a class="lost" href="' . wp_registration_url() . '">Register Now</a>
  649. <input class="submit_button" type="submit" value="Login" name="submit">
  650. <a class="close" href="">(close)</a>
  651. ' . wp_nonce_field('ajax-login-nonce', 'security') . '
  652. </form>';
  653. }
  654. $output .= '</div>
  655. </div>';
  656. }
  657. $output .= '</div>';
  658. return $output;
  659. }
  660. function donation_3($atts, $content = null)
  661. {
  662. extract(shortcode_atts(array(
  663. 'title' => '',
  664. ), $atts));
  665. $paypal_res = '';
  666. $single_page = (sh_set($_SESSION, 'sh_causes_page')) ? sh_set($_SESSION, 'sh_causes_page') : false;
  667. if ($single_page == true) unset($_SESSION['sh_causes_page']);
  668. if (isset($_GET['recurring_pp_return']) && $_GET['recurring_pp_return'] == 'return') {
  669. $paypal_res = require_once(get_template_directory() . '/framework/modules/pp_recurring/review.php');
  670. }
  671. $paypal = $GLOBALS['_sh_base']->donation;
  672. if ($notif = $paypal->_paypal->handleNotification()) $paypal_res = $paypal->single_pament_result($notif);
  673. $return_url = (is_home()) ? home_url() : get_permalink();
  674. $donation_data = get_option(SH_NAME);
  675. $percent = (sh_set($donation_data, 'paypal_target')) ? (int)str_replace(',', '', sh_set($donation_data, 'paypal_raised')) / (int)str_replace(',', '', sh_set($donation_data, 'paypal_target')) : 0;
  676. $donation_percentage = $percent * 100;
  677. $symbol = (sh_set($donation_data, 'paypal_currency')) ? sh_set($donation_data, 'paypal_currency') : '$';
  678. $output = '';
  679. $output .= '<div class="donate-us">
  680. <h3>' . sh_character_limit(20, $title) . '</h3>
  681. <span><i class="icon-phone"></i>' . sh_set($donation_data, 'paypal_contact') . '</span>
  682. <div class="collected">
  683. <p>' . __('Collected Dontaions', SH_NAME) . '</p>
  684. <span><strong>' . sh_set($donation_data, 'paypal_currency') . '</strong> ' . sh_set($donation_data, 'paypal_raised') . '!</span> </div>
  685. <div class="d-now">';
  686. if (sh_set($donation_data, 'donate_method') == 'true') {
  687. $output .= '<a data-toggle="modal" data-target="#myModal" class="donate-btn" title="">Donate Us</a>';
  688. } else {
  689. $output .= $paypal->button(array('currency_code' => sh_set($donation_data, 'paypal_currency_code'), 'item_name' => get_bloginfo('name'), 'return' => $return_url));
  690. }
  691. $output .= '</div>
  692. </div>';
  693. $output .= '<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">';
  694. if (isset($_GET['recurring_pp_return']) && $_GET['recurring_pp_return'] == 'return') {
  695. $output .= '<div class="donate-popup">' . $paypal_res . '</div>';
  696. $output .= '<script>
  697. jQuery(document).ready(function($){
  698. $(".donate-us a.donate-btn").trigger("click");
  699. });
  700. </script>';
  701. } elseif ($notif = $paypal->_paypal->handleNotification() && isset($notif->ok)) {
  702. $output .= '<div class="donate-popup">' . $paypal_res . '</div>';
  703. $output .= '<script>
  704. jQuery(document).ready(function($){
  705. $(".donate-us a.donate-btn").trigger("click");
  706. });
  707. </script>';
  708. } else {
  709. $output .= '<div class="donate-popup">
  710. <div class="cause-bar">
  711. <div class="cause-box"><h3><span>' . $symbol . '</span>' . sh_set($donation_data, 'paypal_target') . '</h3><i>' . __('NEEDED DONATION', SH_NAME) . '</i></div>
  712. <div class="cause-progress">
  713. <div class="progress-report">
  714. <h6>' . __('PHASES', SH_NAME) . '</h6>
  715. <span>' . $donation_percentage . '%</span>
  716. <div class="progress pattern">
  717. <div class="progress-bar" style="width: ' . $donation_percentage . '%"></div>
  718. </div>
  719. </div>
  720. </div>
  721. <div class="cause-box"><h3><span>' . $symbol . '</span>' . sh_set($donation_data, 'paypal_raised') . '</h3><i>' . __('COLLECTED DONATION', SH_NAME) . '</i></div>
  722. <div class="cause-box donate-drop-btn"><h4>' . __('DONATE NOW', SH_NAME) . '</h4></div>
  723. </div>
  724. <div class="donate-drop-down">
  725. <div class="recursive-periods">';
  726. $Settings = get_option(SH_NAME);
  727. $value = sh_set($Settings , 'transactions_detail');
  728. if($value)
  729. {
  730. foreach($value as $val )
  731. {
  732. $txt = ucwords(str_replace('_', ' ', $val));
  733. $output .= '<a style="cursor:pointer;">'.__( $txt, SH_NAME ).'</a>';
  734. }
  735. }
  736. $output .= '</div>
  737. <div class="amount-btns">';
  738. if( intval ( sh_set($Settings , 'pop_up_1st_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_1st_value').'</span></a>';
  739. if(intval ( sh_set($Settings , 'pop_up_2nd_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_2nd_value').'</span></a>';
  740. if(intval ( sh_set($Settings , 'pop_up_3rd_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_3rd_value').'</span></a>';
  741. if(intval ( sh_set($Settings , 'pop_up_4th_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_4th_value').'</span></a>';
  742. if(intval ( sh_set($Settings , 'pop_up_5th_value') ) != '') $output .= '<a style="cursor:pointer;">'.$symbol.'<span>'.sh_set($Settings , 'pop_up_5th_value').'</span></a>';
  743. $output .= '</div>';
  744. $output .= '<div class="other-amount">
  745. ' . $paypal->button(array('item_name' => get_bloginfo('name'), 'amount' => 30, 'return' => $return_url)) . '
  746. </div>';
  747. if (!is_user_logged_in()) {
  748. $output .= '<form id="login" action="" method="post">
  749. <h1>Please Login OR Register first to make recursive donation</h1>
  750. <p class="status"></p>
  751. <label for="username">Username</label>
  752. <input id="username" type="text" name="username">
  753. <label for="password">Password</label>
  754. <input id="password" type="password" name="password">
  755. <a class="lost" href="' . wp_registration_url() . '">Register Now</a>
  756. <input class="submit_button" type="submit" value="Login" name="submit">
  757. <a class="close" href="">(close)</a>
  758. ' . wp_nonce_field('ajax-login-nonce', 'security') . '
  759. </form>';
  760. }
  761. $output .= '</div>
  762. </div>';
  763. }
  764. $output .= '</div>';
  765. return $output;
  766. }
  767. function start_regular_donation($atts, $content = null)
  768. {
  769. extract(shortcode_atts(array(
  770. 'title' => '',
  771. 'sub_title' => '',
  772. 'image' => '',
  773. 'currency' => '$',
  774. 'donation_needed' => '',
  775. 'link_caption' => '',
  776. 'text' => '',
  777. 'heading_style' => 'simple',
  778. ), $atts));
  779. $title = sh_character_limit(25, $title);
  780. $SubTitle = (!empty($sub_title)) ? '<h5>' . sh_character_limit(26, $sub_title) . '</h5>' : '';
  781. $DonationNeeded = (!empty($donation_needed) || !empty($currency)) ? '<span>' . $currency . $donation_needed . ' </span>' : '';
  782. $output = '';
  783. $output .= '
  784. <div class="donate-message">
  785. ' . wp_get_attachment_image($image, '270x155') . '
  786. ' . $SubTitle . '
  787. <p>' . $DonationNeeded . sh_character_limit(100, $text) . '</p>
  788. <a href="" title="">' . sh_character_limit(25, $link_caption) . '</a>
  789. </div>
  790. ';
  791. return $output;
  792. }
  793. function ceo_message($atts, $content = null)
  794. {
  795. extract(shortcode_atts(array(
  796. 'number' => '',
  797. 'category' => '',
  798. 'sort_by' => 'date',
  799. 'sorting_order' => 'ASC',
  800. 'overlap' => '',
  801. ), $atts)
  802. );
  803. $args = array('post_type' => 'dict_testimonials', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  804. if ($category != '') $args['tax_query'] = array(array('taxonomy' => 'testimonial_category', 'field' => 'id', 'terms' => $category));
  805. //$Query = 'post_type=dict_testimonials&posts_per_page='.$number.'&orderby='.$sort_by.'&order='.$sorting_order;
  806. //$Query .= (!empty( $category ) ) ? '&testimonial_category='.$category: '';
  807. $Posts = query_posts($args);
  808. $i = 1;
  809. $Message = $MessageNav = '';
  810. if (have_posts()): while (have_posts()): the_post();
  811. $Settings = get_post_meta(get_the_ID(), '_dict_testimonials_settings', true);
  812. $Message .= '<li>
  813. <div class="carusal-image-thumb">
  814. ' . get_the_post_thumbnail(get_the_ID(), '150x150') . '
  815. <strong>' . sh_set($Settings, 'name') . ',</strong>
  816. <span class="carusal-image-thumb-name"> ' . sh_set($Settings, 'designation') . ' </span>
  817. </div>
  818. <p>' . get_the_content() . '</p></a>
  819. </li>';
  820. $i++;
  821. endwhile;
  822. endif;
  823. wp_reset_query();
  824. $output = '';
  825. $output .= '<div class="testimonial';
  826. if( $overlap == 'true' ): $output .= ' overlap'; endif;
  827. $output .= '">
  828. <div class="slideshow">
  829. <ul class="slides">
  830. ' . $Message . '
  831. </ul>
  832. </div>
  833. </div>
  834. <script>
  835. jQuery(document).ready(function($){
  836. if( $(\'.slideshow\').length ){
  837. $(\'.slideshow\').flexslider({
  838. animation: "fade",
  839. animationLoop: false,
  840. slideShow:false,
  841. controlNav: true,
  842. maxItems: 1,
  843. pausePlay: false,
  844. mousewheel:false,
  845. start: function(slider){
  846. $(\'body\').removeClass(\'loading\');
  847. }
  848. });
  849. }
  850. });
  851. </script>';
  852. return $output;
  853. }
  854. /*function recent_news( $atts, $content = null )
  855. {
  856. extract( shortcode_atts( array(
  857. 'number' => '',
  858. 'title' => __('Recent News', SH_NAME),
  859. 'category' => '',
  860. 'sort_by' => 'date',
  861. 'sorting_order' => 'DESC',
  862. 'heading_style' => 'simple' ,
  863. 'margins' =>'' ), $atts )
  864. );
  865. $marginsarr = explode(',' , $margins);
  866. $News = $Thumb = '';
  867. wp_reset_query();
  868. $args = array('post_type' => 'post' , 'posts_per_page'=> $number , 'orderby' => $sort_by , 'order' => $sorting_order, 'category' => $category);
  869. //if($category != '') $args['category'] = array($category);
  870. $query = new WP_Query($args);
  871. //printr($query);
  872. $i = 1;
  873. if( $query->have_posts()): while( $query->have_posts() ): $query->the_post();
  874. $Settings = get_post_meta( get_the_ID(), '_post_settings', true );
  875. if( $video_link = sh_set( $Settings, 'video_link' ) )
  876. {
  877. $opt = get_post_meta( get_the_ID(), '_dictate_gal_videos', true );
  878. $video_data = sh_grab_video( $video_link, $opt );
  879. $PostMedia = '<div class="image">
  880. <img src="'.sh_set( $video_data, 'thumb').'" style="width:261px; height:207px;" alt="'.sh_set( $video_data, 'title' ).'" />
  881. <a class="html5lightbox" rel="prettyPhoto" href="'.$video_link.'" title="'.sh_set( $video_data, 'title' ).'">
  882. <span><i class="icon-play"></i></span>
  883. </a>
  884. </div>';
  885. $CarouselThumb = '<img src="'.sh_set( $video_data, 'thumb').'" style="width:131px; height:78px;" alt="'.sh_set( $video_data, 'title' ).'" />';
  886. }
  887. else
  888. {
  889. $PostAttchment = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'large' );
  890. $PostMedia = '<div class="image">
  891. '.get_the_post_thumbnail( get_the_ID(), '370x252' ).'
  892. <a title="" href="'.sh_set( $PostAttchment, 0 ).'" rel="prettyPhoto" class="html5lightbox"><i class="icon-picture"></i></a>
  893. </div>';
  894. $CarouselThumb = get_the_post_thumbnail( get_the_ID(), '270x155' );
  895. }
  896. $News .= '<div id="news'.$i.'">
  897. <div class="row">
  898. <div class="col-md-6 desc">
  899. <h3><a href="'.get_permalink().'" title="">'.sh_character_limit( 35, get_the_title() ).'</a></h3>
  900. <p>'.sh_character_limit( 340, get_the_content() ).'</p>
  901. </div>
  902. <div class="col-md-6">
  903. '.$PostMedia.'
  904. </div>
  905. </div>
  906. </div>';
  907. $Thumb .= '<a href="#news'.$i.'">'.$CarouselThumb.'<span class="carusal-our-news">'.sh_character_limit( 17, get_the_title() ).'</span></a>';
  908. $i++;
  909. endwhile;
  910. endif;
  911. wp_reset_query();
  912. wp_enqueue_script('carofredcsel');
  913. $output = '' ;
  914. $output.= ( in_array('top' , (array)$marginsarr)) ? '<div class="block"></div>' : '';
  915. $output .= ($heading_style == 'underline')? '<div class="sec-heading">
  916. '.sh_get_title( $title, 'h2', 'strong', TRUE ).'
  917. </div>' : '' ;
  918. $output .= ($heading_style == 'modern')? '<div class="sec-title">
  919. '.sh_get_title( $title, 'h1', 'span', FALSE ).'
  920. </div>' : '' ;
  921. $output .= ($heading_style == 'simple')? '<div class="sec-heading2">
  922. '.sh_get_title( $title, 'h2', 'strong', TRUE ).'
  923. </div>' : '' ;
  924. $output .= '<div class="carusal-slider">
  925. <div id="carousel-wrapper">
  926. <div id="carousel">
  927. '.$News.'
  928. </div>
  929. </div>
  930. <div id="thumbs-wrapper">
  931. <div id="thumbs">'.$Thumb.'</div>
  932. <a id="prev" href="#"><i class="icon-angle-left"></i></a> <a id="next" href="#"><i class="icon-angle-right"></i></a> </div>
  933. </div>
  934. <script>
  935. jQuery(document).ready(function($){
  936. $(\'#carousel\').carouFredSel({
  937. responsive: true,
  938. circular: false,
  939. auto: false,
  940. items: {
  941. visible: 1,
  942. width: 20,
  943. },
  944. scroll: {
  945. fx: \'directscroll\'
  946. }
  947. });
  948. $(\'#thumbs\').carouFredSel({
  949. responsive: true,
  950. circular: false,
  951. infinite: false,
  952. auto: false,
  953. prev: \'#prev\',
  954. next: \'#next\',
  955. items: {
  956. visible: {
  957. min: 1,
  958. max: 6
  959. },
  960. width: 200,
  961. height: \'80%\'
  962. }
  963. });
  964. $(\'#thumbs a\').click(function() {
  965. $(\'#carousel\').trigger(\'slideTo\', \'#\' + this.href.split(\'#\').pop() );
  966. $(\'#thumbs a\').removeClass(\'selected\');
  967. $(this).addClass(\'selected\');
  968. return false;
  969. });
  970. });
  971. </script>
  972. ';
  973. $output.= ( in_array('bottom' , (array)$marginsarr)) ? '<div class="block"></div>' : '';
  974. return $output ;
  975. }
  976. */
  977. function recent_events($atts, $content = null)
  978. {
  979. extract(shortcode_atts(array(
  980. 'title' => 'Recent Events',
  981. 'number' => '',
  982. 'category' => '',
  983. 'sort_by' => 'date',
  984. 'sorting_order' => 'ASC',
  985. 'heading_style' => 'simple',
  986. ), $atts)
  987. );
  988. $args = array('post_type' => 'dict_event', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  989. if ($category) $args['tax_query'] = array(array('taxonomy' => 'event_category', 'field' => 'id', 'terms' => $category));
  990. query_posts($args);
  991. $Events = '';
  992. $i = 1;
  993. if (have_posts()): while (have_posts()): the_post();
  994. $Settings = get_post_meta(get_the_ID(), '_dict_event_settings', true);
  995. $PostThumbSize1 = ($i == 1) ? 'style="width:570px; height:184px;"' : 'style="width:100px; height:100px;"';
  996. $PostThumbSize2 = ($i == 1) ? '570x220' : '150x150';
  997. $EventOrganizer = ($i == 1 && sh_set($Settings, 'organizer')) ? '<li><a href="#" title=""><i class="icon-user"></i>' . __('by', SH_NAME) . ' ' . sh_set($Settings, 'organizer') . '</a></li>' : '';
  998. $EventdateDetails = '';
  999. if (sh_set($Settings, 'video_link')) {
  1000. $video_link = sh_set($Settings, 'video_link');
  1001. $video_data = sh_grab_video($video_link, $Settings);
  1002. $PostMedia = '<div class="carou-post-img">
  1003. <img src="' . sh_set($video_data, 'thumb') . '" ' . $PostThumbSize1 . ' alt="' . sh_set($video_data, 'title') . '" />
  1004. <a title="' . sh_set($video_data, 'title') . '" href="' . $video_link . '" class="html5lightbox"><i class="icon-play"></i></a>
  1005. </div>';
  1006. } else {
  1007. //$PostMedia = get_the_post_thumbnail( get_the_ID(), $PostThumbSize );
  1008. $PostAttchment = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'large');
  1009. $PostMedia = '<div class="carou-post-img">
  1010. ' . get_the_post_thumbnail(get_the_ID(), $PostThumbSize2) . '
  1011. <a title="" href="' . sh_set($PostAttchment, 0) . '" class="html5lightbox"><i class="icon-picture"></i></a>
  1012. </div>';
  1013. }
  1014. if (!empty($Settings['start_date'])) {
  1015. $Eventdate = new DateTime($Settings['start_date']);
  1016. $EventdateDetails = '<li><a href="' . get_permalink() . '" title=""><i class="icon-calendar-empty"></i><span>' . $Eventdate->format('F') . '</span> ' . $Eventdate->format('d, Y') . '</a></li>';
  1017. } else if (!empty($Settings['end_date'])) {
  1018. $Eventdate = new DateTime($Settings['end_date']);
  1019. $EventdateDetails = '<li><a href="' . get_permalink() . '" title=""><i class="icon-calendar-empty"></i><span>' . $Eventdate->format('F') . '</span> ' . $Eventdate->format('d, Y') . '</a></li>';
  1020. }
  1021. $Class = ($i == 1) ? 'recent-event' : 'recent-event previous-event';
  1022. $md_class = ($i == 1) ? 'col-md-12' : 'col-md-6';
  1023. $Location = (sh_set($Settings, 'location')) ? '<li><a href="' . get_permalink() . '" title=""><i class="icon-map-marker"></i>in ' . sh_set($Settings, 'location') . '</a></li>' : '';
  1024. $TitleLength = ($i == 1) ? 35 : 20;
  1025. $Events .= '<div class="' . $md_class . '">
  1026. <div class="' . $Class . '">
  1027. <div class="recent-event-img"> ' . $PostMedia . ' </div>
  1028. <h4><a href="' . get_permalink() . '" title="">' . sh_character_limit($TitleLength, get_the_title()) . '</a></h4>
  1029. <ul>
  1030. ' . $EventOrganizer . '
  1031. ' . $Location . '
  1032. ' . $EventdateDetails . '
  1033. </ul>
  1034. </div>
  1035. </div>';
  1036. $i++;
  1037. endwhile;
  1038. endif;
  1039. wp_reset_query();
  1040. $output = '';
  1041. $output .= '
  1042. <div class="row">
  1043. ' . $Events . '
  1044. </div>
  1045. ';
  1046. return $output;
  1047. }
  1048. function recent_events_2($atts, $content = null)
  1049. {
  1050. extract(shortcode_atts(array(
  1051. 'title' => 'Upcoming Events',
  1052. 'number' => 2,
  1053. 'category' => '',
  1054. 'sort_by' => 'date',
  1055. 'sorting_order' => 'ASC',
  1056. 'heading_style' => 'simple',
  1057. ), $atts)
  1058. );
  1059. wp_enqueue_script(array('jquery-plugins', 'jquery-countdown-min'));
  1060. $args = array('post_type' => 'dict_event', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1061. if ($category != '') $args['tax_query'] = array(array('taxonomy' => 'event_category', 'field' => 'id', 'terms' => (int)$category));
  1062. $Posts = new WP_Query( $args );
  1063. $Events = '';
  1064. $count = 1;
  1065. if ($Posts->have_posts()): while ($Posts->have_posts()): $Posts->the_post();
  1066. $Settings = get_post_meta(get_the_ID(), '_dict_event_settings', true);
  1067. $EventdateDetails = '';
  1068. if (!empty($Settings['start_date'])) {
  1069. $Eventdate = new DateTime($Settings['start_date']);
  1070. $EventdateDetails = '<a href="' . get_permalink() . '" title=""><i class="icon-calendar-empty"></i><span>' . $Eventdate->format('F') . '</span> ' . $Eventdate->format('d, Y') . '</a>';
  1071. } else if (!empty($Settings['end_date'])) {
  1072. $Eventdate = new DateTime($Settings['end_date']);
  1073. $EventdateDetails = '<a href="' . get_permalink() . '" title=""><i class="icon-calendar-empty"></i><span>' . $Eventdate->format('F') . '</span> ' . $Eventdate->format('d, Y') . '</a>';
  1074. }
  1075. $end_date = explode('-', sh_set($Settings, 'end_date'));
  1076. $Location = (sh_set($Settings, 'location')) ? ' <a href="' . get_permalink() . '" title=""><i class="icon-map-marker"></i>In ' . sh_set($Settings, 'location') . '</a>' : '';
  1077. $counter_class = "count-down" . $count;
  1078. $variable = 'variable_' . $count;
  1079. $Events .= '<div class="col-md-6">
  1080. <div class="event">
  1081. <div class="event-thumb"> ' . get_the_post_thumbnail(get_the_ID(), '270x155') . '
  1082. <div class="counter">
  1083. <ul class="' . $counter_class . '">
  1084. <li> <span class="days">00</span>
  1085. <p class="days_ref">DAYS</p>
  1086. </li>
  1087. <li> <span class="hours">00</span>
  1088. <p class="hours_ref">HOURS</p>
  1089. </li>
  1090. <li> <span class="minutes">00</span>
  1091. <p class="minutes_ref">MINTS</p>
  1092. </li>
  1093. <li> <span class="seconds">00</span>
  1094. <p class="seconds_ref">SECS</p>
  1095. </li>
  1096. </ul>
  1097. </div>
  1098. </div>
  1099. <div class="event-intro">
  1100. <h5><a href="' . get_permalink() . '" title="">' . sh_character_limit(35, get_the_title()) . '</a></h5>
  1101. ' . $EventdateDetails . $Location . '
  1102. </div>
  1103. </div>
  1104. </div>';
  1105. $time = strtotime(sh_set($Settings, 'start_date'));
  1106. $new_time = date('g:i a', $time);
  1107. $date = strtotime(sh_set($Settings, 'start_date'));
  1108. $c_t = date('g:i:s', $time);
  1109. $c_d = date('m/d/Y', $date);
  1110. $Events .= '<script>
  1111. jQuery(document).ready(function($){
  1112. jQuery(".' . $counter_class . '").downCount({
  1113. date: "' . $c_d . ' ' . $c_t . '"
  1114. });
  1115. });
  1116. </script>
  1117. ';
  1118. $count++;
  1119. endwhile;
  1120. endif;
  1121. wp_reset_query();
  1122. $output = '';
  1123. $output .= '<div class="recent-events">';
  1124. $output .= '<div class="row">
  1125. ' . $Events . '
  1126. </div>
  1127. </div>';
  1128. return $output;
  1129. }
  1130. function recent_events_3($atts, $content = null)
  1131. {
  1132. extract(shortcode_atts(array(
  1133. 'title' => 'Upcoming Event',
  1134. 'number' => '',
  1135. 'category' => '',
  1136. 'sort_by' => 'date',
  1137. 'sorting_order' => 'ASC',
  1138. 'heading_style' => 'simple',
  1139. ), $atts)
  1140. );
  1141. $args = array('post_type' => 'dict_event', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1142. if ($category != '') $args['tax_query'] = array(array('taxonomy' => 'event_category', 'field' => 'id', 'terms' => $category));
  1143. $Posts = query_posts($args);
  1144. $Events = '';
  1145. if (have_posts()): while (have_posts()): the_post();
  1146. $Settings = get_post_meta(get_the_ID(), '_dict_event_settings', true);
  1147. $EventdateDetails = '';
  1148. if (sh_set($Settings, 'start_date')) {
  1149. $Eventdate = new DateTime($Settings['start_date']);
  1150. $EventdateDetails = '<li><a href="' . get_permalink() . '" title=""><i class="icon-calendar"></i>' . $Eventdate->format('M d Y') . '</a></li>';
  1151. } else if (sh_set($Settings, 'end_date')) {
  1152. $Eventdate = new DateTime($Settings['end_date']);
  1153. $EventdateDetails = '<li><a href="' . get_permalink() . '" title=""><i class="icon-calendar"></i>' . $Eventdate->format('M d Y') . '</a></li>';
  1154. }
  1155. $TwitterLink = (sh_set($Settings, 'twitter_link')) ? '<li><a href="' . sh_set($Settings, 'twitter_link') . '" title=""><i class="icon-twitter"></i>' . __('Twitter Updates', SH_NAME) . '</a></li>' : '';
  1156. $Organizer = (sh_set($Settings, 'organizer')) ? '<li><a href="' . get_permalink() . '" title=""><i class="icon-pencil"></i>' . sh_set($Settings, 'organizer') . '</a></li>' : '';
  1157. $Events .= '<div class="upcoming-event">
  1158. <a href="' . get_permalink() . '" title="">' . get_the_post_thumbnail(get_the_ID(), '270x155') . '</a>
  1159. <h5>' . sh_character_limit(25, get_the_title()) . '</h5>
  1160. <ul>
  1161. ' . $TwitterLink . $EventdateDetails . $Organizer . '
  1162. </ul>
  1163. </div>';
  1164. endwhile;
  1165. endif;
  1166. wp_reset_query();
  1167. $title = sh_character_limit(20, $title);
  1168. $output = '';
  1169. $output .= $Events;
  1170. return $output;
  1171. }
  1172. function successful_stories($atts, $content = null)
  1173. {
  1174. extract(shortcode_atts(array(
  1175. 'title' => 'Successful Stories',
  1176. 'number' => '',
  1177. 'category' => '',
  1178. 'sort_by' => 'date',
  1179. 'sorting_order' => 'ASC',
  1180. 'heading_style' => 'simple',
  1181. ), $atts)
  1182. );
  1183. $args = array('post_type' => 'dict_project', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1184. if ($category != '') $args['tax_query'] = array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => $category));
  1185. $Posts = query_posts($args);
  1186. $output = '';
  1187. $output .= '
  1188. <div class="stories-carousel">
  1189. <ul class="slides">';
  1190. $chunk = array_chunk($Posts, 2);
  1191. foreach ($chunk as $p) {
  1192. $output .= '<li><div class="row">';
  1193. foreach ($p as $pos) {
  1194. $Settings = get_post_meta(sh_set($pos, 'ID'), '_dict_project_settings', true);
  1195. $Location = (sh_set($Settings, 'location')) ? '<span><i class="icon-map-marker"></i>' . __('In', SH_NAME) . ' ' . sh_set($Settings, 'location') . '</span>' : '';
  1196. $MoneySpent = (sh_set($Settings, 'spent_amount')) ? '<h6><i>' . sh_set($Settings, 'spent_amount_currency') . '</i> ' . sh_set($Settings, 'spent_amount') . '<span>' . __('Money Spent', SH_NAME) . '</span></h6>' : '';
  1197. $output .= '<div class="col-md-6">
  1198. <div class="story">
  1199. <div class="story-img"> ' . get_the_post_thumbnail(sh_set($pos, 'ID'), '370x252') . '
  1200. <h5>' . sh_character_limit(25, sh_set($pos, 'post_title')) . '</h5>
  1201. <a href="' . get_permalink(sh_set($pos, 'ID')) . '" title=""><span></span></a>
  1202. </div>
  1203. <div class="story-meta">
  1204. <span><i class="icon-calendar-empty"></i>' . get_the_time(sh_set($pos, 'ID'), 'm-d-y') . '</span>
  1205. <span><i class="icon-map-marker"></i>' . __("In ", SH_NAME) . ' ' . $Location . '</span>
  1206. <p>' . __("Needed Donation ", SH_NAME) . '<strong>$ ' . sh_set($Settings, 'amount_needed') . '</strong></p>
  1207. </div>
  1208. <p>' . sh_character_limit(250, sh_set($pos, 'post_content')) . '</p>
  1209. </div>
  1210. </div>';
  1211. }
  1212. $output .= '</div></li>';
  1213. }
  1214. wp_reset_query();
  1215. $output .= ' </ul>
  1216. </div>';
  1217. return $output;
  1218. }
  1219. function welfare_projects($atts, $content = null)
  1220. {
  1221. extract(shortcode_atts(array(
  1222. 'title' => 'Our Welfare Projects',
  1223. 'number' => 6,
  1224. 'category' => '',
  1225. 'sort_by' => 'date',
  1226. 'sorting_order' => 'DESC',
  1227. 'heading_style' => 'simple',
  1228. ), $atts)
  1229. );
  1230. $paypal = $GLOBALS['_sh_base']->donation;
  1231. $args = array('post_type' => 'dict_project', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1232. if ($category != '') $args['tax_query'] = array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => $category));
  1233. query_posts($args);
  1234. $Project = '';
  1235. if (have_posts()): while (have_posts()): the_post();
  1236. $Settings = get_post_meta(get_the_ID(), '_dict_project_settings', true);
  1237. $Project .= '<div class="col-md-6">
  1238. <div class="row">
  1239. <div class="col-md-5">
  1240. <div class="icon-box">
  1241. <i style="color:' . sh_set($Settings, 'color', '#A5A4A4') . '" class="' . sh_set($Settings, 'font') . '"></i>
  1242. <div class="need"><a href="' . get_permalink() . '">' . __('Donate Now', SH_NAME) . '</a></div>
  1243. </div>
  1244. </div>
  1245. <div class="col-md-7">
  1246. <div class="project-detail"> <a href="' . get_permalink() . '">' . sh_character_limit(18, get_the_title()) . '</a>
  1247. <span>' . __('NEEDED', SH_NAME) . ' $' . sh_set($Settings, 'amount_needed') . '</span>
  1248. <p>' . sh_excerpt(get_the_content(), 75) . ' </p>
  1249. </div>
  1250. </div>
  1251. </div>
  1252. </div>';
  1253. endwhile;
  1254. endif;
  1255. wp_reset_query();
  1256. $output = '';
  1257. $output .= '<div class="our-project-box">
  1258. <div class="row">
  1259. ' . $Project . '
  1260. </div>
  1261. </div>
  1262. ';
  1263. return $output;
  1264. }
  1265. function welfare_projects_2($atts, $content = null)
  1266. {
  1267. extract(shortcode_atts(array(
  1268. 'title' => 'Our Welfare Projects',
  1269. 'number' => '',
  1270. 'category' => '',
  1271. 'sort_by' => 'date',
  1272. 'heading_style' => 'simple',
  1273. 'sorting_order' => 'ASC',
  1274. ), $atts)
  1275. );
  1276. $paypal = $GLOBALS['_sh_base']->donation;
  1277. $args = array('post_type' => 'dict_project', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1278. if ($category != '') $args['tax_query'] = array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => $category));
  1279. $Posts = query_posts($args);
  1280. $Project = '';
  1281. if (have_posts()): while (have_posts()): the_post();
  1282. $Settings = get_post_meta(get_the_ID(), '_dict_project_settings', true);
  1283. $Project .= '<div class="col-md-4">
  1284. <div class="row">
  1285. <div class="col-md-5">
  1286. <div class="icon-box"> <i style="color:' . sh_set($Settings, 'color', '#A5A4A4') . '" class="' . sh_set($Settings, 'font') . '"></i>
  1287. <div class="need"><a href="' . get_permalink() . '">' . __('Donate Now', SH_NAME) . '</a></div>
  1288. </div>
  1289. </div>
  1290. <div class="col-md-7">
  1291. <div class="project-detail"> <a href="' . get_permalink() . '">' . sh_character_limit(18, get_the_title()) . '</a>
  1292. <span>' . __('NEEDED', SH_NAME) . ' $' . sh_set($Settings, 'amount_needed') . '</span>
  1293. <p>' . sh_excerpt(get_the_content(), 75) . '</p>
  1294. </div>
  1295. </div>
  1296. </div>
  1297. </div>';
  1298. endwhile;
  1299. endif;
  1300. wp_reset_query();
  1301. $output = '';
  1302. $output .= '<div class="our-project-box">
  1303. <div class="row">
  1304. ' . $Project . '
  1305. </div>
  1306. </div>';
  1307. return $output;
  1308. }
  1309. function block_quotes($atts, $content = null)
  1310. {
  1311. extract(shortcode_atts(array('title' => '', 'blockquotes' => ''), $atts));
  1312. $output = '<section class="element" id="blockquotes-style">
  1313. <h3 class="sub-head">' . $title . '</h3>
  1314. <blockquote><i class="icon-quote-left"></i>' . $blockquotes . '<i class="icon-quote-right"></i></blockquote>
  1315. </section>';
  1316. return $output;
  1317. }
  1318. function boxed_block_quotes($atts, $content = null)
  1319. {
  1320. extract(shortcode_atts(array('title' => '', 'text1' => '', 'text2' => '', 'blockquotes' => ''), $atts));
  1321. $TextBeforeBlockQuote = (!empty($text1)) ? '<p>' . $text1 . '</p><br />' : '';
  1322. $TextAfterBlockQuote = (!empty($text2)) ? '<p>' . $text2 . '</p>' : '';
  1323. $output = '<section class="element" id="blockquotes-style">
  1324. <h3 class="sub-head">' . $title . '</h3>
  1325. <blockquote><i class="icon-quote-left"></i>' . $text . '<i class="icon-quote-right"></i></blockquote>
  1326. </section>
  1327. <section class="element" >
  1328. <h3 class="sub-head">' . $title . '</h3>
  1329. ' . $TextBeforeBlockQuote . '
  1330. <blockquote class="boxed-quote"><i class="icon-quote-left"></i>' . $blockquotes . '<i class="icon-quote-right"></i></blockquote>
  1331. ' . $TextAfterBlockQuote . '
  1332. </section>';
  1333. return $output;
  1334. }
  1335. function highlight_text($atts, $content = null)
  1336. {
  1337. extract(shortcode_atts(array('text' => '', 'rounded' => ''), $atts));
  1338. $Class = ($rounded = 1) ? 'highlight rounded' : 'highlight';
  1339. return '<p class="highlight rounded">' . $text . '</p>';
  1340. }
  1341. function button($atts, $content = null)
  1342. {
  1343. extract(shortcode_atts(array('text' => '', 'link' => '', 'size' => 'small', 'color' => 'skyblue'), $atts));
  1344. return '<a href="' . $link . '" title="' . $text . '" class="theme-btn ' . $color . ' ' . $size . '">' . $text . '</a>';
  1345. }
  1346. function list_item($atts, $content = null)
  1347. {
  1348. extract(shortcode_atts(array('text' => '', 'style' => 'icon-check'), $atts));
  1349. return '<li><i class="' . $style . '"></i>' . $text . '</li>';
  1350. }
  1351. function alert_box($atts, $content = null)
  1352. {
  1353. extract(shortcode_atts(array('type' => 'done', 'title' => '', 'message' => ''), $atts));
  1354. $title .= (!empty($title)) ? '! ' : '';
  1355. if ($type == 'done') $Icon = 'icon-ok';
  1356. else if ($type == 'attention') $Icon = 'icon-exclamation-sign';
  1357. else if ($type == 'cancel') $Icon = 'icon-remove';
  1358. else if ($type == 'warning') $Icon = 'icon-warning-sign';
  1359. return '<div class="alert-box ' . $type . '"> <i class="' . $Icon . '"></i>
  1360. <h4>' . $title . '<span>' . $message . '</span></h4>
  1361. </div>';
  1362. }
  1363. function social_media_icon($atts, $content = null)
  1364. {
  1365. extract(shortcode_atts(array('media' => 'social_facebook'), $atts));
  1366. return '<i class="' . str_replace('_', ' ', $media) . '"></i>';
  1367. }
  1368. function progressbar($atts, $content = null)
  1369. {
  1370. extract(shortcode_atts(array('title' => '', 'percentage' => '0', 'pattren' => '', 'position' => 'within-progress-bar'), $atts));
  1371. $Title = (!empty($title)) ? '<h6>' . $title . '</h6>' : '';
  1372. $Top = ($position == 'top') ? '<span>' . $percentage . '%</span>' : '';
  1373. $Middle = ($position == 'within-progress-bar') ? '<span>' . $percentage . '%</span>' : '';
  1374. return '<div class="progress-report">
  1375. ' . $Title . $Top . '
  1376. <div class="progress pattern">
  1377. <div class="progress-bar" style="width: ' . $percentage . '%"><span>' . $Middle . '</span></div>
  1378. </div>
  1379. </div>';
  1380. }
  1381. function price_table($atts, $content = null)
  1382. {
  1383. extract(shortcode_atts(array(
  1384. 'title' => '',
  1385. 'sub_title' => '',
  1386. 'description' => '',
  1387. 'short_desc' => '',
  1388. 'currency' => '',
  1389. 'price' => '',
  1390. 'duration' => '',
  1391. 'option1' => '',
  1392. 'option2' => '',
  1393. 'option3' => '',
  1394. 'link' => ''
  1395. ), $atts));
  1396. $ShortDesc = (!empty($short_desc)) ? '<span><p>' . $short_desc . '</span>' : '';
  1397. $Description = (!empty($description)) ? '<li class="table-desc"><p>' . $description . '</p></li>' : '';
  1398. $Options = '';
  1399. $Options .= (!empty($option1)) ? '<li><i class="icon-ok-sign"></i>' . $option1 . '</li>' : '';
  1400. $Options .= (!empty($option2)) ? '<li><i class="icon-ok-sign"></i>' . $option2 . '</li>' : '';
  1401. $Options .= (!empty($option3)) ? '<li><i class="icon-ok-sign"></i>' . $option3 . '</li>' : '';
  1402. $output = '</ul>
  1403. <ul>
  1404. <li class="table-head">
  1405. <h3>' . $title . '</h3>
  1406. ' . $ShortDesc . '
  1407. </li>
  1408. ' . $Description . '
  1409. ' . $Options . '
  1410. <li class="price-per-year"><i>' . $currency . '</i> ' . $price . '<span>' . $duration . '</span></li>
  1411. <li class="table-btn"><a href="' . $link . '" title="">' . __('Select Plan', SH_NAME) . '</a></li>
  1412. </ul>';
  1413. return $output;
  1414. }
  1415. function charity_video($atts, $content = null)
  1416. {
  1417. extract(shortcode_atts(array(
  1418. 'title' => 'Charity Video',
  1419. 'heading_style' => 'simple',
  1420. 'video_title' => '',
  1421. 'video_link' => '',
  1422. 'description' => '',
  1423. ), $atts)
  1424. );
  1425. $title = sh_character_limit(15, $title);
  1426. $opt = get_post_meta(get_the_ID(), '_dictate_gal_videos', true);
  1427. $url = 'http://vimeo.com/'.$video_link;
  1428. $video_data = sh_grab_video($url, $opt);
  1429. $output = '';
  1430. $output .= ' <div class="charity-video">
  1431. <div class="row">
  1432. <div class="col-md-6 desc">
  1433. <h3><a href="javascript:void(0)" title="">' . sh_character_limit(35, $video_title) . '</a></h3>
  1434. <p>' . sh_character_limit(310, $description) . '</p>
  1435. </div>
  1436. <div class="col-md-6">
  1437. <div class="image"> <img src="' . sh_set($video_data, 'thumb') . '" style="width:270px; height:184px;" alt="' . sh_set($video_data, 'title') . '" /> <a class="html5lightbox" href="http://player.vimeo.com/video/' . $video_link . '" title="' . $video_title . '"> <span><i class="icon-play"></i></span> </a> </div>
  1438. </div>
  1439. </div>
  1440. </div>';
  1441. return $output;
  1442. }
  1443. function charity_video2($atts, $content = null)
  1444. {
  1445. extract(shortcode_atts(array(
  1446. 'title' => '',
  1447. 'video_link' => '',
  1448. 'duration' => '',
  1449. 'projects' => '',
  1450. 'members' => '',
  1451. 'description' => '',
  1452. ), $atts)
  1453. );
  1454. $opt = get_post_meta(get_the_ID(), '_dictate_gal_videos', true);
  1455. $url = 'http://vimeo.com/'.$video_link;
  1456. $video_data = sh_grab_video($url, $opt);
  1457. $CharityDuration = (!empty($duration)) ? '<li><h6>' . $duration . '</h6><span>' . __("Years In Charity", SH_NAME) . '</span></li>' : '';
  1458. $CharityProjects = (!empty($projects)) ? '<li><h6>' . $projects . '</h6><span>' . __("Project Handled", SH_NAME) . '</span></li>' : '';
  1459. $StafMembers = (!empty($members)) ? '<li><h6>' . $members . '</h6><span>' . __("Staff Members", SH_NAME) . '</span></li>' : '';
  1460. $output = '';
  1461. $output .= '<div class="about-charity">
  1462. <div class="container">
  1463. <div class="row">
  1464. <div class="about-charity-desc col-md-7">
  1465. <h2>' . sh_character_limit(35, $title) . '</h2>
  1466. <p>' . sh_character_limit(385, $description) . '</p>
  1467. <ul>
  1468. ' . $CharityDuration . $CharityProjects . $StafMembers . '
  1469. </ul>
  1470. </div>
  1471. <div class="col-md-5">
  1472. <div class="about-charity-video"> <img src="' . sh_set($video_data, 'thumb') . '" style="width:470px; height:278px;" alt="' . sh_set($video_data, 'title') . '" /> <a class="html5lightbox" href="http://player.vimeo.com/video/' . $video_link . '" title="' . sh_set($video_data, 'title') . '"><span><i class="icon-play"></i></span></a> </div>
  1473. </div>
  1474. </div>
  1475. </div>
  1476. </div>';
  1477. return $output;
  1478. }
  1479. function team($atts, $content = null)
  1480. {
  1481. extract(shortcode_atts(array(
  1482. 'category' => '',
  1483. 'sort_by' => 'date',
  1484. 'number' => 10,
  1485. 'sorting_order' => 'ASC',
  1486. ), $atts)
  1487. );
  1488. $args = array('post_type' => 'dict_team', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1489. if ($category != '') $args['tax_query'] = array(array('taxonomy' => 'team_category', 'field' => 'id', 'terms' => $category));
  1490. $Posts = query_posts($args);
  1491. $i = 1;
  1492. $Records = '';
  1493. if (have_posts()): while (have_posts()): the_post();
  1494. global $post;
  1495. $Settings = get_post_meta(get_the_ID(), '_dict_team_settings', true);
  1496. $Name = (sh_set($Settings, 'name')) ? '<h3><a href="' . get_permalink() . '">' . sh_character_limit(30, sh_set($Settings, 'name')) . '</a></h3>' : '';
  1497. $Designation = (sh_set($Settings, 'designation')) ? '<span>' . sh_character_limit(30, sh_set($Settings, 'designation')) . '</span>' : '';
  1498. $FbLink = (sh_set($Settings, 'fb_link')) ? '<li><a href="' . sh_set($Settings, 'fb_link') . '" title=""><img src="' . get_template_directory_uri() . '/images/facebook.jpg" alt="" /></a></li>' : '';
  1499. $GPlusLink = (sh_set($Settings, 'gplus_link')) ? '<li><a href="' . sh_set($Settings, 'gplus_link') . '" title=""><img src="' . get_template_directory_uri() . '/images/gplus.jpg" alt="" /></a></li>' : '';
  1500. $Records .= '<div class="col-md-3">
  1501. <div class="staff-member"> ' . get_the_post_thumbnail(get_the_ID(), '570x570') . '
  1502. <div class="member-intro">
  1503. ' . $Name . '
  1504. ' . $Designation . '
  1505. </div>
  1506. <div class="social-contacts">
  1507. <ul>
  1508. ' . $FbLink . '
  1509. ' . $GPlusLink . '
  1510. </ul>
  1511. </div>
  1512. </div>
  1513. </div>';
  1514. endwhile;
  1515. endif;
  1516. wp_reset_query();
  1517. $output = '';
  1518. $output .= '<div class="container">
  1519. <div class="staff">
  1520. <div class="row">
  1521. ' . $Records . '
  1522. </div>
  1523. </div>
  1524. </div>';
  1525. return $output;
  1526. }
  1527. function shop_online($atts, $content = null)
  1528. {
  1529. extract(shortcode_atts(array(
  1530. 'number' => '',
  1531. 'title' => 'Shop Online For Donation',
  1532. 'heading_style' => 'simple',
  1533. 'category' => '',
  1534. 'sort_by' => 'date',
  1535. 'sorting_order' => 'ASC',
  1536. ), $atts)
  1537. );
  1538. global $woocommerce, $product;
  1539. //ob_start();
  1540. $query_args = array(
  1541. 'posts_per_page' => $number,
  1542. 'post_type' => 'product',
  1543. );
  1544. $query_args['meta_query'] = array();
  1545. $query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
  1546. $query = new WP_Query($query_args);
  1547. include(get_template_directory() . '/framework/modules/product.php');
  1548. return $output;
  1549. }
  1550. /*function our_blog($atts, $content = null)
  1551. {
  1552. extract(shortcode_atts(array(
  1553. 'title' => '',
  1554. ), $atts)
  1555. );
  1556. $args = array('posts_per_page' => 3);
  1557. $output = '';
  1558. $output .= '<div class="main-blog row">';
  1559. $posts = get_posts($args);
  1560. foreach ($posts as $pos):
  1561. $post_meta = get_post_meta(sh_set($pos, 'ID'), '_post_settings', true);
  1562. $output .= '<div class="col-md-6"><div class="blog-post">';
  1563. $image = wp_get_attachment_image_src(get_post_thumbnail_id(sh_set($pos, 'ID')), '1170x455');
  1564. $output .= '<a class="blog-post-img" href="' . get_permalink(sh_set($pos, 'ID')) . '" title=""><img src="' . sh_set($image, 0) . '" alt=""></a>';
  1565. $output .= '<h2><a href="' . get_permalink(sh_set($pos, 'ID')) . '" title="">' . get_the_title(sh_set($pos, 'ID')) . '</a></h2>';
  1566. $output .= '<div class="blog-post-details">
  1567. <ul class="post-meta">
  1568. <li><a href="" title=""><i class="icon-calendar-empty"></i><span>' . get_the_time("M", sh_set($pos, 'ID')) . '</span> ' . get_the_time("d-Y", sh_set($pos, 'ID')) . '</a></li>
  1569. <li><a href="" title=""><i class="icon-share-alt"></i>' . sh_set(sh_set(get_the_category(sh_set($pos, 'ID')), 0), 'name') . '</a></li>
  1570. <li><a href="" title=""><i class="icon-map-marker"></i>' . __("In", SH_NAME) . ' ' . sh_set($post_meta, 'location') . '</a></li>
  1571. </ul>';
  1572. $output .= '<div class="post-desc"><p>' . substr(strip_tags(sh_set($pos, 'post_content')), 0, 150) . '</p></div>';
  1573. $output .= '</div></div></div>';
  1574. endforeach;
  1575. wp_reset_query();
  1576. $output .= '</div>';
  1577. return $output;
  1578. }*/
  1579. function services($atts, $content = null)
  1580. {
  1581. extract(shortcode_atts(array(
  1582. 'sort_by' => '',
  1583. 'sorting_order' => '',
  1584. 'linked' => '',
  1585. 'overlap' => '',
  1586. ), $atts)
  1587. );
  1588. $args = array('post_type' => 'dict_services', 'posts_per_page' => 6, 'orderby' => $sort_by, 'order' => $sorting_order);
  1589. $services = get_posts($args);
  1590. $output = '';
  1591. $uphalf_class = ($overlap) ? 'up-half' : '';
  1592. $output .= '
  1593. <div class="' . $uphalf_class . '"><div class="services">';
  1594. foreach ($services as $service):
  1595. $meta = get_post_meta(sh_set($service, 'ID'), '_dict_services_settings', true);
  1596. $output .= '<div class="col-md-2">
  1597. <div class="box">
  1598. <i class="' . sh_set($meta, 'font_awesome') . '"></i>';
  1599. $output .= '<h4>';
  1600. $output .= ($linked) ? '<a href="' . get_permalink(sh_set($service, 'ID')) . '">' : '';
  1601. $output .= get_the_title(sh_set($service, 'ID'));
  1602. $output .= ($linked) ? '</a>' : '';
  1603. $output .= '</h4>';
  1604. $output .= '
  1605. </div>
  1606. </div>';
  1607. endforeach;
  1608. $output .= '</div></div></div>';
  1609. return $output;
  1610. wp_reset_query();
  1611. }
  1612. function Gallery($atts, $content = null)
  1613. {
  1614. extract(shortcode_atts(array(
  1615. 'cols' => '',
  1616. 'num' => 10,
  1617. ), $atts)
  1618. );
  1619. wp_enqueue_script(array('bootstrap'));
  1620. $args = array('post_type' => 'dict_gallery', 'posts_per_page' => $num);
  1621. $columns = array(1 => 'col-md-12', 2 => 'col-md-6', 3 => 'col-md-4', 4 => 'col-md-3');
  1622. $max_limit_arr = array(1 => 6, 2 => 3, 3 => 2, 4 => 2);
  1623. $col_class = sh_set($columns, $cols);
  1624. if ($cols == 1 || $cols == 2) $featured_image_size = "1170x455";
  1625. elseif ($cols == 3) $featured_image_size = "370x252";
  1626. elseif ($cols == 4) $featured_image_size = "270x155";
  1627. $max_limit = sh_set($max_limit_arr, $cols);
  1628. $output = '';
  1629. $output .= '<ul class="gallery-tabs nav nav-tabs" id="myTab">';
  1630. $taxonomies = sh_get_categories(array('taxonomy' => 'gallery_category', 'hide_empty' => false));
  1631. $galleries = array();
  1632. $count = 1;
  1633. foreach ($taxonomies as $id => $tax_name):
  1634. $args['tax_query'] = array(array('taxonomy' => 'gallery_category', 'field' => 'id', 'terms' => $id));
  1635. $galleries[$tax_name] = get_posts($args);
  1636. $active_class = ($count == 1) ? 'active' : '';
  1637. $output .= '<li class="' . $active_class . '"><a data-toggle="tab" href="#cat_' . $tax_name . '">' . $tax_name . '</a></li>';
  1638. $count++;
  1639. endforeach;
  1640. $output .= '</ul>';
  1641. $output .= '<div class="gallery-content tab-content" id="myTabContent">';
  1642. $count_2 = 1;
  1643. foreach ($galleries as $tax => $gal_posts):
  1644. $active_class_ = ($count_2 == 1) ? 'active' : '';
  1645. $output .= '<div id="cat_' . $tax . '" class="tab-pane fade in ' . $active_class_ . '">
  1646. <div class="row">';
  1647. foreach ($gal_posts as $gal):
  1648. $output .= '<div class="' . $col_class . '">';
  1649. $featured_image = sh_set(wp_get_attachment_image_src(get_post_thumbnail_id(sh_set($gal, 'ID')), $featured_image_size), 0);
  1650. $output .= '<div class="gallery-image"><img src="' . $featured_image . '" alt="" />';
  1651. $output .= '<span>' . get_the_term_list($gal->ID, 'gallery_category', '', ' / ', '') . '</span>';
  1652. $output .= '<div class="image-lists"><ul>';
  1653. $Settings = get_post_meta(sh_set($gal, 'ID'), '_dict_gallery_settings', true);
  1654. $GalleryAttachments = get_posts(array('post_type' => 'attachment', 'post__in' => explode(',', sh_set($Settings, 'gallery'))));
  1655. $limiter = 1;
  1656. foreach ($GalleryAttachments as $thumb_image):
  1657. $Thumb = sh_set(wp_get_attachment_image_src(sh_set($thumb_image, 'ID'), '150x150'), '0');
  1658. $LargeThumb = sh_set(wp_get_attachment_image_src(sh_set($thumb_image, 'ID'), '1170x455'), '0');
  1659. $output .= '<li>
  1660. <a class="html5lightbox" href="' . $LargeThumb . '" data-group="group' . sh_set($gal, 'ID') . '" title="">
  1661. <img src="' . $Thumb . '" alt="" />
  1662. </a>
  1663. </li>';
  1664. if ($limiter < $max_limit) $limiter++;
  1665. else break;
  1666. endforeach;
  1667. $output .= '</ul></div>';
  1668. $output .= '</div>';
  1669. $output .= '<h3 class="image-title"><a href="' . get_permalink(sh_set($gal, 'ID')) . '" title="">' . sh_set($gal, 'post_title') . '</a></h3>';
  1670. $output .= '</div>';
  1671. endforeach;
  1672. $output .= ' </div>
  1673. </div>';
  1674. $count_2++;
  1675. endforeach;
  1676. $output .= '</div>';
  1677. wp_reset_query();
  1678. return $output;
  1679. }
  1680. function portfolio_without_sidebar($atts, $content = null)
  1681. {
  1682. extract(shortcode_atts(array(
  1683. 'cols' => '',
  1684. 'num' => '',
  1685. ), $atts)
  1686. );
  1687. wp_enqueue_script(array('jquery_isotope'));
  1688. $args = array('post_type' => 'dict_portfolio', 'posts_per_page' => $num);
  1689. $portfolios = get_posts($args);
  1690. $page_meta = get_post_meta(get_the_ID(), '_page_settings', true);
  1691. $columns = array(2 => 'col-md-6', 3 => 'col-md-4', 4 => 'col-md-3');
  1692. $col_class = sh_set($columns, $cols);
  1693. $output = '';
  1694. $output .= '<section id="options"><div class="option-combo">
  1695. <ul id="filter" class="option-set" data-option-key="filter"><li><a href="#show-all" data-option-value="*" class="selected">' . __("All", SH_NAME) . '</a></li>';
  1696. $taxonomies = sh_get_categories(array('taxonomy' => 'portfolio_category'));
  1697. foreach ($taxonomies as $tax_id => $tax_name):
  1698. $output .= '<li><a href="#category' . $tax_id . '" data-option-value=".category' . $tax_id . '">' . $tax_name . '</a></li>';
  1699. endforeach;
  1700. $output .= '</ul></section>';
  1701. $output .= '<div class="row"><div id="portfolio" class="variable-sizes bounceinup">';
  1702. $loop_count = 1;
  1703. foreach ($portfolios as $portfolio):
  1704. $thumb_size = ($loop_count == 1) ? '370x491' : '370x252';
  1705. $post_term = get_the_terms($portfolio, 'portfolio_category');
  1706. $output .= '<div class="category' . sh_set(current($post_term), 'term_id') . ' ' . $col_class . '">
  1707. <div class="portfolio">
  1708. ' . get_the_post_thumbnail(sh_set($portfolio, 'ID'), $thumb_size) . '
  1709. <div class="port-desc">
  1710. <h4><a href="' . get_permalink(sh_set($portfolio, 'ID')) . '">' . get_the_title(sh_set($portfolio, 'ID')) . '</a></h4>
  1711. <p>' . substr(strip_tags(sh_set($portfolio, 'post_content')), 0, 200) . '</p>
  1712. </div>
  1713. </div>
  1714. </div>';
  1715. $loop_count++;
  1716. if ($loop_count > 2) $loop_count = 1;
  1717. endforeach;
  1718. $output .= '</div></div></div>
  1719. <script>
  1720. jQuery(document).ready(function($){
  1721. jQuery(function($){
  1722. var $portfolio = $(\'#portfolio\');
  1723. $portfolio.isotope({
  1724. masonry: {
  1725. columnWidth: 1
  1726. }
  1727. });
  1728. var $optionSets = $(\'#options .option-set\'),
  1729. $optionLinks = $optionSets.find(\'a\');
  1730. $optionLinks.click(function(){
  1731. var $this = $(this);
  1732. // don\'t proceed if already selected
  1733. if ( $this.hasClass(\'selected\') ) {
  1734. return false;
  1735. }
  1736. var $optionSet = $this.parents(\'.option-set\');
  1737. $optionSet.find(\'.selected\').removeClass(\'selected\');
  1738. $this.addClass(\'selected\');
  1739. var options = {},
  1740. key = $optionSet.attr(\'data-option-key\'),
  1741. value = $this.attr(\'data-option-value\');
  1742. // parse \'false\' as false boolean
  1743. value = value === \'false\' ? false : value;
  1744. options[ key ] = value;
  1745. if ( key === \'layoutMode\' && typeof changeLayoutMode === \'function\' ) {
  1746. // changes in layout modes need extra logic
  1747. changeLayoutMode( $this, options )
  1748. } else {
  1749. // otherwise, apply new options
  1750. $portfolio.isotope( options );
  1751. }
  1752. return false;
  1753. });
  1754. });
  1755. });
  1756. </script>
  1757. ';
  1758. return $output;
  1759. }
  1760. function portfolio_with_sidebar($atts, $contents = null)
  1761. {
  1762. extract(shortcode_atts(array(
  1763. 'cols' => '',
  1764. 'num' => '',
  1765. ), $atts)
  1766. );
  1767. wp_enqueue_script(array('jquery_isotope'));
  1768. $args = array('post_type' => 'dict_portfolio', 'posts_per_page' => $num);
  1769. $portfolios = get_posts($args);
  1770. $page_meta = get_post_meta(get_the_ID(), '_page_settings', true);
  1771. $sidebar = sh_set($page_meta, 'sidebar') ? sh_set($page_meta, 'sidebar') : 'default-sidebar';
  1772. $columns = array(2 => 'col-md-6', 3 => 'col-md-4');
  1773. $col_class = sh_set($columns, $cols);
  1774. $output = '';
  1775. $output .= '<div class="row"><div class="left-content col-md-9">
  1776. <section id="options"><div class="option-combo">
  1777. <ul id="filter" class="option-set" data-option-key="filter">
  1778. <li><a href="#show-all" data-option-value="*" class="selected">' . __("All", SH_NAME) . '</a></li>';
  1779. $taxonomies = sh_get_categories(array('taxonomy' => 'portfolio_category'));
  1780. foreach ($taxonomies as $tax_id => $tax_name):
  1781. $output .= '<li><a href="#category' . $tax_id . '" data-option-value=".category' . $tax_id . '">' . $tax_name . '</a></li>';
  1782. endforeach;
  1783. $output .= '</ul></div></section>';
  1784. $output .= '<div class="row">
  1785. <div id="portfolio" class="variable-sizes bounceinup">';
  1786. $loop_count = 1;
  1787. foreach ($portfolios as $portfolio):
  1788. $thumb_size = ($loop_count == 1) ? '370x491' : '370x252';
  1789. $post_term = get_the_terms($portfolio, 'portfolio_category');
  1790. $output .= '<div class="category' . sh_set(current($post_term), 'term_id') . ' ' . $col_class . '">
  1791. <div class="portfolio">
  1792. ' . get_the_post_thumbnail(sh_set($portfolio, 'ID'), $thumb_size) . '
  1793. <div class="port-desc">
  1794. <h4><a href="' . get_permalink(sh_set($portfolio, 'ID')) . '">' . get_the_title(sh_set($portfolio, 'ID')) . '</a></h4>
  1795. <p>' . substr(strip_tags(sh_set($portfolio, 'post_content')), 0, 200) . '</p>
  1796. </div>
  1797. </div>
  1798. </div>';
  1799. $loop_count++;
  1800. if ($loop_count > 2) $loop_count = 1;
  1801. endforeach;
  1802. $output .= '</div></div></div>';
  1803. ob_start();
  1804. dynamic_sidebar($sidebar);
  1805. $dynamic_sidebar = ob_get_contents();
  1806. ob_end_clean();
  1807. $output .= '<div class="sidebar col-md-3 ">' . $dynamic_sidebar . '</div>';
  1808. $output .= '</div>
  1809. <script>
  1810. jQuery(document).ready(function($){
  1811. jQuery(function($){
  1812. var $portfolio = $(\'#portfolio\');
  1813. $portfolio.isotope({
  1814. masonry: {
  1815. columnWidth: 1
  1816. }
  1817. });
  1818. var $optionSets = $(\'#options .option-set\'),
  1819. $optionLinks = $optionSets.find(\'a\');
  1820. $optionLinks.click(function(){
  1821. var $this = $(this);
  1822. // don\'t proceed if already selected
  1823. if ( $this.hasClass(\'selected\') ) {
  1824. return false;
  1825. }
  1826. var $optionSet = $this.parents(\'.option-set\');
  1827. $optionSet.find(\'.selected\').removeClass(\'selected\');
  1828. $this.addClass(\'selected\');
  1829. var options = {},
  1830. key = $optionSet.attr(\'data-option-key\'),
  1831. value = $this.attr(\'data-option-value\');
  1832. // parse \'false\' as false boolean
  1833. value = value === \'false\' ? false : value;
  1834. options[ key ] = value;
  1835. if ( key === \'layoutMode\' && typeof changeLayoutMode === \'function\' ) {
  1836. // changes in layout modes need extra logic
  1837. changeLayoutMode( $this, options )
  1838. } else {
  1839. // otherwise, apply new options
  1840. $portfolio.isotope( options );
  1841. }
  1842. return false;
  1843. });
  1844. });
  1845. });
  1846. </script>
  1847. ';
  1848. return $output;
  1849. }
  1850. function video_gallery($atts, $contents = null)
  1851. {
  1852. extract(shortcode_atts(array(
  1853. 'cols' => '',
  1854. 'play_options' => '',
  1855. 'links' => '',
  1856. ), $atts)
  1857. );
  1858. $vid_links = explode(',', $links);
  1859. $output = '';
  1860. $output .= '<div class="gallery-content">
  1861. <div class="row">';
  1862. foreach ($vid_links as $vid):
  1863. $video_data = sh_grab_video($vid, $vid_links);
  1864. $output .= '<div class="col-md-' . $cols . '">';
  1865. $output .= '';
  1866. $output .= ($play_options == 'simple') ?
  1867. '<div class="gallery-video"><iframe src="http://player.vimeo.com/video/' . sh_set($video_data, 'id') . '" ></iframe></div>'
  1868. : '<div class="gallery-image"><img src="' . sh_set($video_data, 'thumb') . '" alt="" />
  1869. <span>' . sh_set($video_data, 'title') . '</span>
  1870. <div class="image-lists"><ul><li><a class="video-popup html5lightbox" href="http://player.vimeo.com/video/' . sh_set($video_data, 'id') . '" data-group="group1" title=""></a></li></ul></div>
  1871. </div>';
  1872. $output .= '<h3 class="image-title"><a href="#" title="">' . sh_set($video_data, 'title') . '</a></h3>
  1873. </div>';
  1874. endforeach;
  1875. $output .= '</div></div>';
  1876. return $output;
  1877. }
  1878. function leave_message($atts, $content = null)
  1879. {
  1880. extract(shortcode_atts(array(
  1881. 'title' => 'Leave A Message',
  1882. 'text' => '',
  1883. ), $atts));
  1884. $output = '<div class="message-box">
  1885. <div class="message-box-title">
  1886. <span><i class="icon-envelope-alt"></i></span>
  1887. <p>' . $title . '</p>
  1888. <i class="icon-angle-up icon-angle-down"></i>
  1889. </div>
  1890. <div class="message-form" style="display: none;">
  1891. <p>' . $text . '</p>
  1892. <form id="lifeline_contactform_2" name="contactform" action="' . admin_url('admin-ajax.php?action=dictate_ajax_callback&subaction=sh_message_form_submit') . '" method="post">
  1893. <div class="msgs"></div>
  1894. <input type="text" placeholder="' . __("Name", SH_NAME) . '" value="" size="30" id="name" class="form-control" name="contact_name">
  1895. <input type="text" placeholder="' . __("Email", SH_NAME) . '" value="" size="30" id="email" class="form-control" name="contact_email">
  1896. <textarea placeholder="' . __("Your Message", SH_NAME) . '" class="form-control" id="comments" rows="3" name="contact_message"></textarea>
  1897. <input type="submit" value="' . __("SEND MESSAGE", SH_NAME) . '" id="submit" class="submit-btn submit">
  1898. </form>
  1899. </div>
  1900. </div>';
  1901. $output .= '';
  1902. return $output;
  1903. }
  1904. function qoutes_slider($atts, $content = null)
  1905. {
  1906. extract(shortcode_atts(array(
  1907. 'number' => 4,
  1908. ), $atts));
  1909. $options = get_option(SH_NAME);
  1910. $output = '';
  1911. $output .= '<section class="block">
  1912. <div class="client-reviews">
  1913. <ul class="slides">
  1914. ';
  1915. for ($i = 0; $i <= $number; $i++) {
  1916. $output .= '<li class="">
  1917. <div class="reviews effect5">
  1918. <h3><span>"</span>
  1919. ' . sh_set(sh_set($options, 'qoutation_text'), $i) . '
  1920. <span>"</span></h3>
  1921. </div>
  1922. </li>';
  1923. }
  1924. $output .= '</ul>
  1925. </div>
  1926. </section>
  1927. <script>
  1928. jQuery(document).ready(function($){
  1929. $(\'.client-reviews\').flexslider({
  1930. animation: "fade",
  1931. animationLoop: false,
  1932. slideShow:true,
  1933. controlNav: false,
  1934. maxItems: 1,
  1935. pausePlay: false,
  1936. mousewheel:false,
  1937. start: function(slider){
  1938. $(\'body\').removeClass(\'loadings\');
  1939. }
  1940. });
  1941. });
  1942. </script>
  1943. ';
  1944. return $output;
  1945. }
  1946. function issues_we_work($atts, $content = null)
  1947. {
  1948. extract(shortcode_atts(array(
  1949. 'section_title' => '',
  1950. 'heading_style' => 'simple',
  1951. 'number' => 4,
  1952. 'sort_by' => '',
  1953. 'sorting_order' => '',
  1954. 'category' => '',
  1955. ), $atts));
  1956. $args = array('post_type' => 'dict_causes', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1957. if ($category) $args['tax_query'] = array(array('taxonomy' => 'causes_category', 'field' => 'id', 'terms' => $category));
  1958. query_posts($args);
  1959. $output = '';
  1960. if (have_posts()): while (have_posts()): the_post();
  1961. $output .= '<div class="issue">
  1962. ' . get_the_post_thumbnail(get_the_ID(), "150x150") . '
  1963. <h4>' . get_the_title(get_the_ID()) . '</h4>
  1964. </div>';
  1965. endwhile; endif;
  1966. wp_reset_query();
  1967. $output .= '';
  1968. return $output;
  1969. }
  1970. function latest_news_slider($atts, $content = null)
  1971. {
  1972. extract(shortcode_atts(array(
  1973. 'section_title' => '',
  1974. 'heading_style' => 'simple',
  1975. 'number' => 4,
  1976. 'sort_by' => '',
  1977. 'sorting_order' => '',
  1978. 'category' => '',
  1979. ), $atts));
  1980. $args = array('post_type' => 'post', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  1981. if ($category) $args['tax_query'] = array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => $category));
  1982. $blog_posts = get_posts($args);
  1983. $posts_chunks = array_chunk($blog_posts, 4);
  1984. $output = '';
  1985. $output .= '<section><div class="row"><div class="col-md-12">';
  1986. $output .= '<div class="latest-news">
  1987. <ul class="slides">';
  1988. foreach ($posts_chunks as $chunk):
  1989. $output .= '<li><div class="row">';
  1990. foreach ($chunk as $c):
  1991. $output .= '<div class="col-md-3">
  1992. <div class="news">
  1993. <div class="news-image">
  1994. ' . get_the_post_thumbnail(sh_set($c, 'ID'), "270x155") . '
  1995. <a class="html5lightbox" href="images/blank.jpg"><i class="icon-search"></i></a>
  1996. </div>
  1997. <h3>' . get_the_title(sh_set($c, 'ID')) . '</h3>
  1998. <p>' . substr(strip_tags(sh_set($c, 'post_content')), 0, 50) . '</p>
  1999. </div>
  2000. </div>';
  2001. endforeach;
  2002. $output .= '</div></li>';
  2003. endforeach;
  2004. $output .= '</ul></div></div></div></section>
  2005. <script>
  2006. jQuery(document).ready(function($){
  2007. $(\'.latest-news\').flexslider({
  2008. animation: "slide",
  2009. animationLoop: false,
  2010. slideShow:false,
  2011. controlNav: true,
  2012. maxItems: 1,
  2013. pausePlay: false,
  2014. mousewheel:false,
  2015. start: function(slider){
  2016. $(\'body\').removeClass(\'loading\');
  2017. }
  2018. });
  2019. });
  2020. </script>
  2021. ';
  2022. return $output;
  2023. }
  2024. function projects_slider($atts, $content = null)
  2025. {
  2026. extract(shortcode_atts(array(
  2027. 'section_title' => '',
  2028. 'heading_style' => 'simple',
  2029. 'number' => 4,
  2030. 'sort_by' => '',
  2031. 'sorting_order' => '',
  2032. 'category' => '',
  2033. ), $atts));
  2034. $args = array('post_type' => 'dict_project', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  2035. if ($category) $args['tax_query'] = array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => $category));
  2036. $posts = get_posts($args);
  2037. $chunks = array_chunk($posts, 2);
  2038. $output = '';
  2039. $output .= '<section>';
  2040. $output .= '<div class="ongoing-projects"><div class="row"><ul class="slides">';
  2041. foreach ($chunks as $chunk):
  2042. $output .= '<li>
  2043. <div class="row">';
  2044. foreach ($chunk as $c):
  2045. $project_meta = get_post_meta(sh_set($c, 'ID'), '_dict_project_settings', true);
  2046. $video = sh_set((array)sh_set($project_meta, 'videos'), 0);
  2047. $video_data = sh_grab_video($video, '');
  2048. $project_thumb = ($video) ?
  2049. '<img height="252" width="270" src="' . sh_set($video_data, 'thumb') . '" alt="" />
  2050. <a class="html5lightbox" href="http://player.vimeo.com/video/' . sh_set($video_data, 'id') . '?color=ffffff" title="">
  2051. <i class="icon-play"></i>
  2052. </a>' : get_the_post_thumbnail($c->ID, array(270, 252));
  2053. $output .= '
  2054. <div class="col-md-6">
  2055. <div class="row">
  2056. <div class="col-md-6">
  2057. <div class="ongoing-project-img">
  2058. ' . $project_thumb . '
  2059. </div>
  2060. </div>
  2061. <div class="col-md-6">
  2062. <div class="ongoing-project-detail">
  2063. <h3>' . get_the_title(sh_set($c, 'ID')) . '</h3>
  2064. ' . substr(strip_tags(sh_set($c, 'post_content')), 0, 200) . '
  2065. <a href="' . get_permalink(sh_set($c, 'ID')) . '" title="">' . __("Read More", SH_NAME) . '</a>
  2066. </div>
  2067. </div>
  2068. </div>
  2069. </div>';
  2070. endforeach;
  2071. $output .= '
  2072. </div>
  2073. </li>';
  2074. endforeach;
  2075. $output .= '</ul>
  2076. </div>
  2077. </div>
  2078. </section>
  2079. <script>
  2080. jQuery(document).ready(function($){
  2081. $(\'.ongoing-projects\').flexslider({
  2082. animation: "slide",
  2083. animationLoop: false,
  2084. slideShow:false,
  2085. controlNav: false,
  2086. maxItems: 1,
  2087. pausePlay: false,
  2088. mousewheel:false,
  2089. start: function(slider){
  2090. $(\'body\').removeClass(\'loading\');
  2091. }
  2092. });
  2093. });
  2094. </script>
  2095. ';
  2096. return $output;
  2097. }
  2098. function welcome_box($atts, $content = null)
  2099. {
  2100. extract(shortcode_atts(array(
  2101. 'h_txt' => '',
  2102. 'h_desc' => '',
  2103. 'button_txt' => 'PURCHASE NOW',
  2104. 'button_url' => '',
  2105. ), $atts));
  2106. $output = '';
  2107. $output .= '<div class="welcome-box">
  2108. <h2>'.$h_txt.'</h2><p>'.$h_desc.'</p>
  2109. <a title="" href="'.$button_url.'" target="_blank"><span>'.$button_txt.'</span></a>
  2110. </div>';
  2111. return $output;
  2112. }
  2113. function parallax_video($atts, $content = null)
  2114. {
  2115. extract(shortcode_atts(array(
  2116. 'video_id' => '',
  2117. ), $atts));
  2118. $output = '';
  2119. $output .= '<div id="para_vid" class="parallax-video">
  2120. <iframe name="video-iframe" src="http://player.vimeo.com/video/'.$video_id.'?autoplay=1&amp;title=0&amp;byline=0&amp;portrait=0&amp;loop=1" width="400" height="225"></iframe>
  2121. </div>';
  2122. return $output;
  2123. }
  2124. function causes_with_carousel($atts, $content = null)
  2125. {
  2126. extract(shortcode_atts(array(
  2127. 'section_title' => '',
  2128. 'section_desc' => '',
  2129. 'number' => 4,
  2130. 'category' => '',
  2131. 'sort_by' => '',
  2132. 'sorting_order' => '',
  2133. 'use_as' => '',
  2134. ), $atts));
  2135. $output ='';
  2136. $args = array('post_type' => 'dict_causes', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  2137. if ($category) $args['tax_query'] = array(array('taxonomy' => 'causes_category', 'field' => 'id', 'terms' => $category));
  2138. $social = get_option(SH_NAME);
  2139. $post = new WP_Query( $args );
  2140. $output .= '<div class="full-section">';
  2141. if( $use_as == 'Heading' ):
  2142. $output .= '<div class="full-title">
  2143. <div class="container">
  2144. <span class="title-icon"><i class="icon-lightbulb"></i></span>
  2145. <h2>'.$section_title.'</h2>
  2146. <span>'.$section_desc.'</span>
  2147. </div>
  2148. </div>';
  2149. endif;
  2150. $output .= '<div class="big-carousel">
  2151. <ul class="slides">';
  2152. while( $post->have_posts() ): $post->the_post();
  2153. $img = wp_get_attachment_image_src(get_the_id(), 'full');
  2154. $output .= '<li>
  2155. <div class="big-picture">
  2156. <div class="fixed" style="background:url('.$img[0].');"></div>';
  2157. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail(get_the_id(), 'full'); endif;
  2158. $output .= '<div class="short-desc">
  2159. <h4>'.get_the_title().'</h4>
  2160. <p>'.substr(get_the_content(), 0, 100 ).'</p>
  2161. <a href="'.get_the_permalink().'" title="">'.__( 'Read more', SH_NAME ).'</a>
  2162. <ul>
  2163. <li><a href="'.sh_set($social, 'contact_facebook').'" title=""><i class="icon-facebook"></i></a></li>
  2164. <li><a href="'.sh_set($social, 'contact_linkedin').'" title=""><i class="icon-linkedin"></i></a></li>
  2165. <li><a href="'.sh_set($social, 'contact_gplus').'" title=""><i class="icon-google-plus"></i></a></li>
  2166. </ul>
  2167. </div>
  2168. </div>
  2169. </li>';
  2170. endwhile; wp_reset_query();wp_reset_postdata();
  2171. $output .='</ul>
  2172. </div>
  2173. </div>';
  2174. $output .='
  2175. <script>
  2176. jQuery(window).load(function(){
  2177. jQuery(".big-carousel").flexslider({
  2178. animation: "fade",
  2179. animationLoop: false,
  2180. slideShow:false,
  2181. controlNav: false,
  2182. maxItems: 1,
  2183. pausePlay: false,
  2184. mousewheel:false,
  2185. start: function(slider){
  2186. jQuery("body").removeClass("loading");
  2187. }
  2188. });
  2189. });
  2190. </script>';
  2191. return $output;
  2192. }
  2193. function services_with_pictures($atts, $content = null)
  2194. {
  2195. extract(shortcode_atts(array(
  2196. 'number' => 4,
  2197. 'layout' => '',
  2198. 'display' => '',
  2199. 'btn_text' => 'Read More',
  2200. 'sort_by' => '',
  2201. 'sorting_order' => '',
  2202. ), $atts));
  2203. $output ='';
  2204. global $post;
  2205. //$args = array('post_type' => 'dict_services', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  2206. query_posts('post_type=dict_services&posts_per_page='.$number.'&orderby='.$sort_by.'&order='.$sorting_order);
  2207. $output .= '<div class="row">';
  2208. while( have_posts() ): the_post();
  2209. $settings = get_post_meta( get_the_ID(), '_dict_services_settings', true );
  2210. $con = explode( ' ', get_the_title(), 2 );
  2211. $output .= '<div class="col-md-3">
  2212. <div class="service">';
  2213. if( $layout == "title_only" )
  2214. {
  2215. if( $display == "icon" )
  2216. {
  2217. $output .= '<i class="'.sh_set( $settings, 'font_awesome' ).'"></i>';
  2218. }else{
  2219. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( $post->ID, array(270, 155) ); endif;
  2220. }
  2221. $output .= '<h4>'.sh_set( $con, '0').' <span>'.sh_set( $con, '1').'</span></h4>
  2222. <a href="'.get_the_permalink().'" title="">'.$btn_text.'</a>';
  2223. }else{
  2224. if( $display == "icon" )
  2225. {
  2226. $output .= '<i class="'.sh_set( $settings, 'font_awesome' ).'"></i>';
  2227. }else{
  2228. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( $post->ID, array(270, 155) ); endif;
  2229. }
  2230. $output .= '<h4>'.sh_set( $con, '0').' <span>'.sh_set( $con, '1').'</span></h4>
  2231. <p>'.substr( get_the_content(), 0, 100 ).'</p>
  2232. <a href="'.get_the_permalink().'" title="">'.$btn_text.'</a>';
  2233. }
  2234. $output .= '</div>
  2235. </div>';
  2236. endwhile; wp_reset_query();wp_reset_postdata();
  2237. $output .= '</div>';
  2238. return $output;
  2239. }
  2240. function charity_statics($atts, $content = null)
  2241. {
  2242. extract(shortcode_atts(array(
  2243. 'heading' => '',
  2244. 'desc' => '',
  2245. 'box1' => '',
  2246. 'box1_txt' => '',
  2247. 'box1_bg' => '',
  2248. 'box2' => '',
  2249. 'box2_txt' => '',
  2250. 'box2_bg' => '',
  2251. 'box3' => '',
  2252. 'box3_txt' => '',
  2253. 'box3_bg' => '',
  2254. 'box4' => '',
  2255. 'box4_txt' => '',
  2256. 'box4_bg' => '',
  2257. ), $atts));
  2258. $output ='';
  2259. $output .= '<div class="row">
  2260. <div class="col-md-4">
  2261. <div class="mission">
  2262. <h4>'.$heading.'</h4>
  2263. <p>'.$desc.'</p>
  2264. </div>
  2265. </div>
  2266. <div class="col-md-8">
  2267. <div class="row">
  2268. <div class="remove-ext">';
  2269. if( $box1 != "" )
  2270. {
  2271. $img = wp_get_attachment_image_src($box1_bg, 'thumbnail');
  2272. $output .= '<div class="col-md-3">
  2273. <div class="counting">
  2274. <div style="background:url('.$img[0].')"></div>
  2275. <h3 class="count">'.$box1.'</h3>
  2276. <span>'.$box1_txt.'</span>
  2277. </div>
  2278. </div>';
  2279. }
  2280. if( $box2 != "" )
  2281. {
  2282. $img = wp_get_attachment_image_src($box2_bg, 'thumbnail');
  2283. $output .= '<div class="col-md-3">
  2284. <div class="counting">
  2285. <div style="background:url('.$img[0].')"></div>
  2286. <h3 class="count">'.$box2.'</h3>
  2287. <span>'.$box2_txt.'</span>
  2288. </div>
  2289. </div>';
  2290. }
  2291. if( $box3 != "" )
  2292. {
  2293. $img = wp_get_attachment_image_src($box3_bg, 'thumbnail');
  2294. $output .= '<div class="col-md-3">
  2295. <div class="counting">
  2296. <div style="background:url('.$img[0].')"></div>
  2297. <h3 class="count">'.$box3.'</h3>
  2298. <span>'.$box3_txt.'</span>
  2299. </div>
  2300. </div>';
  2301. }
  2302. if( $box4 != "" )
  2303. {
  2304. $img = wp_get_attachment_image_src($box4_bg, 'thumbnail');
  2305. $output .= '<div class="col-md-3">
  2306. <div class="counting">
  2307. <div style="background:url('.$img[0].')"></div>
  2308. <h3 class="count">'.$box4.'</h3>
  2309. <span>'.$box4_txt.'</span>
  2310. </div>
  2311. </div>';
  2312. }
  2313. $output .= '</div></div></div></div>';
  2314. return $output;
  2315. }
  2316. function our_mission_carousel( $atts, $content = null )
  2317. {
  2318. extract( shortcode_atts( array(
  2319. 'post_type' => '',
  2320. 'number' => 4,
  2321. 'sort_by' => '',
  2322. 'sorting_order' => '',
  2323. ), $atts));
  2324. $output = '';
  2325. $counter = 1;
  2326. $args = array( 'post_type' => $post_type, 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order );
  2327. $posts = new WP_Query( $args );
  2328. $output .= '<div class="mission-carousel">
  2329. <ul class="slides"><li><div class="row">';
  2330. if( $posts->have_posts() ): while( $posts->have_posts() ): $posts->the_post();
  2331. $output .= '';
  2332. $output .='<div class="col-md-4">
  2333. <div class="single-mission">
  2334. <div class="mission-img">
  2335. <a href="'.get_the_permalink().'" title="">';
  2336. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( get_the_id(), array(270,155) ); endif;
  2337. $output .='</div>
  2338. <h3><a href="'.get_the_permalink().'" title="">'.get_the_title().'</a></h3>
  2339. <p>'.substr( get_the_content(), 0, 100).'</p>
  2340. </div>
  2341. </div>';
  2342. if( $counter % 3 == 0 && $counter != $number ): $output.='</div></li><li><div class="row">'; endif;
  2343. $counter++;
  2344. endwhile; endif; wp_reset_query();
  2345. $output .= '</li></ul>
  2346. </div>';
  2347. $output .= '<script>
  2348. jQuery(window).load(function(){
  2349. jQuery(".mission-carousel").flexslider({
  2350. animation: "slide",
  2351. animationLoop: false,
  2352. slideShow:false,
  2353. controlNav: false,
  2354. maxItems: 1,
  2355. pausePlay: false,
  2356. mousewheel:false,
  2357. start: function(slider){
  2358. jQuery("body").removeClass("loading");
  2359. }
  2360. });
  2361. });
  2362. </script>';
  2363. return $output;
  2364. }
  2365. function sponsor( $atts, $content = null )
  2366. {
  2367. extract( shortcode_atts( array(
  2368. 'desc' => '',
  2369. 'image' => '',
  2370. 'btn_text' => '',
  2371. ), $atts));
  2372. $img = wp_get_attachment_image_src( $image, array(270,155) );
  2373. $output = '<div class="sponsor">
  2374. <img src="'.$img[0].'" alt="" />
  2375. <div class="sponsor-desc">
  2376. <p>'.rawurldecode( base64_decode( $desc ) ).'</p>
  2377. <a data-toggle="modal" data-target="#myModal" class="donate-btn" title="">'.$btn_text.'</a>
  2378. </div>
  2379. </div>';
  2380. return $output;
  2381. }
  2382. function creative_recent_news($atts, $content = null)
  2383. {
  2384. extract(shortcode_atts(array(
  2385. 'number' => '',
  2386. 'title' => __('Recent News', SH_NAME),
  2387. 'category' => '',
  2388. 'sort_by' => 'date',
  2389. 'sorting_order' => 'DESC',
  2390. 'heading_style' => 'simple',
  2391. 'limit' => 70,
  2392. ), $atts)
  2393. );
  2394. $output = '';
  2395. //$term = get_category_by_slug(strtolower(str_replace(' ', '-', $category)));
  2396. wp_reset_query();
  2397. $args = array('post_type' => 'post', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order, 'cat' => (int)$category);
  2398. $posts = new WP_Query($args);
  2399. $output .= '<div class="remove-ext">
  2400. <div class="row">';
  2401. if( $posts->have_posts() ): while( $posts->have_posts() ): $posts->the_post();
  2402. $output .='<div class="col-md-6">
  2403. <div class="recent-news">
  2404. <div class="row">
  2405. <div class="col-md-5">
  2406. <a class="news-img" href="'.get_the_permalink().'" title="">';
  2407. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( get_the_id(), array(370,252)); endif;
  2408. $output .='</a></div>
  2409. <div class="col-md-7">
  2410. <h4><a href="'.get_the_permalink().'" title="">'.get_the_title().'</a></h4>
  2411. <p>'.substr( get_the_content(), 0, $limit ).'</p>
  2412. </div>
  2413. </div>
  2414. </div>
  2415. </div>';
  2416. endwhile; endif; wp_reset_query();
  2417. $output .= '</div>
  2418. </div>';
  2419. return $output;
  2420. }
  2421. function featured_posts( $atts, $content = null )
  2422. {
  2423. extract( shortcode_atts( array(
  2424. 'post_type' => '',
  2425. 'number' => 3,
  2426. 'sort_by' => '',
  2427. 'sorting_order' => '',
  2428. ), $atts));
  2429. $output = '';
  2430. $args = array( 'post_type' => $post_type, 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order );
  2431. $posts = new WP_Query( $args );
  2432. $output .= '<div class="featured-posts">
  2433. <div class="row">';
  2434. if( $posts->have_posts() ): while( $posts->have_posts() ): $posts->the_post();
  2435. $output .= '<div class="col-md-4">
  2436. <div class="featured">
  2437. <div class="featured-img">';
  2438. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( get_the_id(), array(370,252)); endif;
  2439. $output .= '<a href="'.get_the_permalink().'" title=""><i class="icon-link"></i></a>
  2440. </div>
  2441. <div class="featured-details">
  2442. <h3><a href="'.get_the_permalink().'" title="">'.get_the_title().'</a></h3>
  2443. <p>'.substr( get_the_content(), 0, 100 ).'</p>
  2444. <a href="'.get_the_permalink().'" title="">'.__( 'Read More', SH_NAME ).'</a>
  2445. </div>
  2446. </div>
  2447. </div>';
  2448. endwhile; endif; wp_reset_query();
  2449. $output .= '</div>
  2450. </div>';
  2451. return $output;
  2452. }
  2453. function post_carousel( $atts, $content = null )
  2454. {
  2455. extract( shortcode_atts( array(
  2456. 'number' => '',
  2457. 'category' => '',
  2458. 'sort_by' => '',
  2459. 'sorting_order' => '',
  2460. ), $atts));
  2461. $output = '';
  2462. $args = array('post_type' => 'post', 'posts_per_page' => $number, 'cat' => (int)$category, 'orderby' => $sort_by, 'order' => $sorting_order);
  2463. //if ($cat != '') $args['tax_query'] = array(array('taxonomy' => 'causes_category', 'field' => 'id', 'terms' => $cat));
  2464. query_posts( $args );
  2465. $output .= '<div class="ongoing-projects">
  2466. <div class="row">
  2467. <ul class="slides">';
  2468. while( have_posts() ): the_post();
  2469. $meta = get_post_meta( get_the_ID(), '_post_settings', true );
  2470. $output .= '<li>
  2471. <div class="row">
  2472. <div class="col-md-5">
  2473. <div class="ongoing-project-img">';
  2474. if( sh_set( $meta, 'videos' ) )
  2475. {
  2476. if( sh_set( $meta['videos'], '0' ) != "" )
  2477. {
  2478. $video_link = sh_set( $meta['videos'], '0' );
  2479. $url = 'http://vimeo.com/'.$video_link;
  2480. $video_data = sh_grab_video($url, '');
  2481. $output .= '<img src="'.sh_set( $video_data, 'thumb' ).'" alt="" />';
  2482. $output .= '<a class="html5lightbox" href="http://player.vimeo.com/video/'.sh_set( $video_data, 'id' ).'?color=ffffff" title=""><i class="icon-play"></i></a>';
  2483. }
  2484. }
  2485. $output .= '</div>
  2486. </div>
  2487. <div class="col-md-7">
  2488. <div class="ongoing-project-detail">
  2489. <h3>'.get_the_title().'</h3>
  2490. <p>'.sh_excerpt( get_the_content(), 200 ).'</p>
  2491. <a href="'.get_the_permalink().'" title="">'.__( 'Read More', SH_NAME ).'</a>
  2492. </div>
  2493. </div>
  2494. </div>
  2495. </li>';
  2496. endwhile; wp_reset_query();
  2497. $output .= '</ul>
  2498. </div>
  2499. </div>';
  2500. $output .= '<script>
  2501. jQuery(window).load(function(){
  2502. jQuery(".ongoing-projects").flexslider({
  2503. animation: "slide",
  2504. animationLoop: false,
  2505. slideShow:false,
  2506. controlNav: false,
  2507. maxItems: 1,
  2508. pausePlay: false,
  2509. mousewheel:false,
  2510. start: function(slider){
  2511. jQuery("body").removeClass("loading");
  2512. }
  2513. });
  2514. });
  2515. </script>';
  2516. return $output;
  2517. }
  2518. function blockquote_carousel( $atts, $content = null )
  2519. {
  2520. extract( shortcode_atts( array(
  2521. 'desc' => '',
  2522. ), $atts )
  2523. );
  2524. $output = '';
  2525. $output .=' <div class="client-reviews">
  2526. <ul class="slides">
  2527. '.do_shortcode( $content ).'
  2528. </ul>
  2529. </div>';
  2530. $output .= "<script>
  2531. jQuery(window).load(function(){
  2532. jQuery('.client-reviews').flexslider({
  2533. animation: 'fade',
  2534. animationLoop: true,
  2535. slideShow:true,
  2536. controlNav: false,
  2537. maxItems: 1,
  2538. pausePlay: false,
  2539. mousewheel:false,
  2540. start: function(slider){
  2541. jQuery('body').removeClass('loading');
  2542. }
  2543. });
  2544. });
  2545. </script>";
  2546. return $output;
  2547. }
  2548. function blockquote_text( $atts, $content = null )
  2549. {
  2550. extract( shortcode_atts( array(
  2551. 'acc_content' => '',
  2552. ), $atts )
  2553. );
  2554. $output = '';
  2555. $output .= '<li>
  2556. <div class="reviews effect5">
  2557. <h3><span>"</span>
  2558. '.$acc_content.'
  2559. <span>"</span></h3>
  2560. </li>';
  2561. return $output;
  2562. }
  2563. function causes_with_thumb( $atts, $content = null )
  2564. {
  2565. extract(shortcode_atts(array(
  2566. 'number' => '',
  2567. 'cat' => '',
  2568. 'sort_by' => 'date',
  2569. 'sorting_order' => 'ASC',
  2570. ), $atts)
  2571. );
  2572. $output = '';
  2573. $args = array('post_type' => 'dict_causes', 'posts_per_page' => $number, 'orderby' => $sort_by, 'order' => $sorting_order);
  2574. if ($cat != '') $args['tax_query'] = array(array('taxonomy' => 'causes_category', 'field' => 'id', 'terms' => $cat));
  2575. $query = new WP_Query( $args );
  2576. while( $query->have_posts() ): $query->the_post();
  2577. $output .= '<div class="issue">';
  2578. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( get_the_ID(), array(80,80) ); endif;
  2579. $output .= '<h4><a href="'.get_the_permalink().'">'.get_the_title().'</a></h4>
  2580. </div>';
  2581. endwhile; wp_reset_query();
  2582. return $output;
  2583. }
  2584. function latest_news_carousel( $atts, $content = null )
  2585. {
  2586. extract( shortcode_atts( array(
  2587. 'number' => '',
  2588. 'cat' => '',
  2589. 'sort_by' => '',
  2590. 'sorting_order' => '',
  2591. ), $atts));
  2592. $output = '';
  2593. $counter = 1;
  2594. $args = array('post_type' => 'post', 'posts_per_page' => $number, 'category_name' => $cat, 'orderby' => $sort_by, 'order' => $sorting_order);
  2595. query_posts( $args );
  2596. $output .= '<div class="latest-news">
  2597. <ul class="slides"><li><div class="row">';
  2598. if( have_posts() ): while( have_posts() ): the_post();
  2599. $output .= '';
  2600. $output .='<div class="col-md-4">
  2601. <div class="news">
  2602. <div class="news-image">';
  2603. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( get_the_id(), array(270,155) ); endif;
  2604. $output .='<a href="'.get_the_permalink().'" title=""><i class="icon-link"></i></a></div>
  2605. <h3>'.get_the_title().'</h3>
  2606. <p>'.substr( get_the_content(), 0, 100).'</p>
  2607. </div>
  2608. </div>';
  2609. if( $counter % 3 == 0 && $counter != $number ): $output.='</div></li><li>'; endif;
  2610. $counter++;
  2611. endwhile; endif; wp_reset_query();
  2612. $output .= '</li></ul>';
  2613. $output .= "<script>
  2614. jQuery(window).load(function(){
  2615. jQuery('.latest-news').flexslider({
  2616. animation: 'slide',
  2617. animationLoop: true,
  2618. slideShow:false,
  2619. controlNav: true,
  2620. maxItems: 1,
  2621. pausePlay: false,
  2622. mousewheel:false,
  2623. start: function(slider){
  2624. jQuery('body').removeClass('loading');
  2625. }
  2626. });
  2627. });
  2628. </script>";
  2629. return $output;
  2630. }
  2631. function fancy_causes( $atts, $content = null )
  2632. {
  2633. extract( shortcode_atts( array(
  2634. 'post_id' => '',
  2635. ), $atts));
  2636. $output = '';
  2637. $args = array(
  2638. 'p' => $post_id,
  2639. 'post_type' => 'dict_causes',
  2640. 'posts_per_page' => 1,
  2641. );
  2642. query_posts($args);
  2643. while( have_posts() ): the_post();
  2644. $Settings = get_post_meta( $post_id, '_dict_causes_settings', true);
  2645. $output .= '<div class="fancy-cause">';
  2646. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( $post_id, array(370,252) ); endif;
  2647. $output .= '<div class="fancy-cause-intro">
  2648. <i>'.__( 'in', SH_NAME ).'&nbsp;<a href="'.get_the_permalink().'" title="">'.sh_set($Settings, 'location').'</a></i>
  2649. <h3>'.get_the_title().'</h3>
  2650. <span><strong>'.sh_set($Settings, 'currency_symbol').'</strong>&nbsp;'.sh_set($Settings, 'donation_needed').'&nbsp;<i>'.__( 'Donation Needed', SH_NAME ).'</i></span>
  2651. </div>
  2652. <div class="fancy-cause-hover">
  2653. <p>'.sh_excerpt( get_the_content(), 150 ).'</p>
  2654. <span>'.__( 'Help Us:', SH_NAME ).' <strong>'.sh_set($Settings, 'currency_symbol').'</strong> <i>'.sh_set($Settings, 'donation_needed').'</i></span>
  2655. <span><a data-toggle="modal" data-target="#myModal" title="">'.__( 'Donate Now', SH_NAME ).'</a><a href="'.get_the_permalink().'" title="">'.__( 'Read More', SH_NAME ).'</a></span>
  2656. </div>
  2657. </div>';
  2658. endwhile; wp_reset_query();
  2659. return $output;
  2660. }
  2661. function fancy_causes_2( $atts, $content = null )
  2662. {
  2663. extract( shortcode_atts( array(
  2664. 'post_id' => '',
  2665. ), $atts));
  2666. $output = '';
  2667. $args = array(
  2668. 'p' => $post_id,
  2669. 'post_type' => 'dict_causes',
  2670. 'posts_per_page' => 1,
  2671. );
  2672. query_posts($args);
  2673. while( have_posts() ): the_post();
  2674. $Settings = get_post_meta( $post_id, '_dict_causes_settings', true);
  2675. $output .= '<div class="our-cause">
  2676. <div class="our-cause-img">';
  2677. if( has_post_thumbnail() ): $output .= get_the_post_thumbnail( $post_id, array(370,252) ); endif;
  2678. $output .= '<a href="'.get_the_permalink().'" title="'.get_the_title().'"><i class="icon-link"></i></a></div>
  2679. <div class="our-cause-detail">
  2680. <h3>'.get_the_title().'</h3>
  2681. <span>'.__( 'in', SH_NAME ).'&nbsp;<a href="'.get_the_permalink().'" title="">'.sh_set($Settings, 'location').'</a></span>
  2682. <p>'.sh_excerpt( get_the_content(), 150 ).'</p>
  2683. <i>'.__( 'Help Us:', SH_NAME ).' <span>'.sh_set($Settings, 'currency_symbol').'</span> <strong>&nbsp;'.sh_set($Settings, 'donation_needed').'</strong></i>
  2684. <a data-toggle="modal" data-target="#myModal" title="">'.__( 'Donate Now', SH_NAME ).'</a>
  2685. </div>
  2686. </div>';
  2687. endwhile; wp_reset_query();
  2688. return $output;
  2689. }
  2690. }