<?php get_header(); ?>
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post-body pages">        
<?php get_sidebar('left'); ?> 
<div class="posts-wrap three_col"> 
 
<div class="post" id="page">
        
        <h2 class="page-title"><?php the_title(); ?></h2>
<?php 
$cat_c = get_the_category( $post->ID ); 
// echo "cat=".$cat_c[0]->cat_ID  ?>
 <?php 
     if($cat_c[0]->cat_ID!='28'){
 ?>
            <div class="entry-content" id="page-content">
            
                <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>

                <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
                <br class="clear">
                <?php 
                
                    //$cat_c = get_the_category( $post->ID );
                    $sql_mat = "SELECT `post_id` FROM `wp_postmeta` WHERE `meta_key` = 'category_id' and `meta_value` = '".$cat_c[0]->cat_ID."';"; 
                    $sql_val =  $wpdb->get_row($sql_mat);
                    $url_s = '';
                   if($sql_val){
                        $url_s = get_permalink($sql_val->post_id);; 
                   }else{
                        $url_s = get_category_link( $cat_c[0]->cat_ID  );; 
                   }
                ?>
                <div><a href="<?php echo $url_s; ?>" class="read_more_artical">Read more Articles</a>
                <img src="<?php bloginfo('template_url'); ?>/images/sideder_left1.1.png" alt="" style="border: none; float: right;"></div>
            </div><!-- end #page-content -->
            <br class="clear">
            <div class="comment_single">
                <?php comments_template('', true); ?> 
            </div>
<?php } else{  ?>
          <script src="<?php bloginfo('template_url'); ?>/js/jquery.jqzoom-core.js" type="text/javascript"></script>

            <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/js/jquery.jqzoom.css" type="text/css">
           <script type="text/javascript">

            jQuery(document).ready(function() {
                jQuery('.jqzoom').jqzoom({
                        zoomType: 'standard',
                        lens:true,
                        preloadImages: false,
                        alwaysOn:false
                    });
                
            });
           </script> 
          <div class="entry-content" id="page-content">
             <div class="zoom_s">
               <table width="100%">
                <tr><td width="321"><a href="<? echo get_Image_url($post->ID,'m','thumbnail');?>" class="jqzoom" rel='gal1'  title="" >
                    <img src="<? echo get_Image_url($post->ID,'m','thumbnail');?>"  title="<?php echo  $post->post_title; ?>"  width="312">
                </a></td><td style="padding-left: 10px" valign="top"><?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?> </td></tr>
               </table>
               <?php 
               echo apply_filters('the_content', '[contact-form-7 id="722" title="Oli Painting"]');
               ?>
               <script type="">
                document.getElementById('postname').value='<?php echo  $post->post_title; ?>';
               //jQuery('#postname').val("<?php echo  $post->post_title; ?>");
               //jQuery('#postname').attr("disabled", true); 
               </script> 
                
                <br class="clear">
             </div>  
            </div><!-- end #page-content -->
             

    
<?php }?>                   
    </div><!-- end #page -->
    
            <?php endwhile; endif; ?>
            
    <?php edit_post_link( __('Edit', 'blank'), '<p>', '</p>'); ?>
 </div><!-- end .posts-wrap -->
    
<?php get_sidebar('right'); ?>
</div>
<?php get_footer('all'); ?>