Today I’m going to tell you how to make a blog page for your WordPress site. WordPress already has this functionality built in obviously, but if you have your homepage set to a static page, then sometimes you will lose your “blog” page. You’ll notice that when you do select your static homepage in “Settings->Reading” it will also ask you for a “Posts” page, so that’s what we’re going to show you how to make.
First, what you will want to do is locate your “index.php” file from your theme. Copy that to your desktop (or wherever you’d like) and rename it to “blog_page.php” (or whatever name you would like). Then you will want to edit that file, and place the following code at the very beginning of the file:
1 | <!--?php /* Template Name: Blog Page */ ?--> |
That will let WordPress know that this file is a “Template” file. I used the default Kubrick theme for this demonstration, so the entire code for the new “Blog Page” php file would look like this:
1 2 3 4 | <!--?php /* Template Name: Blog Page */ ?--> <!--?php /** * @package WordPress * @subpackage Default_Theme */ get_header(); ?--> |
Not Found
Sorry, but you are looking for something that isn’t here.
Next you will want to upload that file back into your theme directory on your server. Once you’ve done that, then go to your WordPress dashboard and create a new Page.
Title the page whatever you’d like. In this example, I’m going to name it “Blog”. Don’t put any content in the page, just title it and then from the “Attributes” area, where you can select the “Page Template” you will now see your new page template listed titled “Blog Page” and it should look like this:
So now, select that and save your new page.
Next, you will go to “Settings–>Reading” and select your new page for your “Posts” page like this:
Once you do that save, you should then see your new “Blog” page show up in your navigation and it should display all of your latest blog posts.
That’s it!
So, until next time…
Rod says
Hi, Shayne…thanks for doing this.
Almost everything worked for me when I did this, except…the new blog page doesn't show in the top navigation of my page…only in the navigation at the bottom of the page. You can see it here: http://getinshapein20minutes.com/?page_id=71
Any ideas?
shayne says
Make sure that your theme doesn't have some type of "exclude" feature that is in place that's keeping the button from showing from the top nav. Also, if you're using an "include" feature, you may have to add that new page.
Mark says
Great! Worked like a champ. Shayne you are AWESOME!
M<
akiyama says
Cool.
Thanks, just what i need. I'll get back to you when i find some problem ha-ha…
Roy Roden says
Hi Shayne,
I recently hired Net Paradigms to install a webstore on our website, which is located at http://www.propheticdestinyministries.org/webstor…
When I tried to insert my products, it wants to place them in a "square" rather than the size and proportion that I need. As you know, art work often comes in various sizes such as 8 x12 and not cubes. Also books, etc. In the admin panel, you can change the thumbnail sizes, but it want to do this in cubes. Net Paradigm is looking into this for a week now, and hasn't come up with a solution yet. How do I insert graphics and change the size that I want to present? In WP pages, you can insert a graphic, and click on it and drag it to the size you like. Is this possible for E- commerce?
Also, how do I change the size of the font for the categories and decrease the spacing between them. If you notice in the left column, they are rather large.
Also, how can I make the layout more efficient? By the time you put in the art work, the print size, the price and P&P, and then "add to cart," altogether they take up about half the page. Is there a way to rearrange this so that it is much more efficient? In other words, so I can get more on the page?
Are there templates available that I can see that gives me a visual view that I can choose from that might work better?
Last question – can I purchase you book E–commerce bible as a book by mail, or does it have to be downloaded?
Thanks – Roy Roden
(207) 236-4904
shayne says
Roy –
You can set the thumbnail sizes at whatever dimension you want. You can also choose the "upload seperate thumbnail" option if you like.
The category font sizes and spacing will be handled in the shop's CSS file (default, iShop, marketplace.css)
You can adjust how the page is displayed by editing the "product_display_functions.php" file.
The WP Ecommerce Bible is only available for download through the site (www.wpecommercebible.com)
Iscar says
You added lots of great information. I surely added your blog to my list of favorites. This article is very interesting article. It is full of mind-blowing stuff.
Thank you!
Al Kiel says
I have a couple of pages in my blog where I want to include links to additional pages. Creating the links are easy – and creating the pages are easy – but I do not want the new pages to show up in the Navigation or as secondary navigation. I just want them residing on the blog as a page that gets linked to from different pages.
shayne says
Al,
Just make the pages, but you'll want to use an exclude function to hide the pages from your navigation.
Look in your header.php file (most likely where the code is located) for this line:
<pre lang="php" line="1">
<?php wp_list_pages();?>
</pre>
Then add the exclude function like this:
<pre lang="php" line="1">
<?php wp_list_pages('exclude=17,38' ); ?>
</pre>
The "17" and "38" would be the page IDs that you want to hide.
Or you could just get a plugin to do it…which you can find here:
Michael says
Yo shayne,
I am working on a wordpress site, and have been looking all over the place for an answer or a solution, so far this looks the closest. So i thought i would ask you the question on how to figure this problem out.
If you go to (http://www.michaelmartinho.com/site) you will see the homepage with the blog on the left hand side and it works fine, but then you go into "contact" you get the page with the blog no longer on the right side. I have looked all over for solutions, maybe you have an answer?
Thanks
-Michael
shayne says
Michael,
It looks like the two pages you've mentioned are using two different sidebars maybe? Can you use the same one on the Contact page as you're using on the homepage? See if that works.
Grey says
Hey thanks for the info. I was having a hard time figuring out how to get this accomplished. This post freed up my afternoon ๐