tob*_*may 0 css php syntax wordpress
我有一个简短的问题,可能很容易回答,但我今天愚蠢..
有人可以告诉我正确的语法来关闭<h4>我的数组并向我解释正确的语法吗?谢谢!
<?php
wp_nav_menu(
array(
'theme_location' => '1st_menu',
'before' => '<h4 '<?php if ( is_page('5')) { echo ' id="visible"'; } ?> >',
'after' => '</h4>'
)
);
?>
Run Code Online (Sandbox Code Playgroud)
我猜是这样的:
<?php
wp_nav_menu(
array(
'theme_location' => '1st_menu',
'before' => '<h4 '.(is_page('5') ? ' id="visible"' : '').' >',
'after' => '</h4>'
)
);
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
158 次 |
| 最近记录: |