I have updated my wordpress and now my wordpress single posts are not showing. Header and post title are showing up but post title and sidebar are missing.
When I switch to some other theme everything works fine, but with my theme there is a problem. I tried to manually reinstall sigle.php of the theme but nothing changed. I tried changing permalinks structure, deleting all inactive plugins and turning off and on all active plugins but still nothing changed.
I am using a Sharp Magazine theme from Gabfire. Here is an example: http://www.turizamiputovanja.com/nis-dobija-novi-hotel-u-centru-grada/.
Here is my single.php
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
/* post template defined on custom fields? */
$post_layout = get_post_meta($post->ID, 'gabfire_post_template', true);
/* Any subtitle entered to post? */
$subtitle = get_post_meta($post->ID, 'subtitle', true);
?>
<?php /* Post lead */ ?>
<section class="row">
<div class="col-md-12">
<div class="post-lead">
<p class="post-category"><?php the_category(' · '); ?></p>
<h1 class="post-title"><?php the_title(); ?></h1>
<p class="post-datecomment">
<?php
$authorlink = '<a href="'.get_author_posts_url(get_the_author_meta( 'ID' )).'">'. get_the_author() . '</a>';
printf(esc_attr__('%2$s Autor: %1$s','gabfire'), $authorlink, get_the_date());
?>
<?php
/* get the number of comments */
$num_comments = get_comments_number();
if ( comments_open() ){
if($num_comments == 0){ $comments = __('Nema komentara', 'gabfire'); }
elseif($num_comments > 1){ $comments = $num_comments. __(' Komentara', 'gabfire'); }
else{ $comments = __('1 komentar', 'gabfire'); }
}
echo '<span class="commentnr">' . $comments . '</span>';
?>
</p>
<?php
if (($subtitle != '') && (($post_layout == 'bigpicture') or ($post_layout == 'fullwidth'))) {
echo "<p class='subtitle postlead_subtitle'>$subtitle</p>"; }
?>
</div>
</div>
</section>
<?php
/* Call user defined post template */
if ($post_layout == 'bigpicture') {
get_template_part( 'single', 'bigpicture' );
} elseif ($post_layout == 'fullwidth') {
get_template_part( 'single', 'fullwidth' );
} elseif ($post_layout == 'leftsidebar') {
get_template_part( 'single', 'leftsidebar' );
} else {
get_template_part( 'single', 'default' );
}
?>
<?php endwhile; else : endif; ?>
<?php get_footer(); ?>
I have red all the similiar questions and answers here but none seems to be helpful for me. Thanks!
the_content()is being called outside the while loop - might be worth looking into that - trysmudford