Adding a Blog Page to Thesis WordPress Theme

by Data Wrangler on March 27, 2010

Many people wish to add a blog page to their page structure.  By doing so, you can have your cake and eat it too because the blog page will wind up in your navigation structure.

How to do it yourself:

1. Create a page called “blog”.

2. Choose custom template for the page template in the left sidebar when creating the page.

3. Leave the page blank — seems odd eh?

4. Open your custom functions file in the editor and add this:

function add_blog_page() {
if (is_page('blog')) {
$limit = get_option('posts_per_page');
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('' . $limit . '&paged=' . $paged);
echo '<div id="content">';
thesis_home_loop();
echo '</div>' . "\n" . '<div id="sidebars">';
thesis_build_sidebars();
echo '</div>';
}
}
remove_action('thesis_hook_custom_template','thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'add_blog_page');

Of course save your custom functions file.

If all is well it should work. Feel free to leave us a comment if it works well for you. This is a modification of the code found here for creating a featured category post page.

I hope you find this useful. If it presents too much of a problem for you or you want something close but different, we’d love to provide you with a project cost to suit your needs. Just contact us with our give us a hollar page.

{ 4 comments… read them below or add one }

Jeb August 6, 2010 at 1:54 pm

Hey DW…
So, is the above used to create a second blog page? That’s what I need…one page for current, new posts, another for past articles written. I’d like to have two separate tabs, one for each…

If you can let me know, that would be great. Thanks…

Reply   More from author

Data Wrangler August 9, 2010 at 7:35 am

Can be done. Fill in our contact form if you would like us to help you do it.

Reply   More from author

Fred July 29, 2011 at 12:29 pm

Hi, need to create a second blog page, as I have actually made my home page the blog page. massive error I know, but I am wondering if you could help me to do this. Much appreciate your input. Thanks

Fred

Reply   More from author

me August 4, 2011 at 3:53 pm

This did not work, and I got that error code that means I now have to reinstall the whole php file.

Reply

Leave a Comment

Additional comments powered by BackType

Previous post:

Next post: