Arkadaşlar eski temam olan ibizpress de benzer sayfalar tema içine monte edilmişti.
<?php include (TEMPLATEPATH . '/related_posts.php'); ?>
ile single php de çağırılıyordu. yeni temama da bunu eklemek istiyorum ama biyerlerde yanlışlık yapıyorum galiba...
Related Postu yeni temama göre şöyle düzenledim...
<?php
$this_post = $post;
$category = get_the_category();
$category = $category[0];
$category = $category->cat_ID;
$posts = get_posts('numberposts=5&offset=0&orderby=post_date&order=DESC&category='.$category);
$count = 0;
foreach ( $posts as $post )
{
if ( $post->ID == $this_post->ID || $count == 5)
{
unset($posts[$count]);
}
else
{
$count ++;
}
}
$post_count = 0;
?>
<?php if ( $posts ) : ?>
<div id="latest_area">
<h2>Related Posts</h2>
<?php foreach ( $posts as $post ) : ?>
<?php
$wp_church_post_content = $post->post_content;
$thumbnail = get_post_meta($post->ID, "thumbnail", true);
?>
<?php
if($post_count > 0)
{
?>
<div class="excerpt_separator"></div>
<?php
}
?>
<div class="excerpt_content">
<div class="excerpt_image"><img src="<?php echo $thumbnail; ?>" width="100" height="100" /></div>
<div class="excerpt_desc">
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php Experts($wp_church_post_content, 350); ?>
<div class="box_read_more"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More</a> </div>
</div>
</div>
<?php $post_count++; ?>
<?php endforeach // $posts as $post ?>
</div>
<?php endif // $posts ?>
<?php
$post = $this_post;
unset($this_post);
?>İndex kodlarım ise şöyle
<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("paged=$page");
if (have_posts()) : while (have_posts()) : the_post();
if ( $post->ID == $do_not_duplicate[$post->ID] ) continue; update_post_caches($posts); ?>
<div class="post clearfix" id="post-main-<?php the_ID(); ?>">
<?php include (TEMPLATEPATH . '/post-thumb.php'); ?>
<div class="entry clearfix">
<h2><a href="<?php the_permalink() ?>" rel="<?php _e("bookmark"); ?>" title="<?php _e("Permanent Link to"); ?> <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php if ( $wp_church_post_content == 'Excerpts' ) { ?>
<?php the_excerpt(); ?>
<?php } else { ?>
<?php the_content(''); ?>
<?php } ?>
</div> Nerede yanlış yapıyorum yardımcı olursanız sevinirim...