get_the_ID() ; 获取当前帖子的id,
wp_get_post_parent_id( get_the_ID() ) 获取当前帖子的上级帖子的ID。
基本上,不带get的函数都是用在循环里面的,比方说the_ID() 就是在loop里面, the_content、the_title、
the_excerpt也是用在loop里面, 用get可以在默认的query里面用,只要添加id就可以调用任何帖子的任何内容。
the_ID() = echo get_the_ID()
© 2020-2022 weblinks.cc版权所有