Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php get_template_part( "beforeloop", "single" ) ?>
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <?php if ( post_password_required() ) : ?>
- <div class="password_p">
- <?php the_content(); ?>
- </div><!-- /password_p -->
- <?php else : ?>
- <article id="post-<?php the_ID(); ?>" class="post">
- <h1 class="post_title"><?php the_title(); ?></h1>
- <?php $count = 0;
- $rate_sum=0.0;
- $avg_rating = simple_fields_values("review_rating");
- foreach($avg_rating as $rating)
- {
- $rate_sum += $rating;
- $count++;
- }
- $avg_rate = (int)($rate_sum/$count * 10);
- $draw = "rating-static rating-".$avg_rate;
- echo "<span class='".$draw."'></span>";
- ?>
- <?php
- $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
- if($thumbnail){
- ?>
- <div style="float:left;width:30%;height:250px;">
- <?php echo get_the_post_thumbnail($id, 'thumbnail'); ?>
- <!-- <img src="<?php echo get_template_directory_uri(); ?>/framework/timthumb.php?src=<?php echo $thumbnail[0]; ?>&h=230&w=590" alt="<?php the_title(); ?>" /> -->
- </div><!-- /img_post -->
- <?php
- }
- ?>
- <?php /* include (TEMPLATEPATH . '/framework/meta.php' ); */ ?>
- <div id="review-article" style="float:right;width:67%;"> <?php the_content('Read more'); ?> </div>
- <div class="clear"></div>
- <div id="review-tags" style="float:right;width:67%;">
- <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
- <?php the_tags('<ul class="fancy_tags"><li>','</li><li>','</li></ul>'); ?>
- <div class="clear"></div></div>
- <div id="review">
- <?php /*$selected_value = simple_fields_get_post_value(get_the_id(), "Add Image", true);
- if($selected_value[is_image]){
- echo $selected_value[link][thumbnail];
- } */
- $descriptions =simple_fields_values("description_wine");
- $images =simple_fields_values("image_wine");
- $authors =simple_fields_values("author_review");
- //print_r($images);
- $count=1;
- foreach($descriptions as $description)
- {
- ?>
- <div class='clear'></div>
- <div class='clear'></div>
- <div style="display:block;clear:both;">
- <div id="review-header"><?php echo $authors[$count-1]; ?></div>
- <?php $rate = (int)($avg_rating[$count-1]*10); $draw = "rating-static rating-".$rate; ?>
- <div style="float:left;width:30%;clear:right;"><?php echo "<span class='".$draw."'></span>"; ?></div>
- <div id="individual-review">
- <?php if($images [$count-1][link][thumbnail]!="Missing Attachment")
- {
- echo $images[$count-1][link][thumbnail];
- } ?>
- </div>
- <div style="float:right;width:67%;">
- <?php $count += 1;
- echo $description; ?>
- </div>
- </div>
- <div class='clear'></div>
- <?php }
- ?>
- </div>
- <p><?php edit_post_link('Edit entry','',''); ?></p>
- </article>
- <div class="clear"></div>
- <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('post-widgets')) : else : ?>
- <?php endif; ?>
- <?php comments_template(); ?>
- <?php endif; //password ?>
- <?php endwhile; else: ?>
- <article>
- <p>Sorry, no posts matched your criteria.</p>
- </article>
- <?php endif; ?>
- <?php get_template_part( "afterloop", "single" ) ?>
- <?php get_footer(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement