wordpress - Show an echo function inside an echo function in a div
问题描述
I am trying to display a variable inside a php function.
This is the code:
if ( is_user_logged_in() ) {
echo '<div id="cp_subbtn" class="cp_subbtn"><?php echo $l_continue; ?></div>' ; } else { echo 'You are not logged in.' ; }
What I get is just a stylized div ( class="cp_sbbtn"
), but I have no text displayed. I am trying to figure out how to display a variable ( $l_continue
) text inside an echo function, like in this case.
解决方案
尝试这个
if ( is_user_logged_in() ) {
echo '<div id="cp_subbtn" class="cp_subbtn">'.$l_continue.'</div>' ;
}
else {
echo 'You are not logged in.' ;
}
你可以只连接字符串
推荐阅读
- node.js - 批准节点js中的支付网关集成
- r - 在R中按变量扩展列但保留原始变量?
- jquery - Shabuninil FileUp 和进度条(未定义 Var 事件)
- javascript - 是否有任何浏览器原生的 360 旋转查看器?
- spring-boot - SpringBatch:如果一行大于我的最后一个范围,如何不出错?
- powershell - 从 PowerShell 中的哈希映射中获取字符串
- python - 如何使用 python 中的 semopy 包获得标准化的因子载荷?
- javascript - 字符串的处理
- git - Git:如何为给定的存储库设置非标准的私有 SSH 密钥路径
- python - 如何修复 salesforce wave FUNCTIONALITY_NOT_ENABLED 错误?