When I set up my blog a couple of weeks ago my plan was for the blog to be on a subdomain managed by WordPress and the main website to be a simple HTML page with a link to it. Not long after I completed my set-up I realised that I would be better off using WordPress to manage the whole site. I also concluded that having the blog on a subdomain was counter-productive for the purposes of Search Engine Optimisation (SEO) as Google treats it as a separate site.
All this necessitated a restructure of my site within WordPress. To the seasoned WordPress user, what follows is probably trivial – but as a newcomer it took me several hours to figure it out, so I’m writing this in the hope that it saves someone else that pain.
Setting a static page as the home page
The first bit was easy – I created a new static page from the Pages link in the WordPress admin interface. When I was happy with it I opened the Reading Settings page and changed “Your homepage displays” from “Your latest posts” to a static page, and chose my new page from the dropdown. A quick site refresh confirmed that the static page was now my home page.
Moving the blog feed to a different page
Now to create the new top level page for my blog. My first instinct was to create a new static page and assign it to the “Blog Home” template I had modified when originally creating the site. Unfortunately clicking on the Template in the right-hand panel and choosing “Swap template” revealed that many of the Templates you can see and edit in the Appearance editor do not appear here and you cannot apply them to normal pages. It’s not at all obvious why this should be and I wasted quite a bit of time searching for a solution, before concluding (wrongly) that I needed to create my own template with the same content.
My wrong decision at least had the side effect of showing me how to copy templates – which is fairly simple. In the appearance editor there is an option “Copy all blocks” tucked away near the bottom of the three dot menu (top right). Creating a new template and pasting the copied blocks in gave me an exact copy of the “Blog Home” template that I could now apply to my new Blog Home page. Except that the page now showed precisely nothing in the editor, not the template as I had expected. A quick preview showed that the page had actually inherited the template as the header and side panels were all there – but there were no posts in the central area.
After a bit more digging I added a query block to the page – in the editor it showed my blog entries. Unfortunately, it was too early for celebration as a preview showed that instead of showing the blog it just had a single, orphaned (more) link that went nowhere. A long rabbit hole exploring the query filters proved fruitless.
Finally in despair I went back to the reading panel settings – where I started out earlier, and assigned my new page to the Posts page (under the “Your homepage displays” option where we started. Immediately my page started working with one slight wrinkle. A couple of minor changes to “My Blog Home” template were not being shown. A bit more digging revealed that this was because the page was ignoring the Template selection set in the right hand Post panel and applying the original “Blog Home” template.
TL;DR
So in short to move the blogs page to a secondary page
- Create two new pages
- Edit the first to contain your new homepage contents and set it to be the Homepage in the Reading settings
- Leave the second blank (anything you put in it will be ignored anyway) and set it to be the Posts Page in your reading settings
Quite why my solution to create a separate template with a query block failed I still don’t know – but I will leave getting query blocks working to another day
Leave a Reply