Single.php not working correctly, am I missing something here?
-
I’m building my own theme for my band’s websites. I want to display the date on blog style posts such as tour dates and news updates, but not on the static pages like the Music section and the band bio.
Basically I just made a new file called single.php and copied exactly what was in my index.php code
<?php get_header(); if (have_posts()): while (have_posts()): the_post(); ?> <h2><a href = "<?php the_permalink();?>"><?php the_title(); ?></a></h2> <p class = "theDate">-<?php the_date(); ?></p> <?php the_content(); ?> <?php endwhile; else: echo '<p>No content found</p>'; endif; get_footer(); ?>Except I put the date there. However it does not show up on my posts. In fact, none of the edits I make to “single.php” seem to show up on any of my posts. Am I doing this right?
Edit: OK I figured out it shows the date when I click on the post so only the post is displaying. I want it to show up on the posts on the page, so there are multiple news items that are all dated, but the top of the page itself is not dated.
The topic ‘Single.php not working correctly, am I missing something here?’ is closed to new replies.