Support » Plugins and Hacks » Add separate blog page

  • Hi, can anyone point me to a good tutorial on creating a blog page in a WP site where the other pages are static?
    I’m working on this: http://journeywithdrjill.com/
    As you can see, I was able to get far enough to make the pages all static, but now I want to make a blog page for the site, and I am totally lost.
    Thanks.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi elbalazo,

    I’m assuming this theme you built includes a standard theme file like index.php?

    yes it does.
    I tried duplicating it and renaming it blog.php, but it is a template I made myself and it is stripped of code for posts. I have been trying to modify the Default theme into a template that can be used as the blog for my current theme.

    Okay, now keeping in mind what the Codex says about creating Page Templates, you can create a new Page Template and call it blog.php

    At the very top you will need to insert this …

    <?php
    /*
    Template Name: Blog
    */
    ?>

    Now, in the Add Page screen, write a new page, call it whatever you want (Blog) and select blog.php from the drop down menu. This will assign your newly created blog.php template file to the newly created Blog page.

    For this to work, you must have the code for generating posts present in blog.php (The Loop)

    So I need to incorporate the Loop code into the blog.php file to make it work? I don’t need to worry about assigning the posts to the blog page?

    Also, what about creating a .php file for comments?

    Once blog.php contains the necessary code (The Loop) for displaying posts it will do just that.

    Most themes have an index.php file which automatically acts as a site’s home page. Therefore it will output that site’s posts. However, if you are using blog.php, with a Static Page, whenever someone clicks on the page called Blog (which uses the blog.php file) THAT page will output the posts. Have a look at Template File Hierarchy.

    If you wish to display comments then yes you will need a comments.php file for that AND call that file in blog.php if that is where you want them displayed.

    Well I’m stumped. Here is what I have so far:
    http://journeywithdrjill.com/?page_id=90

    It displays the author, time, category etc., but no title and no post body. Also, the little header that says “blog” should be the page title.

    Any thoughts?

    All I see is “Woops… Sorry, no posts we’re found.”

    not to threadcrap, but do you think WP 3.0 will make all this easier?

    I feel its a very important option

    @elbalazo

    I see progress. More specifically …

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec volutpat, nunc sollicitudin rutrum tempor, urna libero pretium quam, sed viverra libero metus ac urna. Vestibulum ultricies mi vel mi fringilla tristique. Aenean lobortis consequat elit non (more…)

    Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

    @shadowgerm

    That would be nice but the way it is now is not terribly difficult. (using Page Templates) 🙂

    So as I was saying, I am able to get the time/date/author stamp and category link to appear on the previous page, but none of the post title or any content.
    Also, it there anything special that is supposed to go into the header that would allow the post to be shown? I built this template very simply from scratch.

    If I were to publish the page temporarily and show you what I am talking about, would that help?

    If I were to publish the page temporarily and show you what I am talking about, would that help?

    Sure, I’ll be floating around for awhile.

    Thanks.
    Take a look at this:
    http://journeywithdrjill.com/blog-2/

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Add separate blog page’ is closed to new replies.