1

My Wordpress websites are not using single.php to show posts on the website. Every time I open a post, it opens it in index.php.

My single.php looks like this

<?php get_header(); ?>
  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <? echo the_content(); ?>
  <? endwhile; 
  endif; ?>
<? get_footer();
?> 

How can I fix this?

3
  • codex.wordpress.org/Creating_a_Static_Front_Page Commented Jan 7, 2013 at 16:57
  • What's your current setting of 'Front page displays' in your settings? Commented Jan 7, 2013 at 17:04
  • Front page displats recent posts Commented Jan 8, 2013 at 8:27

3 Answers 3

3

I had the same problem with neither the single-CUSTOM-TYPE.php nor the single.php being rendered after clicking the single-post-link.... only index.php instead of the correct file...

What helped me was a simple change back to Standard Permalinks in "Settings" -> "Permalinks" and a restore back to "Name of the Post" (Beitragsname)....

...maybe this might help someone else as well... greetz

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

1 Comment

It was enough just to go this settings page and save this again.
0

This happens if the LOOP is not correctly setup ensure that index.php, and single.php contains the LOOP.

The loop normally looks something like this, but will change to setup requirements.

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

The Wordpress Codex site is pretty awesome and will answer most questions, check out http://codex.wordpress.org/The_Loop

Furthermore questions and discussions such as this one is more ideal if you post on stacks sister site Wordpress Stackexchange. I expect this question will be deleted or moved to https://wordpress.stackexchange.com/.

1 Comment

It is allready in code. i have added code snippet to my question.
0

You should check your loop.php or loop-single.php weather it is routing from these files or not this are the page from where it will bring the data from database

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.