<?php
get_header();?>
<div id="content-container" class="container_24">
<div id="main-content">
<div class="main-content-padding">
<div class="container" style="overflow: hidden; width: 100%">
<div class="left">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="entry">
<div class="post-top">
<div align="left" class="alignleft" id="">
<div class="drop-shadow">
<?php
$customField = get_post_custom_values("img");
if (isset($customField[0])) {
echo '<img src="';
echo "".$customField[0];
echo '" height="90px" width="90px" />'; }
else{
echo '<img src="';
echo (catch_that_image());
echo '" />'; }
?></div>
</div>
<h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'udesign' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
<span class="alignleft"><b>
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'phone', true);
?>
</b></span>
<span class="alignleft"><b> - <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">View Details</a></b></span>
</div>
<br><div class="alignleft"></div>
<div class="clear"></div>
</div>
</div>
<?php echo do_shortcode('[divider_top]'); ?>
<?php endwhile; ?>
<div class="clear"></div>
<?php // Pagination
if(function_exists('wp_pagenavi')) :
wp_pagenavi();
else : ?>
<div class="navigation">
<div class="alignleft"><?php previous_posts_link() ?></div>
<div class="alignright"><?php next_posts_link() ?></div>
</div>
<?php endif; ?>
<?php else :
if ( is_category() ) { // If this is a category archive
printf(__("<h2 class='center'>%s</h2>", 'udesign'), single_cat_title('',true));
} else if ( is_date() ) { // If this is a date archive
_e("<h2>Sorry, but there aren't any posts with this date.</h2>", 'udesign');
} else if ( is_author() ) { // If this is a category archive
$userdata = get_userdatabylogin(get_query_var('author_name'));
printf(__("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", 'udesign'), $userdata->display_name);
} else {
_e("<h2 class='center'>No posts found.</h2>", 'udesign');
}
get_search_form();
endif;
//Reset Query
wp_reset_query(); ?>
<?php edit_post_link(__('Edit this page', 'udesign'), '<div style="float:right;margin:0 10px;">', '</div>'); ?></div>
<div class="right">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="entry">
<div class="post-top">
<div align="left" class="alignleft" id="">
<div class="drop-shadow">
<?php
$customField = get_post_custom_values("img");
if (isset($customField[0])) {
echo '<img src="';
echo "".$customField[0];
echo '" height="90px" width="90px" />'; }
else{
echo '<img src="';
echo (catch_that_image());
echo '" />'; }
?></div>
</div>
<h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'udesign' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
<span class="alignleft"><b>
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'phone', true);
?>
</b></span>
<span class="alignleft"><b> - <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">View Details</a></b></span>
</div>
<br><div class="alignleft"></div>
<div class="clear"></div>
</div>
</div>
<?php echo do_shortcode('[divider_top]'); ?>
<?php endwhile; ?>
<div class="clear"></div>
<?php // Pagination
if(function_exists('wp_pagenavi')) :
wp_pagenavi();
else : ?>
<div class="navigation">
<div class="alignleft"><?php previous_posts_link() ?></div>
<div class="alignright"><?php next_posts_link() ?></div>
</div>
<?php endif; ?>
<?php else :
if ( is_category() ) { // If this is a category archive
printf(__("<h2 class='center'>%s</h2>", 'udesign'), single_cat_title('',true));
} else if ( is_date() ) { // If this is a date archive
_e("<h2>Sorry, but there aren't any posts with this date.</h2>", 'udesign');
} else if ( is_author() ) { // If this is a category archive
$userdata = get_userdatabylogin(get_query_var('author_name'));
printf(__("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", 'udesign'), $userdata->display_name);
} else {
_e("<h2 class='center'>No posts found.</h2>", 'udesign');
}
get_search_form();
endif;
//Reset Query
wp_reset_query(); ?>
</div>
</div></div><!-- end main-content-padding -->
</div><!-- end main-content -->
<!-- end content-container -->
<div class="clear"></div>
<?php
get_footer();