cURL Error: 0
<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php osetin_output_breadcrumbs(); ?>
<div class="blog-content-w <?php if ( osetin_is_active_sidebar( 'sidebar-single-post' ) ) echo 'with-sidebar sidebar-location-right'; ?>">
<div class="blog-content">
<?php
if(has_post_thumbnail()){
$image_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "full" );
$proportion = 100;
if($image_data && isset($image_data[1]) && isset($image_data[2]) && $image_data[1] > 0 && $image_data[2] > 0){
$width = $image_data[1];
$height = $image_data[2];
$proportion = round($height / $width * 100);
}
?>
<div class="post-header-image" style="background-image: url('<?php the_post_thumbnail_url("full"); ?>'); padding-bottom: <?php echo esc_attr($proportion).'%'; ?>">
<div class="post-header-image-contents">
<h1><?php the_title(); ?></h1>
<div class="post-header-meta">
<div class="author-details">
<?php echo get_avatar( get_the_author_meta( 'ID' ), 40 ); ?>
<span><?php _e('By:', 'lawyer-by-osetin'); ?> </span><a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php the_author_meta( 'display_name' ); ?></a>
<span class="post-header-date-posted"><?php echo get_the_date(); ?></span>
<span class="post-header-comments"><?php comments_number( 'no comments', 'one comment', '% responses' ); ?></span>
<span class="post-header-categories"><?php echo get_the_category_list(); ?></span>
</div>
</div>
</div>
</div>
<?php
}
?>
<div class="blog-content-text-and-meta">
<div class="blog-content-meta">
<div class="meta-author meta-block">
<?php echo get_avatar( get_the_author_meta( 'ID' ), 100 ); ?>
<div class="author-details">
<h6 class="author-name"><span>By: </span><a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php the_author_meta( 'display_name' ); ?></a></h6>
<div class="single-post-date-posted"><?php echo get_the_date(); ?></div>
</div>
</div>
<div class="meta-comments meta-block">
<?php comments_number( 'no comments', 'one comment', '% responses' ); ?>
</div>
<div class="meta-share meta-block">
<h6><?php _e('Share This Post', 'lawyer-by-osetin'); ?></h6>
<div class="meta-share-box">
<div class="addthis_inline_share_toolbox"></div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-583f6c67083bab42"></script>
</div>
</div>
<div class="meta-categories-w meta-block">
<h6 class="post-categories-label"><?php esc_html_e('Categories:', 'lawyer-by-osetin'); ?></h6>
<div class="meta-categories-list">
<?php echo get_the_category_list(); ?>
</div>
</div>
<?php if(get_the_tags()){ ?>
<div class="meta-tags-w meta-block">
<h6 class="post-categories-label"><?php esc_html_e('Tags:', 'lawyer-by-osetin'); ?></h6>
<div class="meta-tag-list">
<?php echo get_the_tag_list('', ', '); ?>
</div>
</div>
<?php } ?>
</div>
<div class="blog-content-text">
<?php
if(has_post_thumbnail()){
echo '<h4 class="styled-header">'.get_the_title().'</h4>';
}else{
echo '<h1 class="post-title styled-header">'.get_the_title().'</h1>';
}
?>
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<div class="content-link-pages">', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?>
<div class="sidebar-under-post">
<?php
$args = array(
'post__not_in' => array(get_the_ID()),
'posts_per_page' => 4,
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'orderby' => 'post_date',
'order' => 'DESC',
);
$recent_posts_query = new WP_Query( $args );
if ($recent_posts_query->have_posts()){ ?>
<div class="latest-posts-w">
<h4><?php _e('Latest Posts', 'lawyer-by-osetin') ?></h4>
<div class="row">
<?php
$counter = 0;
while ($recent_posts_query->have_posts()){
$counter++;
$recent_posts_query->the_post();
$feat_image_url = wp_get_attachment_url( get_post_thumbnail_id() );
?>
<div class="col-sm-6">
<a href="<?php the_permalink(); ?>" class="latest-post-media" style="background-image:url('<?php echo esc_attr($feat_image_url); ?>');"></a>
<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<div class="latest-posts-meta">
<div class="latest-posts-date"><?php echo get_the_date() ?></div>
<div class="author-name"><span>By: </span><a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php the_author_meta( 'display_name' ); ?></a></div>
</div>
</div>
<?php
if($counter == 2){
echo '</div><div class="row">';
}
} ?>
</div>
</div><?php
}
wp_reset_postdata(); ?>
</div>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
} ?>
</div>
</div>
</div>
<?php if ( osetin_is_active_sidebar( 'sidebar-single-post' )){ ?>
<div class="blog-sidebar">
<?php
if ( is_active_sidebar( 'sidebar-single-post' ) ){
dynamic_sidebar( 'sidebar-single-post' );
}
?>
</div>
<?php } ?>
</div>
<?php get_template_part('cta-2'); ?>
<?php endwhile; endif; ?>
<?php get_footer(); ?>