get_permalink(0);的结果

我是wordpress的新手, 现在正在学习教程, 但我不了解wordpress的行为。我正在尝试更改侧栏的标题, 该侧栏列出了父页面及其子页面, 虽然工作正常, 但我不明白为什么$ parentID = wp_get_post_parent_id(get_the_ID());回声get_permalink($ parentID);即使在父页面上也可以工作, 我在父页面上回显了结果, 并且由于父页面没有父对象, 因此它返回0, 为什么这仍然起作用?为什么get_permalink(0);如果按下按钮, 可以将我带到父页面?


#1


get_permalink()是为你提供当前循环内的帖子/页面链接的函数。由于你没有当前页面的父页面, 因此get_permalink无法将你带到父页面, 因为不存在任何页面, 因此在这种情况下, 它将重新引导你到同一页面。

来源:

https://www.srcmini02.com/63853.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37562.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?