在我的单曲里。php文件我想有一个条件,检查后的类别,并显示某些图像和布局。以下是我所拥有的:http://pastebin.com/dy6TE1yr
我在Single.php中的条件条件问题(按类别)
1 个回复
最合适的回答,由SO网友:hash 整理而成
看看http://codex.wordpress.org/Function_Reference/in_category
示例:
<?php if ( in_category(\'rabbis-weekly-commentary\') ) : ?>
<div id="inner_header">
<img src="http://www.ifcj.ca/ifcj_ca/images/elements/commentary_header.gif" border="0">
...
<?php elseif ( in_category(\'yaels-weekly-commentary\') ) : ?>
<div id="inner_header">
<img src="http://www.ifcj.ca/ifcj_ca/images/elements/commentary_header.gif" border="0">
结束