Blog Page Template For New Twenty Thirteen Theme

People always like to modify the homepage or show a static page as homepage but what if you also want to have blog along with the static or customized homepage then you will have to created a custom blog page template.

And as WordPress recently launched its new default theme Twenty Thirteen, a single column theme created specially to make people focus on the post content. I’m going to tell you how to create a blog page template in this theme.

Twenty Thirteen theme

There are several methods to create a separate blog page in any theme, but I’m going to do it through the easiest & the most straight forward method.

You will need:

  1. FTP Access or Cpanel Login
  2. A plain Text/Code editor (Notepad will do)

I am going to use Filezilla FTP software and notepad2 to do this complete job.

Okay, Let’s Start Now then.

Note: Although I am creating this template file directly in the twentythirteen folder, I suggest you to create a child theme instead, because all changes made in this folder can be lost while updating WordPress or the theme.

1. Login to your WordPress directory via FTP

1 wp dir
2. Navigate to Twenty Thirteen theme directory /wp-content/themes/twentythirteen

2 twenty thirteen dir
3. Download index.php to local drive

4. Make a copy of index.php

copy index

5. Rename the copy as blog-page.php

6. Open the blog-page.php in text/code editor, to make the below changes.

—————–

At the top of page you will have to give a name to the new page template so the WordPress can recognize that a new page template has been added, for defining the custom page template

Replace:

with:

define page template

Now, Find The Loop which will look something like this:

And replace with:

change loop code

And as posts_per_page sounds like it tells WordPress how many post to output on the blog page, for example I have set it to 10 posts per page you can change it to whatever you like.

Next, Find the lines that looks like:

remove else

And remove them.

Last, Find the loop closer:

And replace with:

replace endif

Okay you have now successfully created the page template, now you will have to upload it to the theme or child theme directory /wp-content/themes/twentythirteen the same place from where you downloaded the index.php file at beginning.

—————–

Now, go to WordPress admin panel and follow these steps:

1. Create New Page via Pages > Add New

2. Title Page as ‘Blog Page‘ or ‘Blog’ or anything else you want

3. Make sure the permalink is ‘blog‘, so the url will become site.com/blog

4. Under Page Attributes select ‘Blog Page‘ as Page Template

choose page template

5. Publish the page

Okay Now You have the blog page working, you can view your page I’m sure it will have all the post as it was shown on the homepage. Please let me know if you have any question or anything goes bad while doing this, by leaving a comment below, I’ll surely try to help you out.

4 thoughts on “Blog Page Template For New Twenty Thirteen Theme

  1. Hell to the yes. Thanks so much for posting this tut – I was about to resort to attempting to add php in page w/ the exec PHP plugin as a quick fix to twenty thirteen’s lack of a front page/posts template.

  2. Hi Thanx for your post, it made it very easy for me without having the php knowledge. But…

    It working on a normal page but not on the blog page. I can choose the template.
    I’ve added a div class name to test, and it doesn’t show up in the frontend code.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

CommentLuv badge