gpt4 book ai didi

wordpress - 如何从 header.php 文件中获取页面 ID

转载 作者:行者123 更新时间:2023-12-02 04:11:10 26 4
gpt4 key购买 nike

如何从 header.php 文件中获取页面 ID? $post->ID 和 get_the_ID() 不起作用。

最佳答案

以下将起作用:

$ID = $wp_query->post->ID;

关于wordpress - 如何从 header.php 文件中获取页面 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36673494/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com