post ratings zone
-
this is my page.php :
<?php get_header() ?>
<div id=”content”>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post() ?>
<!– google_ad_section_start –>
<div class=”post”>
<?php edit_post_link(‘Edit’,'<p class=”edit”>’,'</p>’) ?>
<h1><?php if ( get_the_title() ){ the_title(); }else{ echo “Untitled”; } ?></h1>
<?php if ( get_the_content(“”, false, “”) ){ the_content(); }elseif ( get_the_guid() ){ echo “<p><img src=\””.get_the_guid().”\” alt=\”Click to enlarge\” class=\”thumbnail\” /></p>”; }else{ echo “<p>…</p>”; } ?>
<?php if(function_exists(‘the_ratings’)) { the_ratings(); } ?><?php link_pages(‘<p>More pages: ‘, ‘</p>’, ‘number’); ?>
</div>
<!– google_ad_section_end –>
<?php include (TEMPLATEPATH.’/ad2.php’) ?>
<?php comments_template() ?>
<?php endwhile // have_posts()?>
<?php else : // have_posts()?>
<div class=”block”>
<h1>Not found</h1>
<p>Sorry, but we are unable to find any article matching your request.</p>
</div>
<?php include (TEMPLATEPATH.’/ad2.php’) ?>
<?php endif // have_posts() ?>
<?php include (TEMPLATEPATH.’/ad4.php’) ?>
</div>
<?php get_sidebar() ?>
<?php get_footer() ?>why the rating zone is the the top of every posts in my blog principal page and not in the box of the posts ?
in the single page the ratings zone appear in the post after the contenute
my single.php is :
<?php get_header() ?>
<div id=”content”>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post() ?>
<!– google_ad_section_start –>
<div class=”post”>
<?php edit_post_link(‘Edit’,'<p class=”edit”>’,'</p>’) ?>
<h1><?php if ( get_the_title() ){ the_title(); }else{ echo “Untitled”; } ?></h1>
<?php if ( post_excerpt() & ( get_the_content() || !get_the_guid() ) ) : ?>
<?php if ( trim(get_the_excerpt()) != “” ){ the_excerpt(); }else{ echo ‘<p>…</p>’; } ?>
<p>The article starts below…
</p>
<p><cite>
Written by <?php the_author() ?> on ” title=”View all posts written on <?php the_time(‘F jS, Y’) ?>”><?php the_time(‘F jS, Y’) ?> with
<?php if ( ‘open’ == $post->comment_status ) : ?>
“><?php comments_number(‘no comments’,’1 comment’,’% comments’) ?>.
<?php else : // ‘open’ == $post->comment_status ?>
comments disabled.
<?php endif // ‘open’ == $post->comment_status ?>
Read more articles on <?php the_category(‘ and ‘) ?>.
</cite></p>
</div>
<!– google_ad_section_end –>
<?php include (TEMPLATEPATH.’/ad2.php’) ?>
<!– google_ad_section_start –>
<div class=”post”>
<?php edit_post_link(‘Edit’,'<p class=”edit”>’,'</p>’) ?>
<?php endif // post_excerpt() & ( get_the_content() || !get_the_guid() ) ?>
<?php if ( get_the_content(“”, false, “”) ){ the_content(); }elseif ( get_the_guid() ){ echo “<p><img src=\””.get_the_guid().”\” alt=\”Click to enlarge\” class=\”thumbnail\” /></p>”; }else{ echo “<p>…</p>”; } ?>
<?php if(function_exists(‘the_ratings’)) { the_ratings(); } ?><?php link_pages(‘<p>More pages: ‘, ‘</p>’, ‘number’); ?>
<p><cite>
Written by <?php the_author() ?> on ” title=”View all posts written on <?php the_time(‘F jS, Y’) ?>”><?php the_time(‘F jS, Y’) ?> with
<?php if ( ‘open’ == $post->comment_status ) : ?>
“><?php comments_number(‘no comments’,’1 comment’,’% comments’) ?>.
<?php else : // ‘open’ == $post->comment_status ?>
comments disabled.
<?php endif // ‘open’ == $post->comment_status ?>
Read more articles on <?php the_category(‘ and ‘) ?>.
</cite></p>
</div>
<!– google_ad_section_end –>
<?php if ( post_excerpt() & ( get_the_content() || !get_the_guid() ) ) : ?>
<?php include (TEMPLATEPATH.’/ad3.php’) ?>
<?php else : // post_excerpt() & ( get_the_content() || !get_the_guid() ) ?>
<?php include (TEMPLATEPATH.’/ad2.php’) ?>
<?php endif // post_excerpt() & ( get_the_content() || !get_the_guid() ) ?>
<?php
$this_post = $post;
$category = get_the_category(); $category = $category[0]; $category = $category->cat_ID;
$posts = get_posts(‘numberposts=6&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 ++;
}
}
?>
<?php if ( $posts ) : ?>
<div class=”post”>
<h2>Related articles</h2>-
<?php foreach ( $posts as $post ) : ?>
- ” title=”<?php echo trim(str_replace(“\n”,” “,preg_replace(‘#<[^>]*?>#si’,”,get_the_excerpt()))) ?>”><?php if ( get_the_title() ){ the_title(); }else{ echo “Untitled”; } ?> (<?php the_time(‘F jS, Y’) ?>)
<?php endforeach // $posts as $post ?>
</div>
<?php endif // $posts ?>
<?php
$post = $this_post;
unset($this_post);
?>
<?php comments_template() ?>
<?php endwhile // have_posts()?>
<?php else : // have_posts()?>
<div class=”block”>
<h1>Not found</h1>
<p>Sorry, but we are unable to find any article matching your request.</p>
</div>
<?php include (TEMPLATEPATH.’/ad2.php’) ?>
<?php endif // have_posts() ?>
<?php include (TEMPLATEPATH.’/ad4.php’) ?>
</div>
<?php get_sidebar() ?>
<?php get_footer() ?>
- The topic ‘post ratings zone’ is closed to new replies.