'post', 'posts_per_page' => '-1', 'category_name' => ! empty( $themotion_video_category ) && 'all' != $themotion_video_category ? esc_html( $themotion_video_category ) : '', ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { ?>
have_posts() ) { $the_query->the_post(); if ( 3 == $post_count ) { break; } $id = get_the_ID(); if ( has_post_format( 'video', $id ) ) { $post = get_post( $id ); $content = apply_filters( 'the_content', $post->post_content ); $embeds = get_media_embedded_in_content( $content ); if ( ! empty( $embeds ) ) { ?>
'post', 'posts_per_page' => '-1', 'category_name' => ! empty( $themotion_video_category ) && 'all' != $themotion_video_category ? esc_html( $themotion_video_category ) : '', ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { ?> 'post', 'post_status' => 'publish', 'posts_per_page' => 3, 'ignore_sticky_posts' => 1, ); if ( ! empty( $themotion_cat ) ) { $args['category_name'] = $themotion_cat; } $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { ?> have_posts() ) { $the_query->the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'template-parts/content', 'about' ); } the_posts_navigation( array( 'prev_text' => sprintf( '← %s', __( 'Older Posts', 'themotion' ) ), 'next_text' => sprintf( '%s →', __( 'Newer Posts', 'themotion' ) ), ) ); } else { get_template_part( 'template-parts/content', 'none' ); } /* Restore original Post Data */ wp_reset_postdata(); } /** * Live Update Bottom of Home A. */ function themotion_ajax_homea_bottom( $themotion_video_category ) { $themotion_cat = ( ! empty( $themotion_video_category ) && 'all' != $themotion_video_category ? $themotion_video_category : ''); $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 6, 'ignore_sticky_posts' => 1, ); if ( ! empty( $themotion_cat ) ) { $args['category_name'] = $themotion_cat; } $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { ?> have_posts() ) { $the_query->the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'template-parts/content', 'home-one' ); } the_posts_navigation( array( 'prev_text' => sprintf( '← %s', __( 'Older Posts', 'themotion' ) ), 'next_text' => sprintf( '%s →', __( 'Newer Posts', 'themotion' ) ), ) ); } else { get_template_part( 'template-parts/content', 'none' ); } /* Restore original Post Data */ wp_reset_postdata(); } /** * Live Update Bottom of Home B. */ function themotion_ajax_homeb_bottom( $themotion_video_category ) { $themotion_cat = ( ! empty( $themotion_video_category ) && 'all' != $themotion_video_category ? $themotion_video_category : ''); $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 3, 'ignore_sticky_posts' => 1, ); if ( ! empty( $themotion_cat ) ) { $args['category_name'] = $themotion_cat; } $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { ?> have_posts() ) { $the_query->the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'template-parts/content', 'home-two' ); } the_posts_navigation( array( 'prev_text' => sprintf( '← %s', __( 'Older Posts', 'themotion' ) ), 'next_text' => sprintf( '%s →', __( 'Newer Posts', 'themotion' ) ), ) ); } else { get_template_part( 'template-parts/content', 'none' ); } /* Restore original Post Data */ wp_reset_postdata(); } add_action( 'wp_ajax_nopriv_request_post', 'themotion_requestpost' ); add_action( 'wp_ajax_request_post', 'themotion_requestpost' ); /** * Post Request. */ function themotion_requestpost() { $themotion_page = $_POST['page']; if ( 'homeb' == $themotion_page ) { $themotion_video_category = $_POST['category']; $themotion_is_hidden = $_POST['is_hidden']; themotion_ajax_homeb( $themotion_video_category, $themotion_is_hidden ); } elseif ( 'homea' == $themotion_page ) { $themotion_video_category = $_POST['category']; themotion_ajax_homea( $themotion_video_category ); } elseif ( 'about' == $themotion_page ) { $themotion_video_category = $_POST['category']; themotion_ajax_about( $themotion_video_category ); } elseif ( 'homea_bottom' == $themotion_page ) { $themotion_video_category = $_POST['category']; themotion_ajax_homea_bottom( $themotion_video_category ); } elseif ( 'homeb_bottom' == $themotion_page ) { $themotion_video_category = $_POST['category']; themotion_ajax_homeb_bottom( $themotion_video_category ); } die(); }