• 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 - 46 through 60 (of 71 total)
  • I managed to get this working with four lines of code!

    Set up Ryan’s Page To Front plugin, and make sure it works. Then, in wp-blog-header.php, add the following lines of code at about line 204, just after do_action('template_redirect');

    if($_SERVER['REQUEST_URI'] == "/index.php/blog/") {
    include(ABSPATH . '/wp-content/themes/t2v2/index.php');
    exit;
    }

    Make sure you fix up the request URI and the template.

    I tried lawtai solution, it didn’t work for me. When I change the WordPress uri it made an “unstlyed” admin, and “unstyled” blog, like zhiyang reported. If I change the blog uri instead, it produced a 404 error.

    I did of course, as instructed, installed the plugin AND changed the permalink structure.

    ===
    Other: I tried then Adders solution. It didn’t work either. Gave me a 404 error.

    Any idea of what else you did in order to make this thing work? I bet your solutions are cleaner than mine.

    I wasn’t able to use the PageToFront plugin and get access to my blog. I was aiming to do something like:

    SiteRoot/
    ‘About’ Page (Front)
    /Blog

    I ended up with the following structure:

    SiteRoot/
    /Blog
    /Blog/’About’ Page

    and using a htaccess redirect to fake the front page.

    I’ve used the page2front plug-in with great success.

    Now, I have a problem I’m trying to solve and wonder if page2front is helping or hindering…

    Safari will load any page at my site but the front:
    https://dvd.kentidwell.com/
    …it reacts as if it is loading, and a view of the source shows it’s all there, but the window is blank.

    Shame, in the my target audience most likely uses Safari.

    However…if I use this:
    https://dvd.kentidwell.com/?
    …Safari loads the site just fine.

    All other browsers load all pages ok.

    I’ve tried tricking the user agent, and using a hardwired link to style.css, and validating the css day after day, but no change.

    Any help, please, thanks…

    two solutions to your problem in addition to the ones above:

    my theme finds the page with the slug of ‘home’ and displays it on the front page if it exists. to grab the code:

    https://www.semiologic.com/projects/sem-theme/

    alternatively, create a home.php file and use the get a post plugin:

    https://guff.szub.net/get-a-post

    If you want to put some info on your blog into the “static” home page, you could do it without hacking anything outside your theme.

    Try this: Create a custom template with whatever you want in it.

    Then select that template for your homepage post, and use Ryan’s plugin to make that be your home page.

    It “should” work, and I plan to do it, but haven’t got around to it myself for various complex/lazy reasons.

    I’ve installed Ryan Boren’s Page to Front plugin and now get lots of “Cannot modify header information” warnings. I’ve seen claims this is caused by “extra white space” but don’t really know where to look for this. I copied the file from the Codex and put it in the plugin folder under wp-contents and changed the page id to the page I wanted as my front page. It works except for the frequent warnings. WordPress is not in my root directory but is in a subdirectory.

    p.s. the permissions on all my .htaccess files are set to 744 Is this correct? I’m using WP1.5

    OK, I finally found the extra white space.

    There were a couple of carriage returns at the end of page_to_front.php following the ‘?>’.

    I took those out and now the plugin works fine.

    mxtrader-
    I am having the same issue- You work around sounds a bit over the top for something that should be so simple. I was really disappointed to find no one replied with an answer to this question.

    What good is having a static homepage if you can not link to the blog- the whole reason WP is installed in the first place?

    In my set up- I want to use PAGES to have a default frontpage message that will change from time to time but remain there for a while. I created a link in my menubar called “News” linking to the “index.php” file- in hopes that when clicked users can then see my up to date blog. Ideally… but when clicking the link it just refreshes the page.php file- so with this set up no one can even access the blog. If need be I am going to attempt Mxtrader’s work around but I am hoping to get advice on a cleaner solution.

    Moderator James Huff

    (@macmanx)

    Sorry didn’t find the “next page” link until now. Regretably none of the detailed solutions still worked for me. I am lost in what I can’t believe is not a default setting in WP. My blogging area is works like a current news area- I have no desire to send the users there first. What I DO desire is to have a static editable frontpage and a LINK to the blog along with the rest of the site. Nothing much more.

    Denis slug “home” sounds ideal- but again- now the home.php is always the default- I can not link to the blog posts from there.

    Tried it-used that plug in first actually before Ryan’s plug in. The “index.php” link (where the blog sits) only refreshes the “home.php” page… it does not redirect to another area. How can I make sure it re-directs?

    No answer for allowing PHP on a page?

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