WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Static Front Page with blog in subdirectory - but powered by WordPress (8 posts)

  1. SunilDVR
    Member
    Posted 6 years ago #

    Hi all,

    I'm relatively new to WordPress, but have some experience with PHP/CSS/HTML. I think my inexperience with how WordPress works has caused some of my problems! Please therefore excuse any terminology which is inaccurate.

    Current situation: WordPress up and running just fine, installed in a subdirectory (/blog). I am using the excellent "Mandigo" theme by onehertz. The "front" page of WordPress is it's regular "posts" page, showing most recent posts in chronological order.

    What I'd like to happen:

    * WordPress as a back-end for the whole site. When someone visits the primary URL (i.e. not /blog), I'd like that to be a regular WordPress static "Page". It may, or may not, have a certain amount of dynamic content, such as the first 100 words of the latest post, but that's something I can worry about later. Similarly, I might have other static "Pages". However, the front page (and any others which I want to) need to "pick up" the main styling of the Mandigo theme, regardless of whether they're in the /blog subdirectory or not. I can customise the look/feel of those static pages later on.

    Importantly, I want to have the menubar showing these various static pages (e.g. "About" in the default install), as well as one titled "Blog", which would effectively take you to the /blog subdirectory.

    The actual blog page, I wish to keep pretty much as it is : i.e. if someone goes to the /blog directory it will show them what it does at the moment (a reverse chronological list of blog posts as defined in the WordPress options).

    I realise I'm not explaining this as nicely as I'd like to; perhaps an example would be better. Alex King demonstrates what I'm after nicely: his main page is a "Static" page, as far as I can see, with some dynamic content, and exists in the root of his website. It includes links to specific sections at the top - one of these is "Blog"; clicking on it takes you to the /blog "directory" (though it may only be a category nicely rewritten using Permalinks). This is a "normal" blog type page, with posts in reverse chronological order. Similarly, his other pages (e.g. Articles) work in a similar fashion.

    I have spent a couple of days reading through the Codex, but although there's a lot of information out there, I've not been able to find anything which "comprehensively" helps me. I've found the page on moving WordPress to another directory; I've found a lot of posts on how to design my own theme from scratch (which is way more than I want to do at present, and without spending a lot of time figuring out the exact internals of how WordPress operates, e.g. The Loop and so on, is not very helpful for what I'm trying to do), and various pages on how to turn WordPress into a full blown CMS - many of which are aimed at versions prior to 2.1 (I think?) which involve renaming files to home.php, cascasding "rules" as to which comes first, and which has been superseded by "static front page" feature the version of WP I am using anyhow...

    I would very much appreciate a "beginning wordpress guide" to what exactly I need to do to achieve my goal of a WordPress powered site with 2.3, with static front pages and the blog being "contained" within it's own /blog directory.

    For those interested, here is the blog (don't expect anything too spectacular!).

    Thank you for your time and assistance,

    Sunil

  2. Roar
    Member
    Posted 6 years ago #

    I am subscribing to this as I would love to do the same thing.

  3. moshu
    Member
    Posted 6 years ago #

    1. Not the guide you found but this one:
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
    2. Then create a Page "Blog" and another "Home.
    2a. Go admin > Options > Reading: set them as front and posts pages.
    3. Creating new Pages they will be added automatically to your horizontal navbar.
    4. Fix your permalinks!

  4. SunilDVR
    Member
    Posted 6 years ago #

    Hi moshu,

    Thanks for the link - I had also seen that page and had tried doing as it suggested (and as the rest of your steps say), but it went all askew:

    The navbar link to the "blog" page tried to go to /blog/blog (which doesn't exist) rather than just "blog". Also, the theme already had a "Home" link, which seemed to cause some trouble. Finally, going to /blog then gave me a directory listing of the blog folder, as index.php was "moved" to the root...

    Do you have any suggestions as to what could be causing any of those three issues?

    I'll try again just now, stripping it down to the bare minimum, and see what happens.

    Thanks,

    Sunil

  5. SunilDVR
    Member
    Posted 6 years ago #

    An Update - problems (pretty much) solved:

    Further to my previous post - Moshu's steps almost worked perfectly. I guess that in my previous mucking around, I did things in the wrong order or left out a step.

    The only problem is one which I mentioned in the previous post, namely a duplicate "Home" link. I deleted every single static "Page" in the WordPress "Manage->Pages" panel. However, the link to "Home" still existed in the navbar...

    I then created 2 pages (Home and Blog) as per Moshu's step 2 above, and set them as static "Home" and "Blog" pages as per step 2a.

    These were thus just fine - except for the fact that there was a duplicate "Home" link. If I removed the "Home" page, then the static pages in Options->Reading don't have anywhere to point at.

    The solution is to do with the theme. Mandigo has a default link to "Home" (index page) visible at all times... going to Presentation->Theme Options gives a checkbox to prevent this from showing. Note - it also has a checkbox to prevent "Blog" from showing up at all times, which I have NOT touched, but it didn't show up before I created a page called "Blog" anyhow... rather odd, but never mind.

    Now all I have to do is get my head around custom templates.

    Many thanks to Moshu for their help.

    Sunil

  6. Roy
    Member
    Posted 6 years ago #

    You could delete the "home" link from the files of your theme, then all the links you will see there are from the "Pages". You'll probably need to open your header.php in notepad or something similar.

  7. moshu
    Member
    Posted 6 years ago #

    Just for the future readers' sake:

    Finally, going to /blog then gave me a directory listing of the blog folder, as index.php was "moved" to the root...

    That's a typical mistake when you don't read the instructions carefully: it doesn't say "move" - it says "copy", meaning to have it in BOTH places :)

    And the duplicate links are always a theme issue: hard coded links in the theme files. Easy to remove.

    Glad it worked for you.

    Theme_Development: guide for your next step.

  8. SunilDVR
    Member
    Posted 6 years ago #

    Hi Moshu,

    Lesson learned - don't follow instructions when you're too tired!

    Thank you for all your help,

    Sunil

Topic Closed

This topic has been closed to new replies.

About this Topic