Help with getting the first to be the root directory and th blog to be root/blog
-
I’m setting up my site, https://www.lifecrafting.net, and I’m having problems. I found instructions to get my blog to appear at https://www.lifecrafting.net/blog off the wordpress faq, but the instructions appear not to work. I’ve posted the instructions below.
So, I created my Blog.php file in wordpad, pasted the text in, and uploaded it to the wordpress/themes directory. I have 2.1.2 so I don’t need the home.php file.
I go into my dashboard, create a page called “Blog”, but when I click on “page template”, my new file, which should be displayed as “blog”, is not available.
What am I doing wrong? Thanks.
These are the instructions:
Making your blog appear in a non-root folder
Suppose you have WordPress running at https://example.com/. Suppose further that you want your blog to be located at https://example.com/blog/ and that you want other pages to be available at https://example.com/page1/.
The first thing you will want to do is to create a home page. You can do this by creating home.php in your theme directory. Next, create a blog template. The easiest way to do this is to create a file named blog.php with the following contents in your theme directory:
<?php
/*
Template Name: Blog
*/
// Which page of the blog are we on?
$paged = get_query_var(‘paged’);
query_posts(‘cat=-0&paged=’.$paged);
load_template(TEMPLATEPATH . ‘/index.php’); //loads index
?>Log into WordPress and create a page named “Blog” with template “blog”. You’re done. The one last thing you will want to do is to update your permalinks structure to begin with “/blog/”, ie, “/blog/%year%/%monthnum%/%postname%/”. Now you have a WordPress-managed CMS with a unique front page and logically-structured blog content.
As noted above, the home.php file is not needed in versions 2.1+. If both the blog.php and home.php files are deployed in 2.1+ they will conflict and cause the blog.php templated page to appear blank.
- The topic ‘Help with getting the first to be the root directory and th blog to be root/blog’ is closed to new replies.