有人知道如何用wordpress PHP编写下一行吗,因为我对PHP不是很在行。
If\\u theme\\u mode有content echo{我的内容}或者{其他内容};
thnx公司
有人知道如何用wordpress PHP编写下一行吗,因为我对PHP不是很在行。
If\\u theme\\u mode有content echo{我的内容}或者{其他内容};
thnx公司
请尝试以下代码:
if( get_theme_mod(\'your_setting_name\') ){
//your code
}else{
//your code
}
Note: get_theme_mod() 如果设置不存在值,则返回false您可以检查主题mod,如果存在则回显,如果没有,则应用默认值,所有操作都只需一行:
echo get_theme_mod( \'example\', \'Some default\' );
我已经在我的profile.php 页我希望能够使用pre_get_posts 但我找不到任何方法来区分此页面和常规媒体库(upload.php).使用全局$pagenow 退货admin-ajax.php 在这两种情况下。有没有其他方法可以判断哪个页面正在加载媒体库?