Deneyin bakalım... Verdiğim linkdeki kod bu kategoriye göre benzer yazılar
<div class="singlebaslikana">Son Haberler</div> <div class="singlebaslikortaana">
<?php
$categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
'category__in' => $category_ids,
'post__not_in' => array($post->ID),
'showposts'=>12, // Gösterilecek benzer yazı sayısı
'caller_get_posts'=>1
);
$my_query = new wp_query($args);
if( $my_query->have_posts() ) {
echo '';
while ($my_query->have_posts()) {
$my_query->the_post();
?>
<div class="singlehaber"> <?php if( get_post_meta($post->ID, "Thumbnail", true) ): ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
<?php else: ?>
<a href="<?php the_permalink() ?>" rel="bookmark">
<img src="<?php bloginfo('template_url'); ?>/images/kirita.png" alt="<?php the_title(); ?>" /></a>
<?php endif; ?> <h2><a href="<?php the_permalink() ?>" rel="bookmark"> <?php if (strlen($post->post_title) > 50) {
echo mb_substr(the_title($before = '', $after = '', FALSE), 0, 50) . '...'; } else {
the_title();
} ?> </a></h2>
<div class="entry"> <a href="<?php the_permalink() ?>"><?php the_content_limit(70, ""); ?></a> </div> </div>
<?php
}
echo '';
}
wp_reset_query();
}
?>
</div> <div class="singlebaslikaltana"></div>
</div>