$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( '
';} wp_reset_postdata();
本文介绍了一种在WordPress中处理特定格式的博客文章的方法,通过PHP代码实现对标准格式以外的文章进行筛选和展示,适用于需要定制化显示内容的场景。
536

被折叠的 条评论
为什么被折叠?



