| @@ -228,9 +228,9 @@ | ||
| 228 | 228 | ); |
| 229 | 229 | } |
| 230 | 230 | public function content( $attr, $noAjax ) { |
| 231 | 231 | $attr = wp_parse_args( $attr, $this->get_attributes() ); |
| 232 | - global $unique_ID; | |
| 232 | + global $ultp_unique_ID; | |
| 233 | 233 | |
| 234 | 234 | if ( ! $noAjax ) { |
| 235 | 235 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 236 | 236 | $attr['paged'] = $paged ? $paged : 1; |
| @@ -235,9 +235,9 @@ | ||
| 235 | 235 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 236 | 236 | $attr['paged'] = $paged ? $paged : 1; |
| 237 | 237 | } |
| 238 | 238 | if ( $attr['queryUnique'] && isset( $attr['savedQueryUnique'] ) ) { |
| 239 | - $unique_ID = $attr['savedQueryUnique']; | |
| 239 | + $ultp_unique_ID = $attr['savedQueryUnique']; | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $block_name = 'post-grid-5'; |
| 243 | 243 | $vid_icon_redirect = true; // Its used for video icon do not remove it |
| @@ -249,9 +249,9 @@ | ||
| 249 | 249 | $dummy_url = ULTP_URL . 'assets/img/ultp-fallback-img.png'; |
| 250 | 250 | |
| 251 | 251 | // Loadmore and Unique content |
| 252 | 252 | if ( $attr['queryUnique'] && isset( $attr['loadMoreQueryUnique'] ) && $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) { |
| 253 | - $unique_ID = $attr['loadMoreQueryUnique']; | |
| 253 | + $ultp_unique_ID = $attr['loadMoreQueryUnique']; | |
| 254 | 254 | $current_unique_posts = $attr['ultp_current_unique_posts']; |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : ''; |
| @@ -311,9 +311,9 @@ | ||
| 311 | 311 | |
| 312 | 312 | include ULTP_PATH . 'blocks/template/category.php'; |
| 313 | 313 | |
| 314 | 314 | if ( $attr['queryUnique'] ) { |
| 315 | - $unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 315 | + $ultp_unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 316 | 316 | $current_unique_posts[] = $post_id; |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | $post_loop .= '<' . $attr['contentTag'] . ' class="ultp-block-item post-id-' . $post_id . ( $attr['titleAnimation'] ? ' ultp-animation-' . $attr['titleAnimation'] : '' ) . '">'; |
| @@ -415,9 +415,9 @@ | ||
| 415 | 415 | $post_loop .= '</' . $attr['contentTag'] . '>'; |
| 416 | 416 | ++$idx; |
| 417 | 417 | endwhile; |
| 418 | 418 | if ( $attr['queryUnique'] ) { |
| 419 | - $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>'; | |
| 419 | + $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>'; | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | // if ( $attr['advPaginationEnable'] && ($attr['paginationType'] == 'loadMore')) { |
| 423 | 423 | // $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>'; |
| @@ -433,9 +433,9 @@ | ||
| 433 | 433 | $wraper_after .= '</div>'; |
| 434 | 434 | $wraper_after .= $pagi_block_html; |
| 435 | 435 | $wraper_after .= '</div>'; |
| 436 | 436 | |
| 437 | - wp_reset_query(); | |
| 437 | + wp_reset_postdata(); | |
| 438 | 438 | } else { |
| 439 | 439 | $wraper_before .= ultimate_post()->get_no_result_found_html( $attr['notFoundMessage'] ); |
| 440 | 440 | } |
| 441 | 441 | |