• Resolved markp

    (@markp)


    Hi all,

    In WP1.5 we have the new option to create Pages not just Posts.

    What I want to do is create a Page which will be the site’s home page. When users go to the site I want them to see that page.

    I’ve tried a few things. I’m already managing to get the site home page to appear in the Page template (as in default Kubrick) and not the Posts template (or any other template) by fiddling with the end of wp-blog-header.php:
    } else if ( is_home() && file_exists(get_page_template()) ) {
    include(get_page_template());
    exit;

    but it still shows the latest posts and not the page. I’ve tried writing the ‘ID’ of the page into a variable but I’m getting nowhere there either.

    Any ideas?

    I’m imagining that this type of setting might just become a standard option in the admin console.

    I’m using build ‘wordpress-2005-01-17’

    Cheers,

    Mark

Viewing 15 replies - 16 through 30 (of 71 total)
  • The plugin works great with standard and default templates but when I try it with “Devenir-en-gris” I get these message errors :
    Warning: comments_template(/home/userhtml/d/i/a/diapason/3w/wp-content/themes/devenir_en_noir): failed to open stream: Success in /home/userhtml/d/i/a/diapason/3w/wp-includes/comment-functions.php on line 24

    Fatal error: comments_template(): Failed opening required ‘/home/userhtml/d/i/a/diapason/3w/wp-content/themes/devenir_en_noir’ (include_path=’./’) in /home/userhtml/d/i/a/diapason/3w/wp-includes/comment-functions.php on line 24
    URL= https://www.diapason-france.com
    Help, anyone, please?

    OK, I finished up finding the problem. In the index file supplied with the devenir-en-gris zip, there is a strange indication:
    <?php comments_template( is_single() ); // Get wp-comments.php template ?>
    Taking it out fixes the theme :
    <?php comments_template(); // Get wp-comments.php template ?>

    Moderator James Huff

    (@macmanx)

    Probably because there is no wp-comments.php in WP v1.5. ^_-

    how would you display the regular blog posts on this front page? i.e. i’d like to have the normal “last ten posts” loop in a small box on this page. would you need a plugin to run php on the page you are showing on the front page?

    I’m trying to add this to the codex. Please check it out:
    https://codex.www.ads-software.com/CMS

    Excuse me, I’m completely novice on this thing of WordPress (but pretty seasoned in PHP). I added the plugin, because I needed for the things I want, it works perfect. Thing is, how do I link to the real blog page from the new home page?

    Sorry for bothering.

    I have used also the home.php approach, it also works well. But thing still is… once I get to the first page, that could be an “about” or “warning” or whatever you like, how do I link to the blog page? which is the address I should refer to?

    Somebody in other post suggested: place wp inside other directory, like /wp and then write a index.php page that links to whatever.com/wp, it would be easy, but it would render the templates mechanism unusable for this first page. So I really think both, the plugin or the home.php ways are the way to go. But I have no clue on how to get to the blog from there.

    Any help?

    If you’ve implemented Ryan’s quick and dirty plugin, can you link to your site in here? I’d like to see how things look. Thanks! ??

    heh mxtrader, i’m not using this plugin myself, but it seems like one solution that you could do would be to create a blog.php template, and then just put the loop in there and create it as a page. I’d think this could work.

    trevorturk: I use this on my archives page…

    <h2>Last 15 Posts</h2>
    <ul>
    <?php wp_get_archives('type=postbypost&limit=15'); ?>
    </ul>

    Sorry Ryan, I’m munching on it. Why? I’d like to use it for kyl.org. It’s really bad right now. As soon as I can convince whoever is in charge to switch hosts, I’m going to push WordPress as much as I can.

    I just don’t get it.

    In wp-blog-header.php there is a line which says include(get_home_template()) which it goes to:


    function get_home_template() {
    $template = '';

    if ( file_exists(TEMPLATEPATH . "/home.php") )
    $template = TEMPLATEPATH . "/home.php";
    else if ( file_exists(TEMPLATEPATH . "/index.php") )
    $template = TEMPLATEPATH . "/index.php";

    return apply_filters('home_template', $template);
    }

    1. So, if I create a blog.php based on index.php (in the template directory) how do I link to the blog.php page just created? a link to blog.php won’t work. And then I do a link from my home.php to blog.php how the thing will know it is a page and not home?

    2. Or the blog.php should be in the root directory and should be a copy of the main index.php? Note: Forget it, I already done this, and doesn’t work.

    I’ll be trying all options, but if you have something that can help, I’ll really apreciate that. Maybe I should write a different wp-blog-header.php ????

    Damn… this is frustrating.

    1. Turned on the plugin, going to page 2.
    2. In the Page 2 I created a link to blog.php in the root directory
    3. The thing recognizes that as a home page, so it goes to page 2

    It behaves exactly the same using the home.php in the template directory. So how the heck do I link to the blog page? is there any way to inform WP that the page you’re seeing is NOT the home page (function is_home() return false, I guess)? I don’t care if it is with a URL parameter. Of course using ?p= indicates also that what you see is_home.

    I could tweak wp-blog-header.php to do so… but is there any “supported” way to do it?

    Ok managed to work. I think. More or less… enough for me, for now:

    1. Deactivate the plugin!!!
    2. In root directory:
    1. Copied wp-blog-header.php to wp-blog-header2.php
    2. Copied index.php to blog.php
    3. In blog.php changed the reference from wp-blog-header.php to wp-blog-header2.php
    4. In wp-blog-header2.php eliminated lines 215 thru 217
    • In template directory
    1. Created home.php based on index.php (basically eliminating the loop
    2. In home.php put whatever you like and a link at the end to blog.php

    Looks like it is working now. (Or at least enough for me)

    you have a link where we can take a look? and glad you got it to work

    Uhmmm yes got it… but I planned it to be an “not for all family members website”

    (I have nothing “unappropiate” yet tho), so let me setup another website, or if you still want to see it, send me an email to mxtrader .at. gmail.com, I’ll send you the address… I don’t want to appear like doing publicity to the site here.

Viewing 15 replies - 16 through 30 (of 71 total)
  • The topic ‘WP Page as static home page’ is closed to new replies.