WordPress Chinese Forums's Archiver

lanlanxin 发表于 2008-11-11 21:32

还是不同分类日志模板问题

<?php if (is_category('Category A')) { ?>
<p>This is the text to describe category A</p>
<?php } elseif (is_category('Category B')) { ?>
<p>This is the text to describe category B</p>
<?php } else { ?>
<p>This is some generic text to describe all other category pages,
I could be left blank</p>
<?php } ?>
按照官方的这样的代码还是不行  

<?php
$post = $wp_query->post;
if ( in_category('12') ) {
include(TEMPLATEPATH . '/singleHighlightTour.php');?>
<?php } elseif { ( in_category('64') {
include(TEMPLATEPATH . '/singleHistoric.php');?>
<?php } elseif { ( in_category('70') {
include(TEMPLATEPATH . '/singleLijiang.php'); ?>
<?php } elseif { ( in_category('11') {
include(TEMPLATEPATH . '/singleRecommended.php');
<?php } elseif { ( in_category('7') {
include(TEMPLATEPATH . '/singleSilkRoad.php');
<?php } elseif { ( in_category('13') {
include(TEMPLATEPATH . '/singleSingleCity.php');
<?php } elseif { ( in_category('69') {
include(TEMPLATEPATH . '/singleTibet.php');
<?php } elseif { ( in_category('62') {
include(TEMPLATEPATH . '/singleYangtzeRiver.php');
<?php } else { {
include(TEMPLATEPATH . '/singlectg.php');
} }
?>

这个也是不成 不知道怎么搞了  郁闷死了
高人来出来帮忙下

lanlanxin 发表于 2008-11-12 09:41

这个问题貌似很难解决啊

wumao 发表于 2008-12-1 19:21

这个问题我也不知道。我用了以后,单篇日志显示重复,在foot下面又显示了一次

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.