WordPress Kategoriden yazı çekmek

Ağustos 10th, 2010 by admin | Posted under Webmaster.

wordpresste artık istediğiniz kategoriden istediğiniz
kadar yazıyı tek bir sayfaya ya da anasayfanıza çekebilirsiniz.
Bu konuda yazılmış kodu aşağıdadır.

Unutmadan kategorilerdeki son konuları çeker.

$display_categories = array(1,2,3,4,5,6);

buradaki sayılar kategorilerin idleridir.

Buraya hangi kategoriden

yararlanacaksanız onun id sini yazın.

<?php query_posts(“showposts=5&cat=$category”);

Buradaki 5 te kategorideki son 5 yazıyı gosterir.
kod :
<?php
$display_categories = array(1,2,3,4,5,6);
foreach ($display_categories as $category) {
?>
<?php query_posts(“showposts=5&cat=$category”);
$wp_query->is_category = false;
$wp_query->is_archive = false;
$wp_query->is_home = true;
$count = 0; while (have_posts())
{    the_post(); if( $count == 0 )
{ ?>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark”
title=”Permanent Link to <?php the_title_attribute(); ?>”>
<?php the_title(); ?> &raquo;</a></h2>
<?php the_excerpt(); ?>
<ul>
<?php } else { ?>
<li><a href=”<?php the_permalink() ?>” rel=”bookmark”>
<?php the_title(); ?></a></li>
<?php    } ?>
<?php $count ++; } if( $count > 0 ) { echo “</ul>”; }
echo “<ul>”; } ?>

Do you have any comments on WordPress Kategoriden yazı çekmek ?