I'm developing my own theme and came up with an issue that' I am confused with. I have two files that I'm trying to figure out.
I know that page.php is used for pages, of course, but when trying to set up a 404 page, for example:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <section class="main-content"> <div class="content-wrap"> <div class="module page"> <h1 class="title"><?php wp_title(''); ?></h1> <?php the_content(); ?> </div><!-- /.blog --> <?php get_sidebar(); ?> </div><!-- /.content-wrap --> </section> <?php endwhile; else : ?> 404 not found <?php endif; ?>
Nothing will be displayed. Now, if I copy this content and stick it in index.php, I will have a 404 page. I have no idea what to do because index.php is required for a theme but I don't know what to do with it. Can someone explain the differences and what kind of content actually goes in it?