absint('0'), 'childless' => true, )); $_pagination = true; $get_data = ''; $per_page = absint( '9' ); $start_div = $per_page; $end_div = $page_counter = absint( '1' ); $items = count( $args ); ?>term_id, 'term_image_id', true ); if( $image_id != '' ){ $category_image = wp_get_attachment_image_src( $image_id, 'full', false )[ '0' ]; }else{ $category_image = esc_url( WEDDINGCITY_THEME_DIR . '/images/category-image.jpg' ); } if( $start_div % $per_page == absint( '0' ) && ( $items >= $per_page ) && $_pagination ){ $get_data .= sprintf( '
', $page_counter ); $page_counter++; } $get_data .= sprintf('
%2$s

%2$s (%4$s)

', // 1 esc_url( $category_image ), // 2 $key->name, // 3 get_term_link( $key ), // 4 absint( $key->count ) ); if( $end_div % $per_page == absint( '0' ) && ( $items >= $per_page ) && $_pagination ){ $get_data .= '
'; } $end_div++; $start_div++; } printf( $get_data ); if( $_pagination ){ ?>
WeddingCity_Texonomy:: listing_location_taxonomy(), 'field' => 'id', 'terms' => absint ( $category->term_id ) ); } $args = array( 'post_type' => 'listing', 'post_status' => 'publish', 'posts_per_page' => -1, 'orderby' => 'menu_order ID', 'order' => 'post_date', 'tax_query' => array( 'relation' => 'AND', $category_type_array, ), ); $_pagination = false; $get_data = ''; $per_page = absint( '6' ); $start_div = $per_page; $end_div = $page_counter = absint( '1' ); $item = new WP_Query( $args ); if( $item->have_posts() ){ while ( $item->have_posts() ){ $item->the_post(); if( $start_div % $per_page == absint( '0' ) && ( $item->post_count >= $per_page ) && $_pagination ){ $get_data .= sprintf( '
', $page_counter ); $page_counter++; } $get_data .= '
'; $get_data .= WeddingCity_Listing:: weddingcity_listing( get_the_ID() ); $get_data .= '
'; if( $end_div % $per_page == absint( '0' ) && ( $item->post_count >= $per_page ) && $_pagination ){ $get_data .= '
'; } $end_div++; $start_div++; } wp_reset_postdata(); // while end printf( $get_data ); } if( $_pagination ){ ?>