Hi
I suggest not using home.php as your homepage. Copy the contents of home.php into a file called page_home.php and add this at the very top.
<?php
/*
Template Name: HomePage
*/
?>
That is a custom page template.
Now go to the WP page editor and create two new pages, one called Home and one called Blog. Leave them empty, just create them. On the one called Home, while you are creating it, in the right column Attributes section, in the Template pulldown, select HomePage and save/update
Now go to Admin / Settings / reading
Select a static page for your home page.
Choose Home for front page and Blog for posts page.
All of this will give you what you are looking for. index.php will be used for your posts, which will display on the Blog page at URL domain/blog
Set up a category called “Blog” and file all posts and sub-categories under this.
Hi guys thanks again for your help.
The file called page_home.php I have to create correct because I didn’t see a file with this name in any of my folders?
After setting up both the home page and blog page the problem I’m having now is that by naming the home page it’s saying Home where I would like it to be the title of my blog. Also, I tried putting in some dummy text to add content to the blog post, but nothing is showing up on the page. When I click on the home title now it’s not sending me to the single.php page it’s producing the 404 error.
Any extra help would be appreciated.
Thanks,
Charlie
The file called page_home.php I have to create correct because I didn’t see a file with this name in any of my folders?
yes, you have to create the file. I can see my original wording was a bit ambiguous about that.
the problem I’m having now is that by naming the home page it’s saying Home where I would like it to be the title of my blog.
Change the title of the page from Home to the title of your blog. You also need to change the page slug (URL). If you don’t see a place to change this while editing the page, go to the page edit list, point at the name of the page “Home”, and click on the Quick Edit link. Change the slug name there from home to the name of your blog as in this-is-the-name-of-my-blog That becomes the URL for that page.
Go back and read my original directions and make sure you have assigned the page_home template to the new home page (the one you just changed the name of from home to blog-name).
And make sure you changed the settings in admin / settings / reading
Thanks again for all your help I appreciate it. I’m still having trouble I guess it’s just one of those things.
I made all the changes you suggested, but after adding a post the post is only available on the blog page. I would like to be able to have the summary on the home page (page_home.php), click read more or the blog title then to the actual single.php post page. The way it seems to be working now the links to the actual post from the home page do not work at all. To view the blog post I have to click my blog page.
Question when changing the slug is there a way to keep the url hidden. So the home url looks more like a home page?
Thanks for your help sorry it’s giving me such problems.
charlie
hi
it sounds like the links are not included in the code on your page_home.php template check for <a href="<?php the_permalink();?>">
If you don’t see that in your homepage code, borrow code like that from index.php and update the home page code with the links.
as far as the URL, there is no requirement the page URL match the page title, so if you want the slug different, by all means change it.
I didn’t give you any code changes for page_home.php as your original post seemed to say you were OK with how the home page worked, you just also wanted a blog page. So I had you copy what was already in home.php to the new home page template.
That is true my home.php page was working correctly. What’s weird is that I didn’t change any of the page structure whatsoever. But, when I copied home.php to page_home.php the only php code that seems to be working is the <?php the_title(); ?> everything else like:
<?php the_permalink();?>,
<?php the_content();?> ect.. is not working.
I’m going to keep continuing to debug and maybe I’m I can pull a rabit out the hat.
I appreciate all your help.