如何在WordPress中像POST一样将页面作为参数传递? 时间:2018-08-07 作者:Shriram 我使用此代码在帖子中传递参数:$args_automobile_just_launched_bike = array( \'posts_per_page\' => 3, \'post_type\' => \'post\', \'order\' => \'DESC\', \'meta_query\' => array( array( \'key\' => \'wpcf-new-launch-bikes\', \'value\' => \'1\', ), ), ); 这是动态获取帖子的格式如何对Page执行相同操作? 1 个回复 最合适的回答,由SO网友:Jacob Peattie 整理而成 页面是帖子,您只需更改post_type 到page:$args_automobile_just_launched_bike = array( \'posts_per_page\' => 3, \'post_type\' => \'page\', \'order\' => \'DESC\', \'meta_query\' => array( array( \'key\' => \'wpcf-new-launch-bikes\', \'value\' => \'1\', ), ), ); 结束 文章导航