WordPress.org

Ready to get started?Download WordPress

Forums

Comments not showing (1 post)

  1. jfarrugia90
    Member
    Posted 1 month ago #

    Hi guys,

    Im just working on my blog page for my custom theme.
    http://preview.mysocialsolutions.com.au/blog/

    Im unable to show comments in my post.

    I am new to creating themes and showing certain post on pages. Below is my code, I am showing blog post based on the category 'Blog'. My content is displayed in a blog_content div, which then outputs the blog data, with the date of the blog being shown, tags associated with the blog and finally we have my section where you have the comments ie <?php comments_template( '', true ); ?>

    <div class="blog_content">
    			<?php
    				$Blog = array( 'posts_per_page' => 10, 'order'=> 'DESC', 'orderby' => 'title', 'category' => 2 );
    				$postslist = get_posts( $Blog );
    				foreach ( $postslist as $post ) :
    				  setup_postdata( $post ); ?>
    				  	<div class="blog_date">
    				  		<p class="date_num"><?php $date_num = the_date('m'); echo $date_num; ?></p>
    						<p class="date_mon"><?php $date_mon = the_time('M'); echo $date_mon; ?></p>
    				  	</div><!-- end of blog_date -->
    						<h1><?php the_title(); ?></h1>
    						<?php the_content(); ?>
    				<div class="blog_footer">
    				<span>
    				<img src="<?php bloginfo('template_directory'); ?>/images/tags_icon.png" alt="My Social Solutions Blog Tags" />
    				<?php the_tags(); ?>
    				</span>
    				<br />
    				<span>
    				<img src="<?php bloginfo('template_directory'); ?>/images/comment_icon.png" alt="My Social Solutions Blog Comments" />
    				<?php comments_template( '', true ); ?>
    				</span>
    				</div><!-- end of blog_tags -->
    				<?php endforeach; wp_reset_postdata();?>
    	</div><!-- end of blog_content -->

    I not sure what I am doing wrong, any help would be awesome.

    Thanks

Reply

You must log in to post.

About this Topic