0

I am following along with this tutorial and what I have made so far is not working as it should. I have gotten to the point where I am starting to use the loop - this is my code:

index.php

<?php get_header(); ?>
  <div class="row">
    <div class="col-sm-8 blog-main">
      <?php 
      if ( have_posts() ) : while ( have_posts() ) : the_post();

        get_template_part( 'content', get_post_format() );

      endwhile; endif; 
      ?>
    </div><!-- /.blog-main -->
    <?php get_sidebar(); ?>
  </div><!-- /.row -->
  <?php get_footer(); ?>
</div><!-- /.container -->`

content.php

<div class="blog-post">
    <h2 class="blog-post-title"><?php the_title(); ?></h2>
    <p class="blog-post-meta"><?php the_date(); ?><a href="#"><?php the_author(); ?></a></p>

    <?php the_content(); ?>
</div><!-- /.blog-post -->

I have two posts but only the latest post is getting displayed (by the loop) and within the post that gets displayed - the only part that is displayed is the title. So it seems like the_date(), the_author(), and the_content() functions are not working for some reason, and the loop is only getting one of the posts (the latest one).

What is wrong? Thanks.

1
  • For post shows, please change option in WP admin, for data and content view your css styles. Commented Mar 17, 2016 at 14:43

1 Answer 1

1

I'm not sure what I did, but I went to WP admin and clicked "customize" for the theme, and it loaded correctly in the theme editor - and then I went to the site, and it was working. I think maybe I didn't save a file, and I didn't realize it - and as I was trying to figure it out, I ended up saving the file, and it started working.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.