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