我对wordpress php非常陌生。应该使用哪个函数来替换代码中的is_account_page()。这是我之前想要达到的目标
if (is_account_page()){
do some code here
}之后
if (user on this page slug){
do some code here
}对于这个页面段式部分的用户,我应该使用的适当功能是什么?
发布于 2021-01-31 16:42:15
您可以尝试使用is_page()函数- https://developer.wordpress.org/reference/functions/is_页/页
函数签名接受一个参数- $page
(int-字符串-int[]-string[])(可选)要检查的页面ID、标题、弹格或数组。
默认值:“”
if ( is_page('account') ){
// do some code here
}https://wordpress.stackexchange.com/questions/382533
复制相似问题