wordpress foreach用法

$formats = get_post_format_slugs(); foreach ( (array) $formats as $i => $format ) { $formats[$i] = 'post-format-' . $format;} $standard_posts = get_posts( array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => $formats, 'operator' => 'NOT IN' ) )) ); global $post; foreach( (array) $standard_posts as $post ) { setup_postdata( $post ); print '
'; the_title( '

', '

' ); the_content(); print '
';} wp_reset_postdata();

你可能感兴趣的:(wordpress)