File: /home/.Trash/khotel/public_html/wp-content/themes/atec/single.php
<?php
get_header(); ?>
<?php if (have_posts()) :
// Queue the first post.
the_post();
?>
<div class="container-fluid page-top-header">
<div class="page-top-header-box">
<div class="row">
<div class="container-fluid page-top-header">
<div class="row">
<img src="<?php echo get_stylesheet_directory_uri() ?>/images/header-img-default.jpg" alt="K Hotel" />
</div>
</div>
</div>
</div>
<div class="container">
<div class="breadcrumb-text">
<span>The ultimate luxury</span>
<h1 class="page-header-title">News</h1>
</div>
<div class="breadcrumb-top">
<ul class="breadcrumb-nav">
<li><a href="<?php echo home_url(); ?>">Home</a></li>
<li>|</li>
<li>News</li>
</ul>
</div>
</div>
<div class="container">
<div class="row content">
<div class="col-md-12 single-news">
<?php
// Rewind the loop back
rewind_posts();
?>
<?php while (have_posts()) : the_post(); ?>
<?php
//Get featured image
if (has_post_thumbnail( $post->ID )) $feat_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'image-blog' );
//Get feaured image ALT text
$post_img_id = get_post_thumbnail_id($post->ID);
$alt_feat_text = get_post_meta( $post_img_id, '_wp_attachment_image_alt', true );
if(empty( $alt_feat_text )){
$alt_feat_text = get_the_title();
}
?>
<?php
if (has_post_thumbnail( $post->ID )) {
echo '<img src="'.$feat_image[0].'" alt="'.$alt_feat_text.'" />'; ?>
<?php } else { ?>
<img src="<?php echo get_stylesheet_directory_uri() ?>/images/blog-placeholder-415-310.jpg" alt="<?php the_title(); ?>" />
<?php } ?>
<h4><?php echo the_title() ?></h4>
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; // end of the loop. ?>
<?php endif; ?>
<?php get_footer(); ?>