fork download
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  3.  
  4.  
  5. if (!class_exists('VC_PW_grid')) {
  6. class VC_PW_grid {
  7. public $pw_title,
  8. $pw_query,
  9. $pw_grid_type,
  10.  
  11. $pw_border_top_size,
  12. $pw_border_top_type,
  13. $pw_border_top_color,
  14.  
  15. $pw_border_right_size,
  16. $pw_border_right_type,
  17. $pw_border_right_color,
  18.  
  19. $pw_border_bottom_size,
  20. $pw_border_bottom_type,
  21. $pw_border_bottom_color,
  22.  
  23. $pw_border_left_size,
  24. $pw_border_left_type,
  25. $pw_border_left_color,
  26.  
  27.  
  28. $pw_back_color,
  29. $pw_back_hcolor,
  30. $pw_item_back_color,
  31.  
  32.  
  33. $pw_title_font_family,
  34. $pw_title_font_size,
  35. $pw_link_color,
  36. $pw_link_hover_color,
  37. $pw_meta_font_family,
  38. $pw_meta_font_size,
  39. $pw_meta_color,
  40. $pw_excerpt_font_family,
  41. $pw_excerpt_font_size,
  42. $pw_excerpt_color,
  43. $pw_readmore_type,
  44. $pw_readmore_translate,
  45.  
  46. $pw_link_target,
  47. $pw_post_layout,
  48. $pw_grid_desktop_columns_count,
  49. $pw_grid_tablet_columns_count,
  50. $pw_grid_mobile_columns_count,
  51. $pw_skin_type,
  52. $pw_grid_skin_effect,
  53. $pw_grid_page_navigation,
  54. $pw_grid_page_number_style,
  55. $pw_grid_filter_by,
  56. $pw_grid_order_by,
  57.  
  58.  
  59. $pw_grid_author,
  60. $pw_grid_tags,
  61. $pw_grid_show_num_comment,
  62.  
  63. $pw_grid_hide_recentpost, //default:show
  64. $pw_grid_num_hide_recentpost,
  65.  
  66. $pw_grid_switch_icon,
  67. $pw_teasr_layout_img,
  68. $pw_image_thumb_size,
  69. $pw_excerpt_length,
  70. $pw_image_effect,
  71. $pw_show_zoom_icon,
  72. $pw_show_link_icon,
  73. $pw_show_overlay,
  74. $pw_icon_type,
  75. $pw_icon_effect,
  76.  
  77.  
  78. $pw_hide_date,
  79. $pw_date_format,
  80. $pw_taxonomy,
  81. $pw_grid_display_type,
  82. $pw_box_ids;
  83.  
  84. function __construct(
  85. $pw_title,
  86. $pw_query,
  87. $pw_grid_display_type,
  88. $pw_grid_type,
  89.  
  90.  
  91. $pw_border_top_size,
  92. $pw_border_top_type,
  93. $pw_border_top_color,
  94.  
  95. $pw_border_right_size,
  96. $pw_border_right_type,
  97. $pw_border_right_color,
  98.  
  99. $pw_border_bottom_size,
  100. $pw_border_bottom_type,
  101. $pw_border_bottom_color,
  102.  
  103. $pw_border_left_size,
  104. $pw_border_left_type,
  105. $pw_border_left_color,
  106.  
  107. $pw_back_color,
  108. $pw_back_hcolor,
  109. $pw_item_back_color,
  110.  
  111.  
  112. $pw_title_font_family,
  113. $pw_title_font_size,
  114. $pw_link_color,
  115. $pw_link_hover_color,
  116. $pw_meta_font_family,
  117. $pw_meta_font_size,
  118. $pw_meta_color,
  119. $pw_excerpt_font_family,
  120. $pw_excerpt_font_size,
  121. $pw_excerpt_color,
  122. $pw_readmore_type,
  123. $pw_readmore_translate,
  124.  
  125. $pw_link_target,
  126. $pw_post_layout,
  127. $pw_grid_desktop_columns_count,
  128. $pw_grid_tablet_columns_count,
  129. $pw_grid_mobile_columns_count,
  130. $pw_skin_type,
  131. $pw_grid_skin_effect,
  132. $pw_grid_page_navigation,
  133. $pw_grid_page_number_style,
  134. $pw_grid_filter_by,
  135. $pw_grid_order_by,
  136.  
  137.  
  138. $pw_grid_author,
  139. $pw_grid_tags,
  140. $pw_grid_show_num_comment,
  141.  
  142. $pw_grid_hide_recentpost, //default:show
  143. $pw_grid_num_hide_recentpost,
  144.  
  145. $pw_grid_switch_icon,
  146. $pw_teasr_layout_img,
  147. $pw_image_thumb_size,
  148. $pw_excerpt_length,
  149. $pw_image_effect,
  150. $pw_show_zoom_icon,
  151. $pw_show_link_icon,
  152. $pw_show_overlay,
  153. $pw_icon_type,
  154. $pw_icon_effect,
  155. $pw_hide_date,
  156. $pw_date_format,
  157. $pw_taxonomy
  158. ) {
  159.  
  160. $this->pw_title=$pw_title;
  161. $this->pw_query=$pw_query;
  162. $this->pw_grid_type=$pw_grid_type;
  163. //My Variables
  164. $this->pw_border_top_size = $pw_border_top_size;
  165. $this->pw_border_top_type = $pw_border_top_type;
  166. $this->pw_border_top_color = $pw_border_top_color;
  167.  
  168. $this->pw_border_right_size = $pw_border_right_size;
  169. $this->pw_border_right_type = $pw_border_right_type;
  170. $this->pw_border_right_color = $pw_border_right_color;
  171.  
  172. $this->pw_border_bottom_size = $pw_border_bottom_size;
  173. $this->pw_border_bottom_type = $pw_border_bottom_type;
  174. $this->pw_border_bottom_color = $pw_border_bottom_color;
  175.  
  176. $this->pw_border_left_size = $pw_border_left_size;
  177. $this->pw_border_left_type = $pw_border_left_type;
  178. $this->pw_border_left_color = $pw_border_left_color;
  179.  
  180. $this->pw_back_color = $pw_back_color;
  181. $this->pw_back_hcolor = $pw_back_hcolor;
  182. $this->pw_item_back_color = $pw_item_back_color;
  183.  
  184. $this->pw_title_font_family=$pw_title_font_family;
  185. $this->pw_title_font_size=($pw_title_font_size==0 ? 14:$pw_title_font_size);
  186. $this->pw_link_color = $pw_link_color;
  187. $this->pw_link_hover_color = $pw_link_hover_color;
  188. $this->pw_meta_font_family=$pw_meta_font_family;
  189. $this->pw_meta_font_size=($pw_meta_font_size==0 ? 12:$pw_meta_font_size);
  190. $this->pw_meta_color = $pw_meta_color;
  191. $this->pw_excerpt_font_family=$pw_excerpt_font_family;
  192. $this->pw_excerpt_font_size=($pw_excerpt_font_size==0 ? 11:$pw_excerpt_font_size);
  193. $this->pw_excerpt_color = $pw_excerpt_color;
  194. $this->pw_readmore_type = $pw_readmore_type;
  195. $this->pw_readmore_translate = $pw_readmore_translate;
  196.  
  197. $this->pw_grid_desktop_columns_count=$pw_grid_desktop_columns_count;
  198. $this->pw_grid_tablet_columns_count=$pw_grid_tablet_columns_count;
  199. $this->pw_grid_mobile_columns_count=$pw_grid_mobile_columns_count;
  200. $this->pw_skin_type=$pw_skin_type;
  201. $this->pw_grid_skin_effect=$pw_grid_skin_effect;
  202. $this->pw_link_target=$pw_link_target;
  203. $this->pw_post_layout=$pw_post_layout;
  204. $this->pw_grid_page_navigation=$pw_grid_page_navigation;
  205. $this->pw_grid_page_number_style=$pw_grid_page_number_style;
  206. $this->pw_grid_filter_by=$pw_grid_filter_by;
  207. $this->pw_grid_order_by=$pw_grid_order_by;
  208.  
  209.  
  210. $this->pw_grid_author=$pw_grid_author;
  211. $this->pw_grid_tags=$pw_grid_tags;
  212. $this->pw_grid_show_num_comment=$pw_grid_show_num_comment;
  213.  
  214. $this->pw_grid_hide_recentpost=$pw_grid_hide_recentpost;
  215. $this->pw_grid_num_hide_recentpost=$pw_grid_num_hide_recentpost;
  216.  
  217. $this->pw_grid_switch_icon=$pw_grid_switch_icon;
  218. $this->pw_teasr_layout_img=$pw_teasr_layout_img;
  219. $this->pw_image_thumb_size=$pw_image_thumb_size;
  220. $this->pw_excerpt_length=$pw_excerpt_length;
  221. $this->pw_image_effect=$pw_image_effect;
  222.  
  223. $this->pw_show_zoom_icon=$pw_show_zoom_icon;
  224. $this->pw_show_link_icon=$pw_show_link_icon;
  225. $this->pw_show_overlay=$pw_show_overlay;
  226. $this->pw_icon_type=$pw_icon_type;
  227.  
  228. $this->pw_icon_effect=$pw_icon_effect;
  229. $this->pw_hide_date=$pw_hide_date;
  230. $this->pw_date_format=$pw_date_format;
  231. $this->pw_taxonomy=$pw_taxonomy;
  232. $this->pw_grid_display_type=$pw_grid_display_type;
  233.  
  234.  
  235. $this->vars=get_defined_vars();
  236. //print_r($arr);
  237.  
  238.  
  239. $this->pw_front_end();
  240.  
  241. $this->pl_custom_font();
  242. $this->pl_grid_custom_color();
  243.  
  244. $this->pl_list_custom_color();
  245.  
  246. }
  247.  
  248. function pw_front_end()
  249. {
  250. global $VCExtendAddonClass_GRID,$output;
  251.  
  252. $loop=$this->pw_query;
  253. $grid_link = $grid_layout_mode = $title = $filter= '';
  254. $posts = array();
  255.  
  256.  
  257. $paged = 1;
  258. $query=$this->pw_query;
  259. $query=explode('|',$query);
  260.  
  261. $query_posts_per_page=10;
  262. $query_post_type='post';
  263. $query_meta_key='';
  264. $query_orderby='date';
  265. $query_order='ASC';
  266.  
  267. $query_by_id='';
  268. $query_by_id_not_in='';
  269. $query_by_id_in='';
  270.  
  271. $query_categories='';
  272. $query_cat_not_in='';
  273. $query_cat_in='';
  274.  
  275. $query_tags='';
  276. $query_tags_in='';
  277. $query_tags_not_in='';
  278.  
  279. $query_author='';
  280. $query_author_in='';
  281. $query_author_not_in='';
  282.  
  283. $query_tax_query='';
  284.  
  285.  
  286. foreach($query as $query_part)
  287. {
  288. $q_part=explode(':',$query_part);
  289. switch($q_part[0])
  290. {
  291. case 'post_type':
  292. $query_post_type=explode(',',$q_part[1]);
  293. break;
  294.  
  295. case 'size':
  296. $query_posts_per_page=($q_part[1]=='All' ? -1:$q_part[1]);
  297. break;
  298.  
  299. case 'order_by':
  300.  
  301. $query_meta_key='';
  302. $query_orderby='';
  303.  
  304. $public_orders_array=array('ID','date','author','title','modified','rand','comment_count','menu_order');
  305. if(in_array($q_part[1],$public_orders_array))
  306. {
  307. $query_orderby=$q_part[1];
  308. }else
  309. {
  310. $query_meta_key=$q_part[1];
  311. $query_orderby='meta_value_num';
  312. }
  313.  
  314. break;
  315.  
  316. case 'order':
  317. $query_order=$q_part[1];
  318. break;
  319.  
  320. case 'by_id':
  321. $query_by_id=explode(',',$q_part[1]);
  322. $query_by_id_not_in=array();
  323. $query_by_id_in=array();
  324. foreach($query_by_id as $ids)
  325. {
  326. if($ids<0)
  327. {
  328. $query_by_id_not_in[]=abs($ids);
  329. }else
  330. {
  331. $query_by_id_in[]=$ids;
  332. }
  333. }
  334. break;
  335.  
  336. case 'categories':
  337. $query_categories=explode(',',$q_part[1]);
  338. $query_cat_not_in=array();
  339. $query_cat_in=array();
  340. foreach($query_categories as $cat)
  341. {
  342. if($cat<0)
  343. {
  344. $query_cat_not_in[]=abs($cat);
  345. }else
  346. {
  347. $query_cat_in[]=$cat;
  348. }
  349. }
  350. break;
  351.  
  352. case 'tags':
  353. $query_tags=explode(',',$q_part[1]);
  354. $query_tags_not_in=array();
  355. $query_tags_in=array();
  356. foreach($query_tags as $tags)
  357. {
  358. if($tags<0)
  359. {
  360. $query_tags_not_in[]=abs($tags);
  361. }else
  362. {
  363. $query_tags_in[]=$tags;
  364. }
  365. }
  366. break;
  367.  
  368. case 'authors':
  369. $query_author=explode(',',$q_part[1]);
  370. $query_author_not_in=array();
  371. $query_author_in=array();
  372. foreach($query_author as $author)
  373. {
  374. if($tags<0)
  375. {
  376. $query_author_not_in[]=abs($author);
  377. }else
  378. {
  379. $query_author_in[]=$author;
  380. }
  381. }
  382.  
  383. break;
  384.  
  385. case 'tax_query':
  386. $all_tax=get_object_taxonomies( $query_post_type );
  387.  
  388.  
  389.  
  390.  
  391.  
  392. $tax_query=array();
  393. $query_tax_query=array('relation' => 'OR');
  394. foreach ( $all_tax as $tax ) {
  395.  
  396.  
  397.  
  398.  
  399. $values=$tax;
  400. $query_taxs_in=array();
  401. $query_taxs_not_in=array();
  402.  
  403. $query_taxs=explode(',',$q_part[1]);
  404. foreach($query_taxs as $taxs)
  405. {
  406.  
  407. if($taxs<0)
  408. {
  409. $query_taxs_not_in[]=abs($taxs);
  410. }else
  411. {
  412. $query_taxs_in[]=$taxs;
  413. }
  414. }
  415.  
  416.  
  417.  
  418.  
  419.  
  420. if(count($query_taxs_not_in)>0)
  421. {
  422. $query_tax_query[]=array(
  423. 'taxonomy' => $tax,
  424. 'field' => 'id',
  425. 'terms' => $query_taxs_not_in,
  426. 'operator' => 'NOT IN',
  427. );
  428. }else if(count($query_taxs_in)>0)
  429. {
  430. $query_tax_query[]=array(
  431. 'taxonomy' => $tax,
  432. 'field' => 'id',
  433. 'terms' => $query_taxs_in,
  434. 'operator' => 'IN',
  435. );
  436. }
  437.  
  438.  
  439.  
  440.  
  441. //break;
  442. }
  443.  
  444.  
  445. /*$query_tax_query=array(
  446. 'relation' => 'AND',
  447. $tax_query,
  448. );*/
  449. //die(print_r($query_tax_query));
  450. break;
  451. }
  452. }
  453. //tax_query:5|by_id:1060
  454.  
  455. if($this->pw_grid_hide_recentpost=='yes')
  456. {
  457.  
  458. $query_final=array('post_type' => $query_post_type,
  459. 'post_status'=>'publish',
  460. 'posts_per_page'=>$this->pw_grid_num_hide_recentpost,
  461. 'meta_key' => $query_meta_key,
  462. 'orderby' => 'date',
  463. 'order' => 'DESC',
  464. 'paged'=>1,
  465.  
  466. 'category__in'=>$query_cat_in,
  467. 'category__not_in'=>$query_cat_not_in,
  468.  
  469. 'tag__in'=>$query_tags_in,
  470. 'tag__not_in'=>$query_tags_not_in,
  471.  
  472. 'author__in'=>$query_author_in,
  473. 'author__not_in'=>$query_author_not_in,
  474.  
  475. 'tax_query'=>$query_tax_query
  476. );
  477. $my_query = new WP_Query($query_final);
  478. $recent_posts=array();
  479. while ( $my_query->have_posts() ) {
  480. $my_query->the_post();
  481. $recent_posts[]=get_the_ID();
  482. }
  483.  
  484. if(is_array($query_by_id_not_in))
  485. $query_by_id_not_in=array_merge($query_by_id_not_in,$recent_posts);
  486. else
  487. $query_by_id_not_in=$recent_posts;
  488. }
  489.  
  490. $query_final=array('post_type' => $query_post_type,
  491. 'post_status'=>'publish',
  492. 'posts_per_page'=>$query_posts_per_page,
  493. 'meta_key' => $query_meta_key,
  494. 'orderby' => $query_orderby,
  495. 'order' => $query_order,
  496. 'paged'=>$paged,
  497.  
  498. 'post__in'=>$query_by_id_in,
  499. 'post__not_in'=>$query_by_id_not_in,
  500.  
  501. 'category__in'=>$query_cat_in,
  502. 'category__not_in'=>$query_cat_not_in,
  503.  
  504. 'tag__in'=>$query_tags_in,
  505. 'tag__not_in'=>$query_tags_not_in,
  506.  
  507. 'author__in'=>$query_author_in,
  508. 'author__not_in'=>$query_author_not_in,
  509.  
  510. 'tax_query'=>$query_tax_query
  511. );
  512.  
  513. //die(print_r($query_final));
  514.  
  515.  
  516.  
  517.  
  518. $all_tax=get_object_taxonomies( $query_post_type );
  519.  
  520.  
  521.  
  522. ////////////DETERMINE WHICH CATEGORY TERMS DISPLAY IN CATEGORY DROP DOWN////////////
  523. $query_final_cat=array('post_type' => $query_post_type,
  524. 'post_status'=>'publish',
  525. 'posts_per_page'=>-1,
  526. 'meta_key' => $query_meta_key,
  527. 'orderby' => $query_orderby,
  528. 'order' => $query_order,
  529. //'paged'=>$paged,
  530.  
  531. 'post__in'=>$query_by_id_in,
  532. 'post__not_in'=>$query_by_id_not_in,
  533.  
  534. 'category__in'=>$query_cat_in,
  535. 'category__not_in'=>$query_cat_not_in,
  536.  
  537. 'tag__in'=>$query_tags_in,
  538. 'tag__not_in'=>$query_tags_not_in,
  539.  
  540. 'author__in'=>$query_author_in,
  541. 'author__not_in'=>$query_author_not_in,
  542.  
  543. 'tax_query'=>$query_tax_query
  544. );
  545.  
  546. $my_query = new WP_Query($query_final_cat);
  547. $main_include_cat_ids='';
  548. while ( $my_query->have_posts() ) {
  549. $my_query->the_post(); // Get post from query
  550. //$post = new stdClass(); // Creating post object.
  551. $id= $my_query->post->ID;
  552. foreach ( $all_tax as $post_taxs ) {
  553. $taxonomy=get_taxonomy($post_taxs);
  554.  
  555. $values=$post_taxs;
  556. $label=$taxonomy->label;
  557. $post_tax_fetch=get_the_terms( $id, $post_taxs );
  558.  
  559. //echo $post_taxs.'</br >';
  560. //echo $post_tax->term_id;
  561. //print_r($post_tax);
  562.  
  563. $include_cat_ids[$post_taxs]='';
  564. if(is_array($post_tax_fetch)){
  565. foreach($post_tax_fetch as $term_post_tax){
  566. $include_cat_ids[$post_taxs][]=$term_post_tax->term_id;
  567. }
  568. }
  569.  
  570. if(isset($main_include_cat_ids[$post_taxs]) && is_array($main_include_cat_ids[$post_taxs])){
  571. if(is_array($include_cat_ids[$post_taxs]))
  572. $main_include_cat_ids[$post_taxs]=array_merge($main_include_cat_ids[$post_taxs],$include_cat_ids[$post_taxs]);
  573. $main_include_cat_ids[$post_taxs]=array_unique($main_include_cat_ids[$post_taxs]);
  574. }
  575. else
  576. {
  577. $main_include_cat_ids[$post_taxs]=$include_cat_ids[$post_taxs];
  578. }
  579.  
  580. //echo '</br ><strong>'.$post_taxs.'</strong> - ';
  581. //print_r($main_include_cat_ids[$post_taxs]);
  582. }
  583. //$post->id = get_the_ID();
  584. //echo '</br >';
  585. //print_r($main_include_cat_ids);
  586. //echo '<br />============================<br />';
  587.  
  588. }
  589. //echo '</br >';
  590. $main_include_cat_ids=(is_array($main_include_cat_ids) ? array_filter($main_include_cat_ids) : "");
  591. //die(print_r($main_include_cat_ids));
  592. ////////////DETERMINE WHICH CATEGORY TERMS DISPLAY IN CATEGORY DROP DOWN////////////
  593.  
  594. $my_query = new WP_Query($query_final);
  595.  
  596. $img_id=array();
  597. $img_counter = 0;
  598. $output = '<div style="display:none"><img src="'.PW_PS_PL_URL_GRID.'/assets/images/loader.gif" /></div>';
  599. $post_counter = 0;
  600. $this->pw_grid_id =$this->pw_list_id = $rand_id = rand(6000,7000);
  601. $output .= '<h2 class="pl-itemtitle">'.$this->pw_title.'</h2>';
  602. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  603.  
  604. if ($this->pw_grid_type=='pl-standard-grid' || $this->pw_grid_type=='pl-mixitup-grid'){
  605.  
  606.  
  607. /////////////MIXITUP MODE --- GRID FILTER AND ORDER///////////////
  608. $order_by=$order_value='';
  609. $filters=array();
  610. $z_index = 9999;
  611. if($this->pw_grid_type=='pl-mixitup-grid')
  612. {
  613. $output='
  614. <div class="property_grid pl-grid-controls" id="Filters_'.$this->pw_grid_id.'">';
  615. if($this->pw_grid_filter_by=='yes')
  616. {
  617. $taxs=explode(',',$this->pw_taxonomy);
  618.  
  619. $query_not_in=array();
  620. if(is_array($query_cat_not_in) && (is_array($query_tags_not_in)))
  621. $query_not_in=array_merge($query_cat_not_in,$query_tags_not_in);
  622. else if(is_array($query_cat_not_in))
  623. $query_not_in=$query_cat_not_in;
  624. else if((is_array($query_tags_not_in)))
  625. $query_not_in=$query_tags_not_in;
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632. if(is_array($taxs) && count($taxs)>1)
  633. {
  634. foreach($taxs as $tax)
  635. {
  636.  
  637. if(!isset($main_include_cat_ids[$tax]))
  638. continue;
  639.  
  640.  
  641. $taxonomy=get_taxonomy($tax);
  642.  
  643.  
  644.  
  645. $filters[]=str_replace('-','_',$tax);
  646.  
  647. $z_index -= 1 ;
  648. $output.='
  649. <div class="pl-drop_down wf" style="z-index:'.$z_index.';">
  650. <span class="pl-anim150">Filtrar por '.__($taxonomy->label,'gt_fa').'</span>
  651. <ul class="pl-anim250">
  652. <li class="active" data-filter="all" data-dimension="grid_filter_'.str_replace('-','_',$tax).'">'.__("Ver todos", __PW_POST_LAYOUT_TEXTDOMAN__ ).'</li>
  653. ';
  654. $arg=array(
  655. 'hide_empty' => true,
  656. 'include' => (isset($main_include_cat_ids[$tax])?$main_include_cat_ids[$tax]:array()),
  657. );
  658.  
  659.  
  660. $terms = get_terms($tax,$arg);
  661. foreach ($terms as $term){
  662. if(!in_array("-".$term->term_id,$query_not_in))
  663. $output.='<li data-dimension="grid_filter_'.str_replace('-','_',$tax).'" data-filter="'.strtolower($term->term_id).'" >'.$term->name.'</li>';
  664.  
  665. }
  666. $output.='
  667. </ul>
  668. </div>';
  669. }
  670. }else if( $this->pw_taxonomy != '' && isset($main_include_cat_ids[$this->pw_taxonomy]))
  671. {
  672.  
  673. $tax=get_taxonomy( $this->pw_taxonomy );
  674.  
  675. $filters[]=str_replace('-','_',$this->pw_taxonomy);
  676.  
  677. $output.='
  678. <div class="pl-drop_down wf">
  679. <span class="pl-anim150">Filtrar por '.__($taxonomy->label,'gt_fa').'</span>
  680. <ul class="pl-anim250">
  681. <li class="active" data-filter="all" data-dimension="grid_filter_'.str_replace('-','_',$this->pw_taxonomy).'">'.__("Ver todos", __PW_POST_LAYOUT_TEXTDOMAN__ ).'</li>
  682. ';
  683.  
  684. $arg=array(
  685. 'hide_empty' => true,
  686. 'include' => (isset($main_include_cat_ids[$this->pw_taxonomy])?$main_include_cat_ids[$this->pw_taxonomy]:array()),
  687. );
  688.  
  689.  
  690. $terms = get_terms($this->pw_taxonomy,$arg);
  691. //$terms = get_terms($this->pw_taxonomy,'hide_empty=1');
  692.  
  693.  
  694. foreach ($terms as $term){
  695. if(!in_array("-".$term->term_id,$query_not_in))
  696. $output.='<li data-dimension="grid_filter_'.str_replace('-','_',$this->pw_taxonomy).'" data-filter="'.strtolower($term->term_id).'" >'.$term->name.'</li>';
  697.  
  698. }
  699. $output.='
  700. </ul>
  701. </div>';
  702. }
  703. }
  704.  
  705. if($this->pw_grid_order_by=='yes')
  706. {
  707. $query_output=$this->pw_query;
  708. $query_output=explode('|',$query_output);
  709. $order_by='date';
  710. $order='ASC';
  711.  
  712. foreach($query_output as $query_fields)
  713. {
  714. $order_field=explode(':',$query_fields);
  715. if($order_field[0]=='order_by')
  716. $order_by=$order_field[1];
  717. if($order_field[0]=='order')
  718. $order=$order_field[1];
  719. }
  720.  
  721. $output .= '
  722. <div class="pl-meta">
  723. <div class="meta-title">'.ucwords ( str_replace('_',' ',$order_by) ).'</div>
  724.  
  725. <span title="Sort Ascending" class="sort-'.$order_by.'-'.$this->pw_grid_id.' pl-anim150 desc '.(strtolower($order)=='desc' ? "active":"").' " data-sort="data-'.$order_by.'-'.$this->pw_grid_id.'" data-order="asc"></span>
  726. <span title="Sort Descending" class="sort-'.$order_by.'-'.$this->pw_grid_id.' pl-anim150 asc '.(strtolower($order)=='asc' ? "active":"").'" data-sort="data-'.$order_by.'-'.$this->pw_grid_id.'" data-order="desc"></span>
  727. </div>';
  728. }
  729. if($this->pw_grid_switch_icon!='yes')
  730. {
  731. $output.='<div class="view-type-cnt">
  732.  
  733. <div title="'.__('Grid View',__PW_POST_LAYOUT_TEXTDOMAN__).'" class="pw_view_type_'.$this->pw_grid_id.' view-btn pl-gridview '.($this->pw_grid_display_type=='grid' ? "active":"").' " data-viewtype="grid" id="grid_view" ><i class="fa fa-th-large"></i></div>
  734. <div title="'.__('List View',__PW_POST_LAYOUT_TEXTDOMAN__).'" class="pw_view_type_'.$this->pw_grid_id.' view-btn pl-listview '.($this->pw_grid_display_type=='list' ? "active":"").'" data-viewtype="list" id="list_view" ><i class="fa fa-th-list"></i></div>
  735. </div>';
  736. }
  737. $output .= '</div>';
  738.  
  739.  
  740.  
  741.  
  742.  
  743. $output .= '<div class="grid pl-gridlayout '.$this->pw_skin_type .' ' .$this->pw_grid_type .' pl_grid_id_'.$this->pw_grid_id.' " id="Grid_'.$this->pw_grid_id.'" >';
  744. }
  745. else if($this->pw_grid_type=='pl-standard-grid')
  746. {
  747. $output .= '<div class="pl-gridlayout '.$this->pw_skin_type .' ' .$this->pw_grid_type .' pl_grid_id_'.$this->pw_grid_id.'" id="Grid_'.$this->pw_grid_id.'" >';
  748. }
  749. /////////////END FILTER AND ORDER//////////////
  750.  
  751. while ( $my_query->have_posts() ) {
  752. $my_query->the_post(); // Get post from query
  753. $post = new stdClass(); // Creating post object.
  754. $post->id = get_the_ID();
  755. $post->link = get_permalink($post->id);
  756. $img_id[]=get_post_meta( $post->id , '_thumbnail_id' ,true );
  757.  
  758. $post_thumbnail = wpb_getImageBySize(array( 'post_id' => $post->id, 'thumb_size' => $this->pw_image_thumb_size ));
  759. $current_img_large = $post_thumbnail['thumbnail'];
  760. $current_img_full = wp_get_attachment_image_src( $img_id[$img_counter++] , 'full' );
  761.  
  762. $post_type = get_post_type( $post->id );
  763. $post_taxonomies = get_object_taxonomies($post_type);
  764. $tax_counter = 0;
  765. /////////////FILTER AND ORDER PARAM//////
  766. $data_filter='';
  767. if($this->pw_grid_type=='pl-mixitup-grid' && $this->pw_grid_filter_by=='yes')
  768. {
  769. $taxs=explode(',',$this->pw_taxonomy);
  770. if(is_array($taxs) && count($taxs)>1)
  771. {
  772. foreach($taxs as $tax)
  773. {
  774. //$data_filters=wp_get_post_terms($post->id, $tax, array("fields" => "slugs"));
  775. $data_filters=wp_get_post_terms($post->id, $tax, array("fields" => "ids"));
  776. //if(is_array($data_filters))
  777. $data_filter.=implode(' ',$data_filters).' ';
  778. //$data_filter.='';
  779. }
  780. }else if($this->pw_taxonomy!='')
  781. {
  782. //$data_filters=wp_get_post_terms($post->id, $tax, array("fields" => "slugs"));
  783. $data_filter=wp_get_post_terms($post->id, $this->pw_taxonomy, array("fields" => "ids"));
  784. $data_filter=implode(' ',$data_filter);
  785. }
  786. }
  787.  
  788. if($this->pw_grid_type=='pl-mixitup-grid' && $this->pw_grid_order_by=='yes')
  789. {
  790. $public_orders_array=array('ID','date','author','title','modified','rand','comment_count','menu_order');
  791. if(in_array($order_by,$public_orders_array))
  792. {
  793. switch($order_by)
  794. {
  795. case 'ID':
  796. $order_value=get_the_id();
  797. break;
  798.  
  799. case 'date':
  800. $order_value=get_the_date('Y/m/d');
  801. break;
  802.  
  803. case 'author':
  804. $order_value=get_the_author();
  805. break;
  806.  
  807. case 'title':
  808. $order_value=get_the_title();
  809. break;
  810.  
  811. case 'modified':
  812. $order_value=get_the_modified_date('Y/m/d');
  813. break;
  814.  
  815. case 'rand':
  816. $order_value=rand(0,1000);
  817. break;
  818.  
  819. case 'comment_count':
  820. $order_value=wp_count_comments($post->id);
  821. $order_value=$order_value->total_comments ;
  822. break;
  823.  
  824. case 'menu_order':
  825. $thispost = get_post($post->id);
  826. $order_value=$thispost->menu_order;
  827. break;
  828. }
  829. }
  830. else
  831. $order_value=get_post_meta($post->id, $order_by , true);
  832. }
  833. /////////////END FILTER PARAM///////////
  834.  
  835.  
  836. if ($this->pw_skin_type=='pl-gridskin-one'){
  837.  
  838.  
  839. /////////////MIXITUP MODE OR GENERAL MODE///////////////
  840. foreach ($post_taxonomies as $taxonomy) {
  841. $terms = get_the_terms( $post_id, $taxonomy );
  842. }
  843. foreach ($terms as $term){
  844. if($this->pw_grid_type=='pl-mixitup-grid' )
  845. {
  846. $output .= '<div class=" mix '.$data_filter.' mix_all ' .$this->pw_grid_desktop_columns_count.' ' . $this->pw_grid_tablet_columns_count . ' ' . $this->pw_grid_mobile_columns_count .' pl-col" data-'.$order_by.'-'.$this->pw_grid_id.'="'.$order_value.'" >
  847. <div class="all-detail-cnt '.$term->slug.'">
  848. ';
  849. }
  850. else if($this->pw_grid_type=='pl-standard-grid')
  851. {
  852. $output .= '<div class="' .$this->pw_grid_desktop_columns_count.' ' . $this->pw_grid_tablet_columns_count . ' ' . $this->pw_grid_mobile_columns_count .' pl-col">
  853. <div class="all-detail-cnt">';
  854. }
  855. ////////////////////////////////////////////
  856.  
  857.  
  858. $post_orders = explode(',',$this->pw_teasr_layout_img);
  859. foreach ( $post_orders as $order ){
  860. $order_type = explode('|',$order);
  861. switch ($order_type[0]){
  862. case 'image':
  863. $thumbnail=$current_img_large;
  864. if(isset($order_type[1]) && $order_type[1]=='link_post')
  865. {
  866. $thumbnail='<a href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$thumbnail.'</a>';
  867. }
  868.  
  869. $output .= '<div class="pl-itemcnt">
  870. <div class="pl-thumbcnt '. $this->pw_image_effect .'">
  871. '.$thumbnail;
  872.  
  873. if(isset($this->pw_show_overlay) && $this->pw_show_overlay=='no')
  874. {
  875. if(isset($order_type[1]) && $order_type[1]=='link_post')
  876. {
  877. $output.='<a href="'. $post->link .'" target="'. $this->pw_link_target .'" >';
  878. }
  879.  
  880. $output.='
  881. <div class="pl-overally fadein-eff">
  882. <div class="pl-icon-cnt '. $this->pw_icon_effect.' '.$this->pw_icon_type.'">';
  883.  
  884. if (isset($this->pw_show_zoom_icon) && ($this->pw_show_zoom_icon=='no')){
  885. $output .= '<a href="'. $current_img_full[0] .'" class="pl-zoom-icon example-image" data-lightbox="image-set"></a>';
  886. }
  887. if (isset($this->pw_show_link_icon) && ($this->pw_show_link_icon=='no')){
  888. $output .= '<a href="'. $post->link .'" class="pl-link-icon" target="'. $this->pw_link_target .'" ></a>';
  889. }
  890.  
  891.  
  892.  
  893. $output .= '</div><!--pl-icon-cnt -->
  894. </div><!-- pl-overally -->';
  895. if(isset($order_type[1]) && $order_type[1]=='link_post')
  896. {
  897. $output.='</a>';
  898. }
  899. }
  900. $output .= '
  901. </div><!-- pl-thumbcnt -->
  902. </div><!--pl-itemcnt -->';
  903. break;
  904. case 'title':
  905. /*$output .= '<div class="pl-detailcnt">
  906. <h4 class="pl-title left-txt">';
  907. if (isset($this->pw_hide_date) && ($this->pw_hide_date=='off')){
  908. $output .= '<span class="pl-date">'. get_the_date($this->pw_date_format).'</span>';
  909. }
  910. $output .= '<a href="'. $post->link .'" target="'. $this->pw_link_target .'">'. get_the_title().'</a></h4>
  911. </div>';*/
  912.  
  913.  
  914. $output .= '<div class="pl-detailcnt">
  915. <h4 class="pl-title left-txt">';
  916. if (isset($this->pw_hide_date) && ($this->pw_hide_date=='off')){
  917. $output .= '<span class="pl-date">'. get_the_date($this->pw_date_format).'</span>';
  918. }
  919. $output .= '<a href="'. $post->link .'" target="'. $this->pw_link_target .'">'. get_the_title().'</a></h4>
  920. </div>';
  921.  
  922. $output .= '<div class="pl-detailcnt">';
  923. if($this->pw_grid_author=='no')
  924. {
  925. $output.='
  926. <div class="pl-postmeta">
  927. <i class="fa fa-pencil"></i>'.get_the_author().'</div>';
  928. }
  929. if($this->pw_grid_tags=='no')
  930. {
  931.  
  932. $output .= pw_get_post_meta($post->id , $post_taxonomies);
  933. if($post->id=='322')
  934. print_r($post_taxonomies);
  935. }
  936. $output .= '</div>';
  937.  
  938.  
  939. break;
  940. case 'text':
  941. $content=$VCExtendAddonClass_GRID->excerpt(get_the_excerpt(),$this->pw_excerpt_length,'excerpt');
  942. if(isset($order_type[1]) && $order_type[1]=='text')
  943. {
  944. $content=$VCExtendAddonClass_GRID->excerpt(get_the_content(),$this->pw_excerpt_length,'full_text');
  945. }
  946.  
  947. $output .= '<div class="pl-detailcnt">
  948. <p class="pl-text left-txt">'. $content.'</p>';
  949. if($this->pw_grid_show_num_comment=='no')
  950. {
  951. $output .= '
  952. <div class="pl-postcomment"><a href="'. get_comments_link() .'"><i class="fa fa-comments"></i>'.get_comments_number( '0', '1', '% responses' ).'</a></div>';
  953. }
  954. $output .= '
  955. </div>';
  956.  
  957. /*$output .= '<div class="pl-detailcnt">
  958. <p class="pl-text left-txt">'.$content.'</p>';
  959. if($this->pw_grid_author=='no')
  960. {
  961. $output.='
  962. <div class="pl-postmeta">
  963. <i class="fa fa-user"></i><span>'.get_the_author().'</span></div>';
  964. }
  965.  
  966. if($this->pw_grid_tags=='no')
  967. {
  968. $output .= pw_get_post_meta($post->id , $post_taxonomies);
  969.  
  970. }
  971.  
  972. if($this->pw_grid_show_num_comment=='no')
  973. {
  974. $output .= '
  975.  
  976. <div class="pl-postcomment" style="display:inline-block"><a href="'. get_comments_link() .'"><i class="fa fa-comments"></i>'.get_comments_number( '0', '1', '% responses' ).'</a></div>';
  977. }
  978. $output .= '
  979. </div>';*/
  980. break;
  981. case 'link':
  982. $output .= '<div class="pl-detailcnt">
  983. <a class="'.$this->pw_readmore_type.'" href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$this->pw_readmore_translate.'<i class="fa fa-angle-right"></i></a>
  984. </div>';
  985. break;
  986. }//end switch
  987. }//end foreach
  988. $output .= '
  989. </div><!---all-detail-cnt -->
  990. </div><!--col -->';
  991. }
  992.  
  993. }//end if
  994. else if ($this->pw_skin_type=='pl-gridskin-two'){
  995. /////////////MIXITUP MODE OR GENERAL MODE///////////////
  996. if($this->pw_grid_type=='pl-mixitup-grid')
  997. {
  998.  
  999. $output .= '
  1000. <div class="mix '.$data_filter.' mix_all '.$this->pw_grid_desktop_columns_count. ' ' . $this->pw_grid_tablet_columns_count . ' ' . $this->pw_grid_mobile_columns_count .' pl-col" data-'.$order_by.'-'.$this->pw_grid_id.'="'.$order_value.'" >';
  1001. }else if($this->pw_grid_type=='pl-standard-grid')
  1002. {
  1003. $output .= '
  1004. <div class="'.$this->pw_grid_desktop_columns_count. ' ' . $this->pw_grid_tablet_columns_count . ' ' . $this->pw_grid_mobile_columns_count .' pl-col">';
  1005. }
  1006. ////////////////////////////////////////
  1007.  
  1008. $output.=' <div class="pl-view '.$this->pw_grid_skin_effect.'">
  1009. '.$current_img_large.'
  1010. <div class="pl-mask">
  1011. <h4><a href="'. $post->link .'" target="'. $this->pw_link_target .'">'. get_the_title().'</a></h4>
  1012. <p>'. $VCExtendAddonClass_GRID->excerpt(get_the_excerpt(),$this->pw_excerpt_length).'</p>';
  1013. if ($this->pw_grid_skin_effect=='pl-gst-effect-1' || $this->pw_grid_skin_effect=='pl-gst-effect-2' || $this->pw_grid_skin_effect=='pl-gst-effect-3' || $this->pw_grid_skin_effect=='pl-gst-effect-4' ){
  1014. $output.='<a class="pl-permalink" href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$this->pw_readmore_translate.'<i class="fa fa-arrow-circle-right"></i></a>';
  1015. }
  1016. else {
  1017. $output .= '<a class="link-hoverset2" href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$this->pw_readmore_translate.'</a>';
  1018. }
  1019. $output.='</div>
  1020. </div>
  1021. </div><!--col -->
  1022. ';
  1023. }//end elseif
  1024. }
  1025. $output .= '</div>';
  1026. wp_reset_query();
  1027.  
  1028. }//end if Standard
  1029. else if ($this->pw_grid_type=='pl-masonry-grid')
  1030. {
  1031. $output .= '<div class="pl-gridlayout '.$this->pw_skin_type .' ' .$this->pw_grid_type .' pl_grid_id_'.$this->pw_grid_id.'" id="Grid_'.$this->pw_grid_id.'">';
  1032. while ( $my_query->have_posts() ) {
  1033. $my_query->the_post(); // Get post from query
  1034. $post = new stdClass(); // Creating post object.
  1035. $post->id = get_the_ID();
  1036. $post->link = get_permalink($post->id);
  1037. $img_id[]=get_post_meta( $post->id , '_thumbnail_id' ,true );
  1038.  
  1039. $post_thumbnail = wpb_getImageBySize(array( 'post_id' => $post->id, 'thumb_size' => $this->pw_image_thumb_size ));
  1040. $current_img_large = $post_thumbnail['thumbnail'];
  1041. $current_img_full = wp_get_attachment_image_src( $img_id[$img_counter++] , 'full' );
  1042.  
  1043. $post_type = get_post_type( $post->id );
  1044. $post_taxonomies = get_object_taxonomies($post_type);
  1045. $tax_counter = 0;
  1046.  
  1047.  
  1048. if ($this->pw_skin_type=='pl-gridskin-one')
  1049. {
  1050. $output .= '<div class="' .$this->pw_grid_desktop_columns_count.' ' . $this->pw_grid_tablet_columns_count . ' ' . $this->pw_grid_mobile_columns_count .' pl-col" >
  1051. <div class="all-detail-cnt">';
  1052. $post_orders = explode(',',$this->pw_teasr_layout_img);
  1053.  
  1054. foreach ( $post_orders as $order ){
  1055. $order_type = explode('|',$order);
  1056. switch ($order_type[0]){
  1057. case 'image':
  1058.  
  1059. $thumbnail=$current_img_large;
  1060. if(isset($order_type[1]) && $order_type[1]=='link_post')
  1061. {
  1062. $thumbnail='<a href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$current_img_large.'</a>';
  1063. }
  1064.  
  1065. $output .= '<div class="pl-itemcnt">
  1066. <div class="pl-thumbcnt '. $this->pw_image_effect .'">
  1067. '.$thumbnail;
  1068.  
  1069. if(isset($this->pw_show_overlay) && $this->pw_show_overlay=='no')
  1070. {
  1071. if(isset($order_type[1]) && $order_type[1]=='link_post')
  1072. {
  1073. $output.='<a href="'. $post->link .'" target="'. $this->pw_link_target .'" >';
  1074. }
  1075.  
  1076. $output.='
  1077. <div class="pl-overally fadein-eff">
  1078. <div class="pl-icon-cnt '. $this->pw_icon_effect.' '.$this->pw_icon_type.'">';
  1079.  
  1080.  
  1081. if (isset($this->pw_show_zoom_icon) && ($this->pw_show_zoom_icon=='no')){
  1082. $output .= '<a href="'. $current_img_full[0] .'" class="pl-zoom-icon example-image" data-lightbox="image-set"></a>';
  1083. }
  1084. if (isset($this->pw_show_link_icon) && ($this->pw_show_link_icon=='no')){
  1085. $output .= '<a href="'. $post->link .'" class="pl-link-icon" target="'. $this->pw_link_target .'" ></a>';
  1086. }
  1087.  
  1088. $output .= '</div><!--pl-icon-cnt -->
  1089. </div><!-- pl-overally -->';
  1090.  
  1091. if(isset($order_type[1]) && $order_type[1]=='link_post')
  1092. {
  1093. $output.='</a>';
  1094. }
  1095. }
  1096. $output .= '
  1097. </div><!-- pl-thumbcnt -->
  1098. </div><!--pl-itemcnt -->';
  1099. break;
  1100. case 'title':
  1101. $output .= '<div class="pl-detailcnt">
  1102. <h4 class="pl-title left-txt">';
  1103. if (isset($this->pw_hide_date) && ($this->pw_hide_date=='off')){
  1104. $output .= '<span class="pl-date">'. get_the_date($this->pw_date_format).'</span>';
  1105. }
  1106. $output .= '<a href="'. $post->link .'" target="'. $this->pw_link_target .'">'. get_the_title().'</a></h4>
  1107. </div>';
  1108. $output .= '<div class="pl-detailcnt">';
  1109. if($this->pw_grid_author=='no')
  1110. {
  1111. $output.='
  1112. <div class="pl-postmeta">
  1113. <i class="fa fa-pencil"></i>'.get_the_author().'</div>';
  1114. }
  1115. if($this->pw_grid_tags=='no')
  1116. {
  1117. $output .= pw_get_post_meta($post->id , $post_taxonomies);
  1118. }
  1119. $output .= '</div>';
  1120. break;
  1121. case 'text':
  1122. $content=$VCExtendAddonClass_GRID->excerpt(get_the_excerpt(),$this->pw_excerpt_length,'excerpt');
  1123. if(isset($order_type[1]) && $order_type[1]=='text')
  1124. {
  1125. $content=$VCExtendAddonClass_GRID->excerpt(get_the_content(),$this->pw_excerpt_length,'full_text');
  1126. }
  1127.  
  1128. $output .= '<div class="pl-detailcnt">
  1129. <p class="pl-text left-txt">'. $content.'</p>';
  1130. if($this->pw_grid_show_num_comment=='no')
  1131. {
  1132. $output .= '
  1133. <div class="pl-postcomment"><a href="'. get_comments_link() .'"><i class="fa fa-comments"></i>'.get_comments_number( '0', '1', '% responses' ).'</a></div>';
  1134. }
  1135. $output .= '
  1136. </div>';
  1137.  
  1138. /*$output .= '<div class="pl-detailcnt">
  1139. <p class="pl-text left-txt">'. $content.'</p>';
  1140. if($this->pw_grid_author=='no')
  1141. {
  1142. $output.='
  1143. <div class="pl-postmeta">
  1144. <i class="fa fa-user"></i><span>'.get_the_author().'</span></div>';
  1145. }
  1146.  
  1147. if($this->pw_grid_tags=='no')
  1148. {
  1149. $output .= pw_get_post_meta($post->id , $post_taxonomies);
  1150.  
  1151. }
  1152. if($this->pw_grid_show_num_comment=='no')
  1153. {
  1154. $output .= '
  1155. <div class="pl-postcomment" style="display:inline-block"><a href="'. get_comments_link() .'"><i class="fa fa-comments"></i>'.get_comments_number( '0', '1', '% responses' ).'</a></div>';
  1156. }
  1157. $output .= '
  1158. </div>';*/
  1159. break;
  1160. case 'link':
  1161. $output .= '<div class="pl-detailcnt">
  1162. <a class="pl-permalink" href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$this->pw_readmore_translate.'<i class="fa fa-arrow-circle-right"></i></a>
  1163. </div>';
  1164. break;
  1165. }//end switch
  1166. }//end foreach
  1167. $output .= '
  1168. </div><!--all-detail-cnt -->
  1169. </div><!--col -->';
  1170. }//end if
  1171. else if ($this->pw_skin_type=='pl-gridskin-two')
  1172. {
  1173. $output .= '
  1174. <div class="'.$this->pw_grid_desktop_columns_count. ' ' . $this->pw_grid_tablet_columns_count . ' ' . $this->pw_grid_mobile_columns_count .' pl-col" >
  1175. <div class="pl-view '.$this->pw_grid_skin_effect.'">
  1176. '.$current_img_large.'
  1177. <div class="pl-mask">
  1178. <h4><a href="'. $post->link .'" target="'. $this->pw_link_target .'">'. get_the_title().'</a></h4>
  1179. <p>'. $VCExtendAddonClass_GRID->excerpt(get_the_excerpt(),$this->pw_excerpt_length).'</p>';
  1180. if ($this->pw_grid_skin_effect=='pl-gst-effect-1' || $this->pw_grid_skin_effect=='pl-gst-effect-2' || $this->pw_grid_skin_effect=='pl-gst-effect-3' || $this->pw_grid_skin_effect=='pl-gst-effect-4' ){
  1181. $output.='<a class="pl-permalink" href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$this->pw_readmore_translate.'<i class="fa fa-arrow-circle-right"></i></a>';
  1182. }
  1183. else {
  1184. $output .= '<a class="link-hoverset2" href="'. $post->link .'" target="'. $this->pw_link_target .'" >'.$this->pw_readmore_translate.'</a>';
  1185. }
  1186. $output.='
  1187. </div>
  1188. </div>
  1189. </div><!--col -->
  1190. ';
  1191. }//end elseif
  1192. }
  1193. $output .= '</div>';
  1194. wp_reset_query();
  1195.  
  1196. }//emd if masonry
  1197.  
  1198. /////////////CONTROL FIELDS FORM//////////////
  1199. $all_page_number=$my_query->max_num_pages;
  1200. $view_type='grid';
  1201.  
  1202. $fields='';
  1203. $arr=$this->vars;
  1204.  
  1205. foreach($arr as $key => $value)
  1206. {
  1207. $fields.='<input type="hidden" name="'.$key.'" value="'.$value.'" id="'.$key.'_'.$this->pw_grid_id.'"/>';
  1208. }
  1209.  
  1210. $output.='
  1211. <form id="pw_pl_form_load_more_'.$this->pw_grid_id.'">
  1212.  
  1213. '.$fields.'
  1214. <input type="hidden" name="_wpnonce " value="'.rand(0,100000).'"/>
  1215. <input type="hidden" name="query" value="'.$this->pw_query.'"/>
  1216. <input type="hidden" name="paged" value="'.$paged.'" id="pw_paged_'.$this->pw_grid_id.'"/>
  1217. <input type="hidden" name="view_type" value="'.$view_type.'" id="pw_view_type_'.$this->pw_grid_id.'"/>
  1218. <input type="hidden" name="total_paged" value="'.$all_page_number.'" id="pw_total_paged_'.$this->pw_grid_id.'"/>
  1219. <input type="hidden" name="pw_action_type" value="" id="pw_pl_action_type_'.$this->pw_grid_id.'"/>
  1220. <input type="hidden" name="pw_mixitup_grid_id" value="'.$this->pw_grid_id.'" id="pw_grid_id_'.$this->pw_grid_id.'"/>
  1221. <input type="hidden" name="pw_grid_hide_recentpost" value="'.$this->pw_grid_hide_recentpost.'" id="pw_grid_id_'.$this->pw_grid_id.'"/>
  1222. <input type="hidden" name="pw_grid_num_hide_recentpost" value="'.$this->pw_grid_num_hide_recentpost.'" id="pw_grid_id_'.$this->pw_grid_id.'"/>
  1223.  
  1224. </form>';
  1225.  
  1226. if($this->pw_grid_page_navigation=='show_more_btn' && $all_page_number>1)
  1227. {
  1228. $output.='
  1229. <div class="clear"></div><div rel="3" class="pl-loadmorecnt loadmore_id_'.$this->pw_grid_id.'">
  1230. <a href="page/'.$paged.'/" class="pw_pl_load_more_'.$this->pw_grid_id.' load-more-link">'.__('LOAD MORE',__PW_POST_LAYOUT_TEXTDOMAN__).'</a>
  1231. </div>';
  1232.  
  1233. }else if($this->pw_grid_page_navigation=='show_page_number' && $all_page_number>1)
  1234. {
  1235.  
  1236. $output.=$this->pagination($all_page_number,$all_page_number,'pl-pagination-link-'.$this->pw_grid_id);
  1237. }
  1238. ///////////////////////////
  1239.  
  1240.  
  1241. //////////////CUSTOM JS/////////////////////
  1242. $loading='<div class="pl-grid-loading"><img src="'.PW_PS_PL_URL_GRID.'/assets/images/loader.gif" /></div>';
  1243.  
  1244. /////////////MIXITUP MODE OR GENERAL MODE///////////////
  1245. if($this->pw_grid_type=='pl-mixitup-grid' )
  1246. {
  1247. $query_order=(strtolower($query_order)=='desc' ? "asc":"desc");
  1248.  
  1249. $output.="
  1250. <script type='text/javascript'>
  1251. jQuery(document).ready(function() {";
  1252. if($this->pw_grid_type=='pl-mixitup-grid' && ($this->pw_grid_order_by=='yes'))
  1253. {
  1254. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup({sortSelector:'.sort-".$order_by."-".$this->pw_grid_id."'});";
  1255. }else
  1256. {
  1257. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1258. }
  1259.  
  1260. $output.="
  1261.  
  1262. var filters = jQuery('#Filters_".$this->pw_grid_id."').find('li'),
  1263. dimensions = {
  1264. ";
  1265. foreach($filters as $grid_filter)
  1266. {
  1267. $output.="grid_filter_".$grid_filter.": 'all',";
  1268. }
  1269.  
  1270. $output.="
  1271. };
  1272.  
  1273. filters.on('click',function(){
  1274. var t = jQuery(this),
  1275. dimension = t.attr('data-dimension'),
  1276. filter = t.attr('data-filter'),
  1277. filterString = dimensions[dimension];
  1278. if(filter == 'all'){
  1279. if(!t.hasClass('active')){
  1280. t.addClass('active').siblings().removeClass('active');
  1281. filterString = 'all';
  1282. } else {
  1283. // Uncheck
  1284. t.removeClass('active');
  1285. // Emtpy string
  1286. filterString = '';
  1287. }
  1288. } else {
  1289. t.siblings('[data-filter=\"all\"]').removeClass('active');
  1290. filterString = filterString.replace('all','');
  1291. if(!t.hasClass('active')){
  1292. // Check checkbox
  1293. t.addClass('active');
  1294. // Append filter to string
  1295. filterString = filterString == '' ? filter : filterString+' '+filter;
  1296. } else {
  1297. // Uncheck
  1298. t.removeClass('active');
  1299. // Remove filter and preceeding space from string with RegEx
  1300.  
  1301. /*var re = new RegExp('(\\s|^)'+filter);
  1302. filterString = filterString.replace(re,'');*/
  1303. filterString = filterString.replace('. ','');
  1304. filterString = filterString.replace(' . ','');
  1305. filterString = filterString.replace(' .','');
  1306. filterString = filterString.replace(filter.trim(),'');
  1307. };
  1308. };
  1309.  
  1310.  
  1311. // Set demension with filterString
  1312. dimensions[dimension] = filterString.trim();
  1313.  
  1314. // We now have two strings containing the filter arguments for each dimension:
  1315. ";
  1316. $i=1;
  1317. foreach($filters as $grid_filter)
  1318. {
  1319. $output.="console.info('dimension ".$i++.": '+dimensions.grid_filter_".$grid_filter.");";
  1320. }
  1321. $output.="
  1322.  
  1323.  
  1324. jQuery('#Grid_".$this->pw_grid_id."').mixitup('filter',[";
  1325. foreach($filters as $grid_filter)
  1326. {
  1327. $output.="dimensions.grid_filter_".$grid_filter.",";
  1328. }
  1329. $output.="]);
  1330.  
  1331. });";
  1332.  
  1333. if($this->pw_grid_display_type=='list')
  1334. {
  1335. $output.="
  1336. //event.preventDefault(event);
  1337.  
  1338. jQuery('#pw_pl_action_type_".$this->pw_grid_id."').val('swap_view_type');
  1339. jQuery('#pw_view_type_".$this->pw_grid_id."').val('list');
  1340.  
  1341. jQuery('#Grid_".$this->pw_grid_id."').removeClass('pl-gridlayout').addClass('pl-listlayout');
  1342.  
  1343. jQuery(this).siblings('.active').removeClass('active');
  1344. jQuery(this).addClass('active');
  1345.  
  1346. jQuery('#Grid_".$this->pw_grid_id."').html('".$loading."');
  1347. var params=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').serialize();
  1348. jQuery.ajax ({
  1349. type: 'POST',
  1350. url: '".admin_url( 'admin-ajax.php' )."',
  1351. data: params+'&action=pw_pl_grid_list_swap',
  1352. success: function(response) {
  1353.  
  1354. jQuery('#Grid_".$this->pw_grid_id."').html(response);
  1355.  
  1356. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250 li').removeClass('active');
  1357. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250').each(function(i, obj) {
  1358. jQuery(this).children().eq(0).addClass('active');
  1359. });
  1360.  
  1361. //jQuery('#Grid_".$this->pw_grid_id."').mixitup('sort','random');
  1362. jQuery('#Grid_".$this->pw_grid_id."').mixitup('remix');";
  1363. if($this->pw_grid_type=='pl-mixitup-grid' && ($this->pw_grid_order_by=='yes'))
  1364. {
  1365. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1366. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup('multimix',{
  1367. filter: 'all',
  1368. sortSelector:'.sort-".$order_by."-".$this->pw_grid_id."',
  1369. sort: 'data-".$order_by."-".$this->pw_grid_id."',
  1370. order: '".strtolower($query_order)."',
  1371. });";
  1372. }else
  1373. {
  1374. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1375. }
  1376. $output.="
  1377. }
  1378. });
  1379. ";
  1380. }
  1381.  
  1382. $output.="jQuery( '.pw_view_type_".$this->pw_grid_id."' ).click(function(event) {
  1383. event.preventDefault(event);
  1384.  
  1385. jQuery('#pw_pl_action_type_".$this->pw_grid_id."').val('swap_view_type');
  1386. jQuery('#pw_view_type_".$this->pw_grid_id."').val(jQuery(this).attr('data-viewtype'));
  1387.  
  1388. if(jQuery(this).attr('data-viewtype')=='list')
  1389. {
  1390. jQuery('#Grid_".$this->pw_grid_id."').removeClass('pl-gridlayout').addClass('pl-listlayout');
  1391. }else
  1392. {
  1393. jQuery('#Grid_".$this->pw_grid_id."').removeClass('pl-listlayout').addClass('pl-gridlayout');
  1394. }
  1395.  
  1396. jQuery(this).siblings('.active').removeClass('active');
  1397. jQuery(this).addClass('active');
  1398.  
  1399. jQuery('#Grid_".$this->pw_grid_id."').html('".$loading."');
  1400. var params=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').serialize();
  1401. jQuery.ajax ({
  1402. type: 'POST',
  1403. url: '".admin_url( 'admin-ajax.php' )."',
  1404. data: params+'&action=pw_pl_grid_list_swap',
  1405. success: function(response) {
  1406.  
  1407. jQuery('#Grid_".$this->pw_grid_id."').html(response);
  1408.  
  1409. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250 li').removeClass('active');
  1410. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250').each(function(i, obj) {
  1411. jQuery(this).children().eq(0).addClass('active');
  1412. });
  1413.  
  1414. //jQuery('#Grid_".$this->pw_grid_id."').mixitup('sort','random');
  1415. jQuery('#Grid_".$this->pw_grid_id."').mixitup('remix');";
  1416. if($this->pw_grid_type=='pl-mixitup-grid' && ($this->pw_grid_order_by=='yes'))
  1417. {
  1418. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup('multimix',{
  1419. filter: 'all',
  1420. sortSelector:'.sort-".$order_by."-".$this->pw_grid_id."',
  1421. sort: 'data-".$order_by."-".$this->pw_grid_id."',
  1422. order: '".strtolower($query_order)."',
  1423. });";
  1424. }else
  1425. {
  1426. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1427. }
  1428.  
  1429. $output.="
  1430.  
  1431. }
  1432. });
  1433. });
  1434.  
  1435. });
  1436. </script>";
  1437. }
  1438.  
  1439. if($this->pw_grid_type=='pl-masonry-grid')
  1440. {
  1441. $loading='<div class="pl-grid-loading-masonry" style="position: absolute;top: 100%;"><img src="'.PW_PS_PL_URL_GRID.'/assets/images/loader.gif" /></div>';
  1442. $output .="<script type='text/javascript'>
  1443. jQuery(document).ready(function() {
  1444. var container = jQuery('.pl-masonry-grid');
  1445. setTimeout(function(){
  1446. var container = jQuery('.pl-masonry-grid');
  1447. jQuery('.pl-masonry-grid').masonry({});
  1448. },2000);
  1449.  
  1450. jQuery(window).resize(function () {
  1451. container.masonry({
  1452. itemSelector: '.pl-col',
  1453. isAnimated: true
  1454. })
  1455.  
  1456. //alert('hi');
  1457. });
  1458. });
  1459. </script>";
  1460. }
  1461.  
  1462. if($this->pw_grid_page_navigation=='show_page_number' && $all_page_number>1)
  1463. {
  1464. $output.="
  1465. <script type='text/javascript'>
  1466. jQuery(document).ready(function() {
  1467.  
  1468. jQuery( '.pl-pagination-link-".$this->pw_grid_id."' ).click(function(event) {
  1469. event.preventDefault(event);
  1470. jQuery('html, body').animate({
  1471. scrollTop: jQuery('#Grid_".$this->pw_grid_id."').offset().top-100
  1472. }, 2000);
  1473. jQuery('#pw_pl_action_type_".$this->pw_grid_id."').val('show_page_number');
  1474.  
  1475. var num=jQuery( this ).attr('id');
  1476. jQuery('#pw_paged_".$this->pw_grid_id."').val(jQuery( this ).attr('id'));
  1477. jQuery('#pw_pl_allpage_".$this->pw_grid_id."').html('Pages '+jQuery( this ).attr('id')+' of ".$all_page_number."');
  1478.  
  1479. jQuery(this).siblings('.pl-currentpage').removeClass('pl-currentpage').addClass('inactive');
  1480. jQuery(this).addClass('pl-currentpage');
  1481. jQuery(this).removeClass('inactive');
  1482.  
  1483.  
  1484. jQuery('#Grid_".$this->pw_grid_id."').html('".$loading."');
  1485. var params=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').serialize();
  1486. jQuery.ajax ({
  1487. type: 'POST',
  1488. url: '".admin_url( 'admin-ajax.php' )."',
  1489. data: params+'&action=pw_pl_grid_list_swap',
  1490. success: function(response) {
  1491. jQuery('.pl-grid-loading').remove();
  1492. jQuery('.pl-grid-loading-masonry').remove();";
  1493.  
  1494.  
  1495. if($this->pw_grid_type=='pl-mixitup-grid')
  1496. {
  1497. $output.="
  1498. jQuery('#Grid_".$this->pw_grid_id."').html(response);
  1499. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250 li').removeClass('active');
  1500. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250').each(function(i, obj) {
  1501. jQuery(this).children().eq(0).addClass('active');
  1502. });
  1503.  
  1504. jQuery('#Grid_".$this->pw_grid_id."').mixitup('remix');";
  1505.  
  1506. if($this->pw_grid_type=='pl-mixitup-grid' && ($this->pw_grid_order_by=='yes'))
  1507. {
  1508. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup('multimix',{
  1509. filter: 'all',
  1510. sortSelector:'.sort-".$order_by."-".$this->pw_grid_id."',
  1511. sort: 'data-".$order_by."-".$this->pw_grid_id."',
  1512. order: '".strtolower($query_order)."',
  1513. });";
  1514. }else
  1515. {
  1516. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1517. }
  1518. }else if($this->pw_grid_type=='pl-masonry-grid')
  1519. {
  1520. $output.="
  1521. jQuery('.pl-grid-loading-masonry').remove();
  1522. var container = jQuery('.pl-masonry-grid');
  1523. container.masonry('destroy');
  1524. jQuery('#Grid_".$this->pw_grid_id."').html(response).fadeIn(1500);
  1525. container.masonry();";
  1526. }else if($this->pw_grid_type=='pl-standard-grid')
  1527. {
  1528. $output.="jQuery('#Grid_".$this->pw_grid_id."').html(response);";
  1529. }
  1530.  
  1531. $output.="
  1532. }
  1533. });
  1534. });
  1535.  
  1536. });
  1537. </script>";
  1538. }else if($this->pw_grid_page_navigation=='show_more_btn' && $all_page_number>1)
  1539. {
  1540. $output.="
  1541. <script type='text/javascript'>
  1542. jQuery(document).ready(function() {
  1543. jQuery( '.pw_pl_load_more_".$this->pw_grid_id."' ).click(function(event) {
  1544. event.preventDefault(event);
  1545. jQuery('#pw_pl_action_type_".$this->pw_grid_id."').val('show_more_btn');
  1546. var div_position=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').position().top;
  1547. jQuery('#pw_paged_".$this->pw_grid_id."').val(Number(jQuery('#pw_paged_".$this->pw_grid_id."').val())+1);
  1548.  
  1549. jQuery('".$loading."').appendTo('#Grid_".$this->pw_grid_id."');
  1550. var params=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').serialize();
  1551. jQuery.ajax ({
  1552. type: 'POST',
  1553. url: '".admin_url( 'admin-ajax.php' )."',
  1554. data: params+'&action=pw_pl_grid_list_swap',
  1555. success: function(response) {
  1556.  
  1557. jQuery('.pl-grid-loading').remove();
  1558. jQuery('.pl-grid-loading-masonry').remove();";
  1559.  
  1560. if($this->pw_grid_type=='pl-mixitup-grid' )
  1561. {
  1562. $output.="
  1563. jQuery(response).appendTo('#Grid_".$this->pw_grid_id."');
  1564. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250 li').removeClass('active');
  1565. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250').each(function(i, obj) {
  1566. jQuery(this).children().eq(0).addClass('active');
  1567. });
  1568.  
  1569.  
  1570. jQuery('#Grid_".$this->pw_grid_id."').mixitup('remix');";
  1571.  
  1572. if($this->pw_grid_type=='pl-mixitup-grid' && ($this->pw_grid_order_by=='yes'))
  1573. {
  1574. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup('multimix',{
  1575. filter: 'all',
  1576. sortSelector:'.sort-".$order_by."-".$this->pw_grid_id."',
  1577. sort: 'data-".$order_by."-".$this->pw_grid_id."',
  1578. order: '".strtolower($query_order)."',
  1579. });";
  1580. }else
  1581. {
  1582. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1583. }
  1584.  
  1585. }else if($this->pw_grid_type=='pl-masonry-grid')
  1586. {
  1587. $output.="
  1588. jQuery('.pl-grid-loading-masonry').remove();
  1589. var container = jQuery('.pl-masonry-grid');
  1590.  
  1591. jQuery(response).hide().appendTo('#Grid_".$this->pw_grid_id."').fadeIn(1500);
  1592. setTimeout(function(){
  1593. container.masonry('destroy');
  1594. container.masonry();
  1595. jQuery('html, body').animate({
  1596. scrollTop: div_position-200
  1597. }, 1000);
  1598. },1000);
  1599.  
  1600. ";
  1601. }else if($this->pw_grid_type=='pl-standard-grid')
  1602. {
  1603. $output.="jQuery(response).appendTo('#Grid_".$this->pw_grid_id."');";
  1604. }
  1605.  
  1606. $output.="
  1607. }
  1608. });
  1609.  
  1610. if(Number(jQuery('#pw_paged_".$this->pw_grid_id."').val())==Number(jQuery('#pw_total_paged_".$this->pw_grid_id."').val()))
  1611. {
  1612. jQuery(this).remove();
  1613. }
  1614. });
  1615.  
  1616. });
  1617. </script>";
  1618. }else if($this->pw_grid_page_navigation=='infinite_scroll' && $all_page_number>1)
  1619. {
  1620. $output.="
  1621. <script type='text/javascript'>
  1622. jQuery(document).ready(function() {
  1623.  
  1624. function isOnScreen(thiss){
  1625.  
  1626. var win = jQuery(window);
  1627.  
  1628. var viewport = {
  1629. top : win.scrollTop(),
  1630. left : win.scrollLeft()
  1631. };
  1632. viewport.right = viewport.left + win.width();
  1633. viewport.bottom = viewport.top + win.height();
  1634.  
  1635. var bounds = thiss.offset();
  1636. bounds.right = bounds.left + thiss.outerWidth();
  1637. bounds.bottom = bounds.top + thiss.outerHeight();
  1638.  
  1639. return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
  1640.  
  1641. };
  1642.  
  1643. var div_position=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').position().top;
  1644.  
  1645. var scrollDifference = jQuery(window).height() + jQuery(window).scrollTop();
  1646.  
  1647. var docViewTop = jQuery(window).scrollTop();
  1648. var docViewBottom = docViewTop + jQuery(window).height();
  1649.  
  1650. var elemTop = jQuery('#Grid_".$this->pw_grid_id."').offset().top;
  1651. var elemBottom = elemTop + jQuery('#Grid".$this->pw_grid_id."').height();
  1652.  
  1653. setTimeout(function(){
  1654. if(isOnScreen(jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."')) && !jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').hasClass('visit'))
  1655. {
  1656. jQuery('#pw_pl_action_type_".$this->pw_grid_id."').val('infinite_scroll');
  1657.  
  1658. jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').addClass('visit');
  1659. jQuery('#pw_paged_".$this->pw_grid_id."').val(Number(jQuery('#pw_paged_".$this->pw_grid_id."').val())+1);
  1660.  
  1661. jQuery('".$loading."').appendTo('#Grid_".$this->pw_grid_id."');
  1662. var params=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').serialize();
  1663. jQuery.ajax ({
  1664. type: 'POST',
  1665. url: '".admin_url( 'admin-ajax.php' )."',
  1666. data: params+'&action=pw_pl_grid_list_swap',
  1667. success: function(response) {
  1668. jQuery('.pl-grid-loading').remove();
  1669. jQuery('.pl-grid-loading-masonry').remove();";
  1670.  
  1671. if($this->pw_grid_type=='pl-mixitup-grid')
  1672. {
  1673. $output.="
  1674. jQuery(response).appendTo('#Grid_".$this->pw_grid_id."');
  1675. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250 li').removeClass('active');
  1676. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250').each(function(i, obj) {
  1677. jQuery(this).children().eq(0).addClass('active');
  1678. });
  1679.  
  1680. jQuery('#Grid_".$this->pw_grid_id."').mixitup('remix');";
  1681. if($this->pw_grid_type=='pl-mixitup-grid' && ($this->pw_grid_order_by=='yes'))
  1682. {
  1683. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup('multimix',{
  1684. filter: 'all',
  1685. sortSelector:'.sort-".$order_by."-".$this->pw_grid_id."',
  1686. sort: 'data-".$order_by."-".$this->pw_grid_id."',
  1687. order: '".strtolower($query_order)."',
  1688. });";
  1689. }else
  1690. {
  1691. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1692. }
  1693. }else if($this->pw_grid_type=='pl-masonry-grid')
  1694. {
  1695. $output.="
  1696. jQuery('.pl-grid-loading-masonry').remove();
  1697. var container = jQuery('.pl-masonry-grid');
  1698.  
  1699. jQuery(response).hide().appendTo('#Grid_".$this->pw_grid_id."').fadeIn(1500);
  1700. setTimeout(function(){
  1701. container.masonry('destroy');
  1702. container.masonry();
  1703. jQuery('html, body').animate({
  1704. scrollTop: div_position-200
  1705. }, 1000);
  1706. },1000);
  1707.  
  1708. ";
  1709. }else if($this->pw_grid_type=='pl-standard-grid')
  1710. {
  1711. $output.="jQuery(response).appendTo('#Grid_".$this->pw_grid_id."');";
  1712. }
  1713.  
  1714. $output.="
  1715. if(Number(jQuery('#pw_paged_".$this->pw_grid_id."').val())<Number(jQuery('#pw_total_paged_".$this->pw_grid_id."').val()))
  1716. {
  1717. jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').removeClass('visit');
  1718. div_position=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').position().top
  1719. }
  1720. }
  1721. });
  1722.  
  1723. }
  1724. },2000);
  1725.  
  1726.  
  1727. jQuery(document).scroll(function(event) {
  1728. var div_position=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').position().top;
  1729. var scrollDifference = jQuery(window).height() + jQuery(window).scrollTop();
  1730.  
  1731. /*if(jQuery(window).scrollTop()>=div_position && !jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').hasClass('visit'))*/
  1732. /*if(scrollDifference>=div_position && !jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').hasClass('visit'))*/
  1733. if(isOnScreen(jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."')) && !jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').hasClass('visit'))
  1734. {
  1735.  
  1736. jQuery('#pw_pl_action_type_".$this->pw_grid_id."').val('infinite_scroll');
  1737.  
  1738. jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').addClass('visit');
  1739. jQuery('#pw_paged_".$this->pw_grid_id."').val(Number(jQuery('#pw_paged_".$this->pw_grid_id."').val())+1);
  1740.  
  1741. jQuery('".$loading."').appendTo('#Grid_".$this->pw_grid_id."');
  1742. var params=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').serialize();
  1743. jQuery.ajax ({
  1744. type: 'POST',
  1745. url: '".admin_url( 'admin-ajax.php' )."',
  1746. data: params+'&action=pw_pl_grid_list_swap',
  1747. success: function(response) {
  1748. jQuery('.pl-grid-loading').remove();
  1749. jQuery('.pl-grid-loading-masonry').remove();";
  1750.  
  1751. if($this->pw_grid_type=='pl-mixitup-grid')
  1752. {
  1753. $output.="
  1754. jQuery(response).appendTo('#Grid_".$this->pw_grid_id."');
  1755. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250 li').removeClass('active');
  1756. jQuery('#Filters_".$this->pw_grid_id." .pl-anim250').each(function(i, obj) {
  1757. jQuery(this).children().eq(0).addClass('active');
  1758. });
  1759.  
  1760. jQuery('#Grid_".$this->pw_grid_id."').mixitup('remix');";
  1761. if($this->pw_grid_type=='pl-mixitup-grid' && ($this->pw_grid_order_by=='yes'))
  1762. {
  1763. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup('multimix',{
  1764. filter: 'all',
  1765. sortSelector:'.sort-".$order_by."-".$this->pw_grid_id."',
  1766. sort: 'data-".$order_by."-".$this->pw_grid_id."',
  1767. order: '".strtolower($query_order)."',
  1768. });";
  1769. }else
  1770. {
  1771. $output.="jQuery('#Grid_".$this->pw_grid_id."').mixitup();";
  1772. }
  1773. }else if($this->pw_grid_type=='pl-masonry-grid')
  1774. {
  1775. $output.="
  1776. jQuery('.pl-grid-loading-masonry').remove();
  1777. var container = jQuery('.pl-masonry-grid');
  1778.  
  1779. jQuery(response).hide().appendTo('#Grid_".$this->pw_grid_id."').fadeIn(1500);
  1780. setTimeout(function(){
  1781. container.masonry('destroy');
  1782. container.masonry();
  1783. jQuery('html, body').animate({
  1784. scrollTop: div_position-200
  1785. }, 1000);
  1786. },1000);
  1787.  
  1788. ";
  1789. }else if($this->pw_grid_type=='pl-standard-grid')
  1790. {
  1791. $output.="jQuery(response).appendTo('#Grid_".$this->pw_grid_id."');";
  1792. }
  1793.  
  1794. $output.="
  1795.  
  1796. if(Number(jQuery('#pw_paged_".$this->pw_grid_id."').val())<Number(jQuery('#pw_total_paged_".$this->pw_grid_id."').val()))
  1797. {
  1798. jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').removeClass('visit');
  1799. div_position=jQuery('#pw_pl_form_load_more_".$this->pw_grid_id."').position().top
  1800. }
  1801. }
  1802. });
  1803.  
  1804. }
  1805. });
  1806. });
  1807. </script>";
  1808. }
  1809.  
  1810. }
  1811. function pl_custom_font() {
  1812. wp_enqueue_style('pw-pl-custom-font-family', PW_PS_PL_URL_GRID . '/css/custom.css', array() , null);
  1813.  
  1814. $imported_font = $title_family = $meta_family = $excerpt_family = array('inherit');
  1815.  
  1816. if ($this->pw_title_font_family!='inherit') {
  1817.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
<?php 
^
Main.java:1: error: class, interface, or enum expected
<?php 
 ^
Main.java:1: error: class, interface, or enum expected
<?php 
  ^
Main.java:2: error: unclosed character literal
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
                ^
Main.java:2: error: unclosed character literal
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
                        ^
Main.java:5: error: class, interface, or enum expected
if (!class_exists('VC_PW_grid')) {
^
Main.java:5: error: unclosed character literal
if (!class_exists('VC_PW_grid')) {
                  ^
Main.java:5: error: unclosed character literal
if (!class_exists('VC_PW_grid')) {
                             ^
Main.java:7: error: <identifier> expected
		public $pw_title,
		                ^
Main.java:85: error: <identifier> expected
						$pw_title,
						         ^
Main.java:86: error: <identifier> expected
						$pw_query,
						         ^
Main.java:87: error: <identifier> expected
						$pw_grid_display_type,
						                     ^
Main.java:88: error: <identifier> expected
						$pw_grid_type,
						             ^
Main.java:91: error: <identifier> expected
						$pw_border_top_size,
						                   ^
Main.java:92: error: <identifier> expected
						$pw_border_top_type,
						                   ^
Main.java:93: error: <identifier> expected
						$pw_border_top_color,
						                    ^
Main.java:95: error: <identifier> expected
						$pw_border_right_size,
						                     ^
Main.java:96: error: <identifier> expected
						$pw_border_right_type,
						                     ^
Main.java:97: error: <identifier> expected
						$pw_border_right_color,
						                      ^
Main.java:99: error: <identifier> expected
						$pw_border_bottom_size,
						                      ^
Main.java:100: error: <identifier> expected
						$pw_border_bottom_type,
						                      ^
Main.java:101: error: <identifier> expected
						$pw_border_bottom_color,
						                       ^
Main.java:103: error: <identifier> expected
						$pw_border_left_size,
						                    ^
Main.java:104: error: <identifier> expected
						$pw_border_left_type,
						                    ^
Main.java:105: error: <identifier> expected
						$pw_border_left_color,
						                     ^
Main.java:107: error: <identifier> expected
						$pw_back_color,
						              ^
Main.java:108: error: <identifier> expected
						$pw_back_hcolor,
						               ^
Main.java:109: error: <identifier> expected
						$pw_item_back_color,
						                   ^
Main.java:112: error: <identifier> expected
						$pw_title_font_family,
						                     ^
Main.java:113: error: <identifier> expected
						$pw_title_font_size,
						                   ^
Main.java:114: error: <identifier> expected
						$pw_link_color,
						              ^
Main.java:115: error: <identifier> expected
						$pw_link_hover_color,
						                    ^
Main.java:116: error: <identifier> expected
						$pw_meta_font_family,
						                    ^
Main.java:117: error: <identifier> expected
						$pw_meta_font_size,
						                  ^
Main.java:118: error: <identifier> expected
						$pw_meta_color,
						              ^
Main.java:119: error: <identifier> expected
						$pw_excerpt_font_family,
						                       ^
Main.java:120: error: <identifier> expected
						$pw_excerpt_font_size,
						                     ^
Main.java:121: error: <identifier> expected
						$pw_excerpt_color,
						                 ^
Main.java:122: error: <identifier> expected
						$pw_readmore_type,
						                 ^
Main.java:123: error: <identifier> expected
						$pw_readmore_translate,
						                      ^
Main.java:125: error: <identifier> expected
						$pw_link_target,
						               ^
Main.java:126: error: <identifier> expected
						$pw_post_layout,
						               ^
Main.java:127: error: <identifier> expected
						$pw_grid_desktop_columns_count,
						                              ^
Main.java:128: error: <identifier> expected
						$pw_grid_tablet_columns_count,
						                             ^
Main.java:129: error: <identifier> expected
						$pw_grid_mobile_columns_count,
						                             ^
Main.java:130: error: <identifier> expected
						$pw_skin_type,
						             ^
Main.java:131: error: <identifier> expected
						$pw_grid_skin_effect,
						                    ^
Main.java:132: error: <identifier> expected
						$pw_grid_page_navigation,
						                        ^
Main.java:133: error: <identifier> expected
						$pw_grid_page_number_style,
						                          ^
Main.java:134: error: <identifier> expected
						$pw_grid_filter_by,
						                  ^
Main.java:135: error: <identifier> expected
						$pw_grid_order_by,
						                 ^
Main.java:138: error: <identifier> expected
						$pw_grid_author,
						               ^
Main.java:139: error: <identifier> expected
						$pw_grid_tags,
						             ^
Main.java:140: error: <identifier> expected
						$pw_grid_show_num_comment,
						                         ^
Main.java:142: error: <identifier> expected
						$pw_grid_hide_recentpost,  //default:show
						                        ^
Main.java:143: error: <identifier> expected
						$pw_grid_num_hide_recentpost,
						                            ^
Main.java:145: error: <identifier> expected
						$pw_grid_switch_icon,
						                    ^
Main.java:146: error: <identifier> expected
						$pw_teasr_layout_img,
						                    ^
Main.java:147: error: <identifier> expected
						$pw_image_thumb_size,
						                    ^
Main.java:148: error: <identifier> expected
						$pw_excerpt_length,
						                  ^
Main.java:149: error: <identifier> expected
						$pw_image_effect,
						                ^
Main.java:150: error: <identifier> expected
						$pw_show_zoom_icon,
						                  ^
Main.java:151: error: <identifier> expected
						$pw_show_link_icon,
						                  ^
Main.java:152: error: <identifier> expected
						$pw_show_overlay,
						                ^
Main.java:153: error: <identifier> expected
						$pw_icon_type,
						             ^
Main.java:154: error: <identifier> expected
						$pw_icon_effect,
						               ^
Main.java:155: error: <identifier> expected
						$pw_hide_date,
						             ^
Main.java:156: error: <identifier> expected
						$pw_date_format,
						               ^
Main.java:157: error: <identifier> expected
						$pw_taxonomy
						            ^
Main.java:160: error: not a statement
			$this->pw_title=$pw_title;
			^
Main.java:161: error: not a statement
			$this->pw_query=$pw_query;
			^
Main.java:162: error: not a statement
			$this->pw_grid_type=$pw_grid_type;
			^
Main.java:164: error: not a statement
			$this->pw_border_top_size = $pw_border_top_size;
			^
Main.java:165: error: not a statement
			$this->pw_border_top_type = $pw_border_top_type;
			^
Main.java:166: error: not a statement
			$this->pw_border_top_color = $pw_border_top_color;
			^
Main.java:168: error: not a statement
			$this->pw_border_right_size = $pw_border_right_size;
			^
Main.java:169: error: not a statement
			$this->pw_border_right_type = $pw_border_right_type;
			^
Main.java:170: error: not a statement
			$this->pw_border_right_color = $pw_border_right_color;
			^
Main.java:172: error: not a statement
			$this->pw_border_bottom_size = $pw_border_bottom_size;
			^
Main.java:173: error: not a statement
			$this->pw_border_bottom_type = $pw_border_bottom_type;
			^
Main.java:174: error: not a statement
			$this->pw_border_bottom_color = $pw_border_bottom_color;
			^
Main.java:176: error: not a statement
			$this->pw_border_left_size = $pw_border_left_size;
			^
Main.java:177: error: not a statement
			$this->pw_border_left_type = $pw_border_left_type;
			^
Main.java:178: error: not a statement
			$this->pw_border_left_color = $pw_border_left_color;
			^
Main.java:180: error: not a statement
			$this->pw_back_color = $pw_back_color;
			^
Main.java:181: error: not a statement
			$this->pw_back_hcolor = $pw_back_hcolor;
			^
Main.java:182: error: not a statement
			$this->pw_item_back_color = $pw_item_back_color;
			^
Main.java:184: error: not a statement
			$this->pw_title_font_family=$pw_title_font_family;
			^
Main.java:185: error: not a statement
			$this->pw_title_font_size=($pw_title_font_size==0 ? 14:$pw_title_font_size);
			^
Main.java:186: error: not a statement
			$this->pw_link_color = $pw_link_color;
			^
Main.java:187: error: not a statement
			$this->pw_link_hover_color = $pw_link_hover_color;
			^
Main.java:188: error: not a statement
			$this->pw_meta_font_family=$pw_meta_font_family;
			^
Main.java:189: error: not a statement
			$this->pw_meta_font_size=($pw_meta_font_size==0 ? 12:$pw_meta_font_size);
			^
Main.java:190: error: not a statement
			$this->pw_meta_color = $pw_meta_color;
			^
Main.java:191: error: not a statement
			$this->pw_excerpt_font_family=$pw_excerpt_font_family;
			^
Main.java:192: error: not a statement
			$this->pw_excerpt_font_size=($pw_excerpt_font_size==0 ? 11:$pw_excerpt_font_size);
			^
Main.java:193: error: not a statement
			$this->pw_excerpt_color = $pw_excerpt_color;
			^
Main.java:194: error: not a statement
			$this->pw_readmore_type = $pw_readmore_type;
			^
Main.java:195: error: not a statement
			$this->pw_readmore_translate = $pw_readmore_translate;
			^
Main.java:197: error: not a statement
			$this->pw_grid_desktop_columns_count=$pw_grid_desktop_columns_count;
			^
100 errors
stdout
Standard output is empty