Wp_Query foreach ループの中で post_excerpt が取得できません。教えていただけないでしょうか。
php
1$query = new WP_Query( $args ); 2 3$orderby = 'post_date_gmt'; 4$order = 'DESC'; 5$request = str_replace( "SQL_CALC_FOUND_ROWS", "", $query->request ); 6$tmp_request_array1 = explode( 'ORDER BY', $request ); 7$tmp_request_array2 = explode( $order, $tmp_request_array1[1] ); 8$request = $tmp_request_array1[0] . ' ORDER BY ' . "$wpdb->postmeta.meta_value DESC, $wpdb->posts.post_date_gmt $order" . $tmp_request_array2[1]; 9 10$request_result = $wpdb->get_results( $request, OBJECT_K ); 11 12if ( ! empty( $request_result ) ) { 13 foreach ( $request_result as $post ) { 14 $GLOBALS['post_id'] = $post->ID; 15 //以下1行抜粋表示用に追加,右辺でexcerpt(抜粋)の取得が出来ていません。 16 $GLOBALS['post_bassui'] = $post->post_excerpt; 17 $GLOBALS['featured_cars_autoslide'] = ! isset( $set_featured_autoslide ) || $set_featured_autoslide; 18 $GLOBALS['recent_cars_show_currency_converter'] = ! isset( $show_recent_cars_currency_converter ) || $show_recent_cars_currency_converter; 19 $GLOBALS['recent_cars_show_details_button'] = ! isset( $show_details_button ) || $show_details_button; 20 get_template_part( 'article', 'car' ); 21 } 22} 23wp_reset_query(); 24 25
var_dump();で調べたところ、$tmp_request_array2の次の行の$requestでは以下の様になっており、その次の行の$request_resultのvar_dump();はnullと出ています(このnullについても理由がイマイチつかめていません)。
php
1string(450) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id AND mt1.meta_key = '_icl_lang_duplicate_of' ) WHERE 1=1 AND ( 2 wp_postmeta.meta_key = 'car_is_featured' 3 AND 4 ( 5 mt1.post_id IS NULL 6 ) 7) AND wp_posts.post_type = 'car' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value DESC LIMIT 0, 12"
なんとなく、$request から$request_result の過程でexcerpt(抜粋)をどこかに入れる?と考えているのですが、ここから先がわからないのでご教示いただけませんでしょうか。
宜しくお願い致します。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。