本文介绍了我如何在 Wordpress 中按类别获取所有帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
** 我想在 WordPress 中按类别发布帖子**
** I want to get post by categories in WordPress**
$args = array('post_type' => 'project' );
$postslist = get_posts( $args );
推荐答案
[0] =>WP_Post 对象([ID] =>421
[0] => WP_Post Object([ID] => 421
[post_author] => 2
[post_date] => 2020-12-14 04:13:09
[post_date_gmt] => 2020-12-14 04:13:09
[post_content] =>
[post_title] => Recent Project 05
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => closed
[post_password] =>
[post_name] => recent-project-05
[to_ping] =>
[pinged] =>
[post_modified] => 2020-12-14 04:13:09
[post_modified_gmt] => 2020-12-14 04:13:09
[post_content_filtered] =>
[post_parent] => 0
[guid] => https://staging2.totalreclaims.com/?post_type=project&p=421
[menu_order] => 0
[post_type] => project
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
这篇关于我如何在 Wordpress 中按类别获取所有帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!