• I have a standard installation of wordpress with a slightly customised Kubrick theme (I have added a top menu for Pages). Have a look at health.keiskamma.org/news.

    What I would like to do is make the default page of the site a wordpress Page called ‘Home’ (this can be done easily with the ‘static front page’ plugin). However, I then want to add another menu item to my top menu that will load the blog. I cannot figure out how to do this. What URL can I use to link to the main blog page?

    Thanks for any suggestions!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Link to

    https://www.health.keiskamma.org/news/index.php

    ^this is where your blog posts are made by default.

    Thread Starter bobhof

    (@bobhof)

    Thanks. But I have just activated Static Front Page and now your link goes to the Home page I created, so I have no way of linking to the blog. Semiologic (makers of Static Front Page plugin) recommend the following:

    FAQ: I want a static front page and a normal blog
    Use the static front page plugin normally
    Create a category called ‘Blog’, make it the default category, and put every post in it
    Link to the ‘Blog’ category in your navigation menu

    But it’s a messy workaround and then I always have a category called ‘blog’ in my right nav bar. Any ideas?

    well I’m not sure how the static page plugin works… but obviously when you turn it on it renames whatever file it is to index.php, making it the default. your blog section (the part with all your posts) should still be there somewhere but with a different name.

    https://www.health.keiskamma.org/news/?cat=1

    ^this link goes to your blog section if that helps

    I can’t see your directory listings to tell you which file it is. maybe index.old.php?

    Thread Starter bobhof

    (@bobhof)

    I could link my blog button in the top menu to https://www.health.keiskamma.org/news/?cat=1.

    It’s still not ideal though. https://www.health.keiskamma.org/news/?cat=1 links to “Archive for the ‘Blog’ Category”. “Blog” in this instance is a category I set up. It’s not the same as the default front page most blogs show. For example, the ‘login’ and ‘links’ lists in the right column are not visible and “You are currently browsing the archives for the Blog category” appears under the search field. Also, the page only displays posts in the “blog” category so uncategorized posts wont appear. It is the best solution I have seen so far though. Thanks very much for your help!

    In the WP theme heirarchy, if it finds a page called home.php in the theme templates, it will load that one first.

    What I woudl do is make a copy of the index.php in the template folder, rename it to home.php, then edit it to add whatever you wanted, including the call to the blog url.

    no problem

    The other solution I was thinking was a bit more base.

    You could restore the blog to the way it was before. then adjust the settings on your webserver so that it defaults to your static page, instead of index.php. Been a while since I mucked around that low, I think its the httpid file? something like that, if I weren’t at work I’d look it up on my server. then all you’d have to do is link back to
    https://www.health.keiskamma.org/news/index.php
    as your blog.

    Thread Starter bobhof

    (@bobhof)

    I tried that originally. I edited the .htaccess file so links to health.keiskamma.org/news were directed to another page “home.html”. Unfortunately, that would require that my wordpress Pages are all static so the top menu will function and I need the Pages to be editable through wordpress admin.

    If I try to make the default page dynamic (eg a copy of index.php renamed home.php) I am back to the original problem: it just displays the blog immediately. It’s a perfect catch 22 ??

    Thanks again for your help. I’ve been going round in circles for days now.

    Thread Starter bobhof

    (@bobhof)

    Thanks Andrea. I tried that but then how can I make home.php display one of my Pages (eg page_id=2)? And even if I manage that, I will then be unable to link to the blog since any links to https://www.health.keiskamma.org/news/ will just retrieve my home.php page. Any other ideas?

    Thread Starter bobhof

    (@bobhof)

    It’s important to note that my top menu is not static. It is set to display my wordpress Pages as well as a link to the blog. The functionality I am looking for is basically that the first time a visitor arrives at the site (https://www.health.keiskamma.org/news/), https://www.health.keiskamma.org/news/?page_id=2 loads instead. But if they click on the “Blog” link in my menu (which also has to be https://www.health.keiskamma.org/news/) they then see the blog. If there were just another URI that links to the main blog page it would be easy.

    Thread Starter bobhof

    (@bobhof)

    Chaps, it’s late here so I’m going to sleep on this one. Thanks for all your suggestions. Let me know if you have any other ideas. ‘Night.

    Thread Starter bobhof

    (@bobhof)

    Okay! I think I have a solution. It’s not perfect, but it has the desired effect:

    I changed my root index.php file to the following:

    <?php
    /* Short and sweet */
    define(‘WP_USE_THEMES’, true);

    if ($_SERVER[‘REQUEST_URI’] == ‘/news/’) {
    $_GET[‘page_id’] = ‘2’;
    }

    require(‘./wp-blog-header.php’);
    ?>

    I also deactivated static home page plugin. Now, https://health.keiskamma.org/news/ links to whichever page I choose (in the example above it is page 2), and https://health.keiskamma.org/news/index.php links to the first page of my blog. Woohoo!

    I found this neat solution on https://www.alexking.org/blog/2005/03/23/wordpress-hacking/

    Thanks for the help chaps!

    awesome. ??

    Thread Starter bobhof

    (@bobhof)

    Hi all, I have moved the site to https://www.keiskamma.org/health. Have a look.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Default home page question.’ is closed to new replies.