| @@ -18,8 +18,9 @@ | ||
| 18 | 18 | // -------------------------- |
| 19 | 19 | // Layout |
| 20 | 20 | // -------------------------- |
| 21 | 21 | 'layout' => 'layout1', |
| 22 | + 'infiniteScroll' => false, | |
| 22 | 23 | |
| 23 | 24 | // -------------------------- |
| 24 | 25 | // Query Setting |
| 25 | 26 | // -------------------------- |
| @@ -232,9 +233,9 @@ | ||
| 232 | 233 | } |
| 233 | 234 | |
| 234 | 235 | public function content( $attr, $noAjax ) { |
| 235 | 236 | $attr = wp_parse_args( $attr, $this->get_attributes() ); |
| 236 | - global $unique_ID; | |
| 237 | + global $ultp_unique_ID; | |
| 237 | 238 | |
| 238 | 239 | if ( ! $noAjax ) { |
| 239 | 240 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 240 | 241 | $attr['paged'] = $paged ? $paged : 1; |
| @@ -239,9 +240,9 @@ | ||
| 239 | 240 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 240 | 241 | $attr['paged'] = $paged ? $paged : 1; |
| 241 | 242 | } |
| 242 | 243 | if ( $attr['queryUnique'] && isset( $attr['savedQueryUnique'] ) ) { |
| 243 | - $unique_ID = $attr['savedQueryUnique']; | |
| 244 | + $ultp_unique_ID = $attr['savedQueryUnique']; | |
| 244 | 245 | } |
| 245 | 246 | |
| 246 | 247 | $block_name = 'post-list-4'; |
| 247 | 248 | $vid_icon_redirect = true; // Its used for video icon do not remove it |
| @@ -253,9 +254,9 @@ | ||
| 253 | 254 | $dummy_url = ULTP_URL . 'assets/img/ultp-fallback-img.png'; |
| 254 | 255 | |
| 255 | 256 | // Loadmore and Unique content |
| 256 | 257 | if ( $attr['queryUnique'] && isset( $attr['loadMoreQueryUnique'] ) && $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) { |
| 257 | - $unique_ID = $attr['loadMoreQueryUnique']; | |
| 258 | + $ultp_unique_ID = $attr['loadMoreQueryUnique']; | |
| 258 | 259 | $current_unique_posts = $attr['ultp_current_unique_posts']; |
| 259 | 260 | } |
| 260 | 261 | |
| 261 | 262 | $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : ''; |
| @@ -269,15 +270,22 @@ | ||
| 269 | 270 | $attr['popupAutoPlay'] = $attr['popupAutoPlay'] == true; |
| 270 | 271 | $attr['readMoreText'] = wp_kses( $attr['readMoreText'], ultimate_post()->ultp_allowed_html_tags() ); |
| 271 | 272 | $attr['varticalAlign'] = sanitize_html_class( $attr['varticalAlign'] ); |
| 272 | 273 | |
| 274 | + $iscroll = ''; | |
| 275 | + $wrap_data = ''; | |
| 276 | + if ( $attr['infiniteScroll'] ) { | |
| 277 | + $iscroll = 'ultp-iscroll-active'; | |
| 278 | + include ULTP_PATH . 'blocks/template/infinite_scroll_data.php'; | |
| 279 | + } | |
| 280 | + | |
| 273 | 281 | if ( $recent_posts->have_posts() ) { |
| 274 | 282 | |
| 275 | 283 | // Pagination Block Html |
| 276 | 284 | include ULTP_PATH . 'blocks/template/pagination_block.php'; |
| 277 | 285 | |
| 278 | - $wraper_before .= '<div ' . ( $attr['advanceId'] ? 'id="' . $attr['advanceId'] . '" ' : '' ) . ' class="ultp-post-grid-block wp-block-ultimate-post-' . $block_name . ' ultp-block-' . $attr['blockId'] . '' . ( $attr['align'] ? ' align' . $attr['align'] : '' ) . '' . ( $attr['className'] ? ' ' . $attr['className'] : '' ) . '">'; | |
| 279 | - $wraper_before .= '<div class="ultp-block-wrapper">'; | |
| 286 | + $wraper_before .= '<div ' . ( $attr['advanceId'] ? 'id="' . $attr['advanceId'] . '" ' : '' ) . ' class="ultp-post-grid-block wp-block-ultimate-post-' . $block_name . ' ultp-block-' . $attr['blockId'] . '' . ( $attr['align'] ? ' align' . $attr['align'] : '' ) . '' . ( $attr['className'] ? ' ' . $attr['className'] : '' ) . ' ' . $iscroll . '">'; | |
| 287 | + $wraper_before .= '<div class="ultp-block-wrapper" ' . $wrap_data . '>'; | |
| 280 | 288 | |
| 281 | 289 | // Loading |
| 282 | 290 | $wraper_before .= ultimate_post()->postx_loading(); |
| 283 | 291 | |
| @@ -322,9 +330,9 @@ | ||
| 322 | 330 | |
| 323 | 331 | include ULTP_PATH . 'blocks/template/category.php'; |
| 324 | 332 | |
| 325 | 333 | if ( $attr['queryUnique'] ) { |
| 326 | - $unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 334 | + $ultp_unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 327 | 335 | $current_unique_posts[] = $post_id; |
| 328 | 336 | } |
| 329 | 337 | |
| 330 | 338 | $post_loop .= '<' . $attr['contentTag'] . ' class="ultp-block-item ultp-block-media post-id-' . $post_id . '">'; |
| @@ -440,9 +448,9 @@ | ||
| 440 | 448 | $post_loop .= '</' . $attr['contentTag'] . '>'; |
| 441 | 449 | ++$idx; |
| 442 | 450 | endwhile; |
| 443 | 451 | if ( $attr['queryUnique'] ) { |
| 444 | - $post_loop .= "<span style='display: none;' class='ultp-current-unique-posts' data-ultp-unique-ids= " . wp_json_encode( $unique_ID ) . ' data-current-unique-posts= ' . wp_json_encode( $current_unique_posts ) . '> </span>'; | |
| 452 | + $post_loop .= "<span style='display: none;' class='ultp-current-unique-posts' data-ultp-unique-ids= " . wp_json_encode( $ultp_unique_ID ) . ' data-current-unique-posts= ' . wp_json_encode( $current_unique_posts ) . '> </span>'; | |
| 445 | 453 | } |
| 446 | 454 | // if ( ( $attr['paginationShow'] || $attr['advPaginationEnable'] ) && ($attr['paginationType'] == 'loadMore')) { |
| 447 | 455 | // $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>'; |
| 448 | 456 | // } |
| @@ -467,9 +475,9 @@ | ||
| 467 | 475 | $wraper_after .= '</div>'; |
| 468 | 476 | $wraper_after .= $pagi_block_html; |
| 469 | 477 | $wraper_after .= '</div>'; |
| 470 | 478 | |
| 471 | - wp_reset_query(); | |
| 479 | + wp_reset_postdata(); | |
| 472 | 480 | } else { |
| 473 | 481 | $wraper_before .= ultimate_post()->get_no_result_found_html( $attr['notFoundMessage'] ); |
| 474 | 482 | } |
| 475 | 483 | |