'events', 'posts_per_page' => $pageSize, 'offset' => $offset ); $post = new WP_Query( $args ); $json = array(); $i = 0; while ($post->have_posts()) : $post->the_post(); $data = array( 'preview' => wp_get_attachment_image_src( get_post_thumbnail_id(), 'full')[0], 'title' => get_the_title(), 'cover_image' => get_field('cover_image')['url'], 'pictures' => get_field('pictures'), 'content' => get_the_content(), 'brief' => get_field('brief') ); $json[$i] = $data; $i++; endwhile; $ret = array('code' => 0, 'data' => $json); echo json_encode($ret); exit; } } add_action('init', 'wp_ajax_events'); endif; if ( ! function_exists( 'wp_ajax_events_item' ) ) : function wp_ajax_events_item() { if ($_GET['action'] == 'wp_ajax_events_item') { $offset = $_GET['offset'] || 0; $pageSize = 100; $args = array( 'post_type' => 'events', 'posts_per_page' => $pageSize, 'offset' => $offset ); $post = new WP_Query( $args ); $json = array(); $i = 0; while ($post->have_posts()) : $post->the_post(); $data = array( 'preview' => wp_get_attachment_image_src( get_post_thumbnail_id(), 'full')[0], 'title' => get_the_title(), 'cover_image' => get_field('cover_image')['url'], 'pictures' => get_field('pictures'), 'content' => get_the_content(), 'brief' => get_field('brief') ); $json[$i] = $data; $i++; endwhile; $ret = array('code' => 0, 'data' => $json); echo json_encode($ret); exit; } } add_action('init', 'wp_ajax_events_item'); endif; ?> Setting Entertainment | Entertainment for All

SE | setting entertainment

Contact

Come play with us

1.844.SETTENT

hello@settent.com

settent.com

save contact

Setting Entertainment

West Coast

Setting Entertainment LLC
3033 Wilshire Blvd Ste 1407,
Los Angeles, CA 90010

East Coast

Setting Entertainment LLC
One PPG Place 31st Floor, 
Pittsburgh, PA 15222