简体   繁体   English

我如何在 Wordpress 中按类别获取所有帖子

[英]How do i get all post by categories in Wordpress

** I want to get post by categories in WordPress** ** 我想在 WordPress 中按类别发布帖子**

    $args = array('post_type' =>  'project' ); 
$postslist = get_posts( $args ); 

[0] => WP_Post Object ( [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
    )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM