<?php if (function_exists('get_highest_score_category')): ?>
<?php get_highest_score_category(81); ?>
<?php endif; ?>
index.php代码:
<?php query_posts('showposts=5&orderby=date&cat=81'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url(); ?>
<div class="kOrta1"><div class="oNo">1.</div><div class="oTip"><img src="<?php bloginfo('template_url'); ?>/images/metin2kucuk.png" /></div><div class="oServer">
<?php if (function_exists('get_highest_score_category')): ?>
<?php get_highest_score_category(81); ?>
<?php endif; ?></div><div class="oDurum"><img src="<?php bloginfo('template_url'); ?>/images/<?php echo get_post_meta($post->ID, "metin_selectt", true); ?>.png" /></div><div class="oZorluk"><?php echo get_post_meta($post->ID, "metin_select", true); ?></div><div class="temizle"></div></div>
<?php endwhile; ?>
</div></div></div></div>
我的问题示例:
答案 0 :(得分:0)
我试图理解代码,这是我能够提出的:
<?php
query_posts('showposts=5&orderby=date&cat=81');
while (have_posts()) : the_post();
if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url();
?>
<div class="kOrta1">
<div class="oNo">1.</div>
<div class="oTip">
<img src="<?php bloginfo('template_url'); ?>/images/metin2kucuk.png" />
</div>
<div class="oServer">
<?php
if (function_exists('get_highest_score_category')):
get_highest_score_category(81);
endif;
?>
</div>
<div class="oDurum">
<img src="<?php bloginfo('template_url'); ?>/images/<?php echo get_post_meta($post->ID, "metin_selectt", true); ?>.png" />
</div>
<div class="oZorluk">
<?php
echo get_post_meta($post->ID, "metin_select", true);
?>
</div>
<div class="temizle"></div>
</div>
<?php
endwhile;
?>
</div>
</div>
</div>
</div>
我所看到的只是一个责备的循环。我猜想have_posts()
和the_post()
的某些内容效果不佳,导致它重复发布。