| @@ -224,9 +224,9 @@ | ||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | public function content( $attr, $noAjax ) { |
| 227 | 227 | $attr = wp_parse_args( $attr, $this->get_attributes() ); |
| 228 | - global $unique_ID; | |
| 228 | + global $ultp_unique_ID; | |
| 229 | 229 | |
| 230 | 230 | if ( ! $noAjax ) { |
| 231 | 231 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 232 | 232 | $attr['paged'] = $paged ? $paged : 1; |
| @@ -231,9 +231,9 @@ | ||
| 231 | 231 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 232 | 232 | $attr['paged'] = $paged ? $paged : 1; |
| 233 | 233 | } |
| 234 | 234 | if ( $attr['queryUnique'] && isset( $attr['savedQueryUnique'] ) ) { |
| 235 | - $unique_ID = $attr['savedQueryUnique']; | |
| 235 | + $ultp_unique_ID = $attr['savedQueryUnique']; | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | $block_name = 'post-grid-6'; |
| 239 | 239 | $vid_icon_redirect = true; // Its used for video icon do not remove it |
| @@ -245,9 +245,9 @@ | ||
| 245 | 245 | $dummy_url = ULTP_URL . 'assets/img/ultp-fallback-img.png'; |
| 246 | 246 | |
| 247 | 247 | // Loadmore and Unique content |
| 248 | 248 | if ( $attr['queryUnique'] && isset( $attr['loadMoreQueryUnique'] ) && $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) { |
| 249 | - $unique_ID = $attr['loadMoreQueryUnique']; | |
| 249 | + $ultp_unique_ID = $attr['loadMoreQueryUnique']; | |
| 250 | 250 | $current_unique_posts = $attr['ultp_current_unique_posts']; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : ''; |
| @@ -263,9 +263,8 @@ | ||
| 263 | 263 | $attr['titleAnimation'] = sanitize_html_class( $attr['titleAnimation'] ); |
| 264 | 264 | $attr['overlayContentPosition'] = sanitize_html_class( $attr['overlayContentPosition'] ); |
| 265 | 265 | |
| 266 | 266 | if ( $recent_posts->have_posts() ) { |
| 267 | - | |
| 268 | 267 | // Pagination Block Html |
| 269 | 268 | include ULTP_PATH . 'blocks/template/pagination_block.php'; |
| 270 | 269 | |
| 271 | 270 | $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'] : '' ) . '">'; |
| @@ -315,9 +314,9 @@ | ||
| 315 | 314 | |
| 316 | 315 | include ULTP_PATH . 'blocks/template/category.php'; |
| 317 | 316 | |
| 318 | 317 | if ( $attr['queryUnique'] ) { |
| 319 | - $unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 318 | + $ultp_unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 320 | 319 | $current_unique_posts[] = $post_id; |
| 321 | 320 | } |
| 322 | 321 | |
| 323 | 322 | $post_loop .= '<' . $attr['contentTag'] . ' class="ultp-block-item post-id-' . $post_id . ' ultp-block-item-' . $idx . ( $attr['titleAnimation'] ? ' ultp-animation-' . $attr['titleAnimation'] : '' ) . '">'; |
| @@ -419,9 +418,9 @@ | ||
| 419 | 418 | $post_loop .= '</' . $attr['contentTag'] . '>'; |
| 420 | 419 | ++$idx; |
| 421 | 420 | endwhile; |
| 422 | 421 | if ( $attr['queryUnique'] ) { |
| 423 | - $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>'; | |
| 422 | + $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>'; | |
| 424 | 423 | } |
| 425 | 424 | |
| 426 | 425 | // if ( $attr['advPaginationEnable'] && ($attr['paginationType'] == 'loadMore')) { |
| 427 | 426 | // $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>'; |
| @@ -437,9 +436,9 @@ | ||
| 437 | 436 | $wraper_after .= '</div>'; |
| 438 | 437 | $wraper_after .= $pagi_block_html; |
| 439 | 438 | $wraper_after .= '</div>'; |
| 440 | 439 | |
| 441 | - wp_reset_query(); | |
| 440 | + wp_reset_postdata(); | |
| 442 | 441 | } else { |
| 443 | 442 | $wraper_before .= ultimate_post()->get_no_result_found_html( $attr['notFoundMessage'] ); |
| 444 | 443 | } |
| 445 | 444 | |