I used to have a page called "Blog" with dummy content (it said "hello world" or similar). Off the menu there was a link to www.mydomain.com/blog and this used to fire up index.php and list recent posts. The hello world content of the blog page never showed up. And in any case, the Blog page was set to Draft.
This was just how I wanted it, even though I couldn't work out how the WordPress loop within index.php was managing to show posts and not the hello world. Here's what the loop looks like in index.php:
if ( have_posts() ) : while ( have_posts() ) : the_post();
if (is_search() && ($post->post_type=='page')) continue; ?>
<div class="box">
<a href="<?php the_permalink() ?>">
<h2><?php the_title() ?></a></h2>
The site was running fine. Recently, for not special reason, I noticed that the Blog page still existed albeit set to Draft. To tidy up a bit I figured I'd delete the page. After all it seemingly wasn't required.
As soon as I deleted it, going to www.mydomain.com/blog resulted in a 404. Yikes. I quickly restored the Blog page. It showed "Hello world". I deleted it again. 404. I recreated it as a Draft (in case that was crucial). 404. I published it. Hello World. I cannot get my list of posts back.
I have a complete copy of the site on another server, with the behaviour I wanted to restore (mydomain.com/blog firing up index.php with a list of recent posts). I have reproduced the exact above steps with the same results.
Whatever I try (on either server) I cannot get back to how it was, with mydomain.com/blog firing up index.php with a list of recent posts.
While I concede that whatever setup I had before was fragile and perhaps not the "correct" way to setup a theme, it did work as it stood, and I would love to know how I can restore it, without having to code a new template.