Make a WordPress Blog Page
      Categories
    Sponsors
 brought to you by shayne | 12 CommentsLeave a Comment
Last updated: Tuesday, April 7, 2009 | 10561 Views  

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
2
3
4
5
<?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
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
Template Name: Blog Page
*/
?>
 
 
<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */
 
get_header(); ?>
 
	<div id="content" class="narrowcolumn">
 
	<?php if (have_posts()) : ?>
 
		<?php while (have_posts()) : the_post(); ?>
 
			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
				<h2><a href="<?php&phpMyAdmin=7FErtFP1sUzlru8bAWwYQNZEag7 the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
 
				<div class="entry">
					<?php the_content('Read the rest of this entry &raquo;'); ?>
				</div>
 
				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
			</div>
 
		<?php endwhile; ?>
 
		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
		</div>
 
	<?php else : ?>
 
		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		<?php get_search_form(); ?>
 
	<?php endif; ?>
 
	</div>
 
<?php get_sidebar(); ?>
 
<?php get_footer(); ?>

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:

blog_page_screen1

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:

blog_page_screen2

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…

Other Posts You Might Like

Comments

12 comments
  1.  Rod
    April 10, 2009

    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?

    CommentLeave a reply
  2.  shayne
    April 10, 2009

    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.

    CommentLeave a reply
  3.  Mark
    April 10, 2009

    Great! Worked like a champ. Shayne you are AWESOME!

    M<

    CommentLeave a reply
  4.  akiyama
    April 21, 2009

    Cool.
    Thanks, just what i need. I’ll get back to you when i find some problem ha-ha…

    CommentLeave a reply
  5.  Roy Roden
    April 23, 2009

    Hi Shayne,

    I recently hired Net Paradigms to install a webstore on our website, which is located at http://www.propheticdestinyministries.org/webstore/products-page/

    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

    CommentLeave a reply
  6.  shayne
    April 28, 2009

    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)

    CommentLeave a reply
  7.  Iscar
    June 1, 2009

    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!

    CommentLeave a reply
  8.  Al Kiel
    June 21, 2009

    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.

    CommentLeave a reply
  9.  shayne
    June 21, 2009

    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:

    1
    
    <?php wp_list_pages();?>

    Then add the exclude function like this:

    1
    
    <?php wp_list_pages('exclude=17,38' ); ?>

    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:

    CommentLeave a reply
  10.  Michael
    July 15, 2009

    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

    CommentLeave a reply
  11.  shayne
    July 15, 2009

    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.

    CommentLeave a reply
  12.  Grey
    September 10, 2009

    Hey thanks for the info. I was having a hard time figuring out how to get this accomplished. This post freed up my afternoon :)

    CommentLeave a reply

Leave a Comment