• Resolved thorshammer

    (@thorshammer)


    I’ve installed and build my website in a sub-directory, and have designed a custom Homepage in the root directory that is hand coded (not using WordPress). Using the Admin / General / Settings, I’ve tried to change the URL for “Site Address” to point to the root directory, but when I click Save it always reverts the URL to the sub-directory it was set to in the first place.

    path: https://www.blueblueberrycompany.ca/blueberries

    I’m wondering whether that Admin feature to redirect the Site URL must see WP files there in order to accept it?

    If so, I’d imagine I have to hack the $home variable in the PHP. Where can I find it?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Check Settings > Reading – you need to set your front page to a static page.

    An easy way to get WP to recognize your page is to simply turn your non-WP page into a custom page template. Create a matching (blank) page for it in Pages, and assign the template to that page using the template drop-down that’ll appear once you’ve uploaded the template.

    Here’s a tutorial.

    Thread Starter thorshammer

    (@thorshammer)

    Thanks zoonini.

    I followed the tutorial – a good one, though I’m new and therefore installed the latest, WP 3.1. On-screen things look a lot different in terms of what menus are displayed and where options are located. Anyway, got through that…

    So I:
    (1) inserted the PHP template code (Template Name: index_blueberry) at the top of my already-made custom Homepage, and moved it into the root directory of my template (named index_blueberry.php);
    (2) created a page called HOME, and set it to the template “index_blueberry”;
    (3) created a page called website, using the default template;
    (4) in Settings / Reading, I changed the “Front Page Displays” to “static page”, then selected “HOME” for Front page and “website” for Posts page.

    Now when I selected the “Home” link in the main menu (provided by the template I’ve installed: iVA) it loads the empty HOME page in the default template, instead of loading my customized page with it’s own template. I went back to edit that HOME page – and strangely, now the option to view and change the template for any given page is no longer displayed! Every page on the website, same thing: no box displayed for template choice (same when I create a new page). I checked Screen Options but there’s no checkbox there that seems to relate to viewing template choices.

    I’m stumped. Help?

    Could you paste the contents of index_blueberry.php into a Pastebin?

    Also – give your homepage a page slug other than “home” – try “splash”.

    p.s. I do see a splash page here:

    https://www.blueblueberrycompany.ca/

    Perhaps I misunderstood what you’re trying to do.

    Thread Starter thorshammer

    (@thorshammer)

    Your promptness is SO appreciated zoonini!

    Pastbin: https://pastebin.com/BaaUw3Qr

    site URL: https://www.blueblueberrycompany.ca

    NOTES:
    (1) when initially surfing to that URL the correct custom Homepage is displayed – because WP is installed in a sub-directory and I have installed the custom Homepage in the root directory (in addition to having it as a template in the theme folder);
    (2) only the 4 links along the very top of the Homepage are active (all else is just a snapshot);
    (3) when any of those 4 links are clicked you arrive inside WP – here the Home link (pointing correctly to the sub-directory wherein WP is installed) is where the problem currently stands. No custom template applied.

    I ALSO TOOK YOUR SUGGESTION – changed HOME page slug to “blue”, no change.

    Thread Starter thorshammer

    (@thorshammer)

    At this point I need to sort out why the template choices drop-box has disappeared, when I am creating or editing pages.

    The index_blueberry template file is still there in the theme root directory – and when I created the HOME page in WP it gave me the template drop-down list and that template as a choice. Now it’s gone…

    I have to head out but a few very quick notes…

    In your custom template page, this:

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

    Needs to go at the very top of the page, above the two lines that are there now:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "https://www.w3.org/TR/html4/loose.dtd">

    This should fix your template drop-down problem.

    I will get back to you on the rest – I think I know what’s going on but I’ll have to continue another time, or someone else can chime in. Basically you’ll need to edit a line in your WordPress index.php file and move it to the root but I’ll get back to you with details.

    Thread Starter thorshammer

    (@thorshammer)

    Thanks a bunch zoonini.
    Problem solved!

    I created yet another custom template, and moved it to the same theme root folder. When I returned to editing HOME page, there was my template-choices drop-list again, with the orig. and the newest custom templates both displayed. And as I suspected, the HOME page had somehow been reverted to the default template. Now when I set it to the index_blueberry template, it works. Clicking “Home” now yields the custom homepage.

    Not sure where things went off the rails there. But now that I know how to add more custom pages (templates) without hacking WP PHP stuff, it was a very worthwhile problem to sort through.

    Thanks so much zoonini. Where do I go to “Like” you? :o)

    Thanks so much zoonini. Where do I go to “Like” you? :o)

    Haha – here. ?? https://www.facebook.com/zoonini

    Glad you got this solved! Good luck with the rest.

    If you would please mark this thread as “resolved” (drop-down menu in the right column) it would be appreciated. Helps everyone keep better track of whose issues are still outstanding. Thanks!

    p.s. when you’re ready to go live, you don’t need to move your entire WordPress installation to the root – there’s an easier way and it should take less than 10 minutes.

    Thread Starter thorshammer

    (@thorshammer)

    Actually I don’t need to move anything – it’s already configured just as I want it. Thanks again. (Flagged as resolved.)

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘A custom Homepage NOT using WordPress’ is closed to new replies.