Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

php - How do i get all post by categories in Wordpress

** I want to get post by categories in WordPress**

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

[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
    )

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...