• Hello,
    I’m (locally) building a custom theme.

    I have:

    • index.php
    • single.php
    • page.php
    • custom page template called about-page.php
    • two different headers for default use and for the single.php

    NO functions.php
    NO custom taxonomy
    Permalink settings > Common settings : default

    My index.php has a list of posts (all of those belonging to a specified category), when I click on one of those posts I end to the index.php BUT with the right custom header (header I created for the posts, it’s called header-single.php).

    So, I’m getting the index.php istead of the single.php

    I read around other people had the same problem with the word “year” or some other Reserved Terms. I don’t think it’s my case.

    In my home page I have:

    <?php
    /**
     * Template Name: Front Page Template
     */
    get_header(); ?>
    <nav id="menu">
    		<ul class="postlist">
    			<?php
    		        $lastposts = get_posts('numberposts=20&orderby=date&cat=9');
    		        foreach($lastposts as $post) :
    		        setup_postdata($post);
    		        ?>
    			        <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a</li>
    		        <?php endforeach; ?>
          		</ul>
    </nav>
    <?php get_footer(); ?>

    Looking forward for some clues.
    Thank you very much!
    Best,
    L

The topic ‘posts use index.php instead of single.php’ is closed to new replies.