Skip to:
Content
Pages
Categories
Search
Top
Bottom

Static Front Page, Blog Link Doesn’t Work

  • Avatar of BeLogical
    BeLogical
    Participant

    @belogical

    I have my installation setup with a static front page (dash->settings->reading). My buddypress “blog” or “news” link, when clicked, shows just a link to the static front page, which is just domain.com. How can I get the “blog” link to show my current posts?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Well, you turn off the static front page for starters.

    If what you’re saying is that you want your home page to be static, and have /blog be your blog, you can just customize home.php in your theme directory and have that be your home page?

    Otherwise, you’ll need to rename or remove home.php, set your static front page, and create a page called “Blog” and set it to be your blog.

    Avatar of BeLogical
    BeLogical
    Participant

    @belogical

    you are close, I want this:

    domain.com (static page)

    domain.com/blog (list all my blog posts, index.php)

    domain.com/home (buddypress home page, home.php)

    i have everything working, except the /blog link.

    with that being said, what code do I need in my index.php in order to pull the “normal home page” blogs posts? right now it looks at the WP radio button and just pulls the “static” page, which ends up being a link back to domain.com. i want domain.com/blog to list all my posts. i tried the normal: <?php while (have_posts()) : the_post(); ?>, but I assume that looks at the WP static flag that I set, which will no longer pull the posts. how do I get around this?

    Avatar of BeLogical
    BeLogical
    Participant

    @belogical

    if anyone has a thought, i would appreciate it! this is my LAST major issue before I convert production! (that I know of, hehe)

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Alrighty… :)

    Create 3 pages in your main blog. Name them “Root” “Blog” and “Home” (you can name them what you want, but this way they have distinct purposes.)

    Set “Root” to be your static homepage.

    Set “Blog” to be your blog page.

    Rename “home.php” to “homepage.php” and at the top if it put

    <?php
    /*
    Template Name: Home Page
    */
    ?>

    Edit the “Home” page, and in the “Page Template” area, select “Home Page”

    Viola? Hopefully. :)

    Avatar of BeLogical
    BeLogical
    Participant

    @belogical

    ok, I did that and it takes me right back where I started. when I click on the \”blog\” link, it just shows the \”static\” or root page as the only post available instead of showing all my posts.

    it’s almost like there is a bug between MU and BP on the dash->settings->reading->posts page setting. doesn’t matter what page i select, it won’t display the posts.

    can you test that on your setup?

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Inside your functions.php for your home theme, comment out:

    function bp_show_home_blog() {
    ......
    }

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Remember also, that the navigation in header.php has NOTHING to do with WordPress pages. They are hard coded to the BuddyPress predetermined hi-jacked URLs.

    Avatar of BeLogical
    BeLogical
    Participant

    @belogical

    awesome man, that worked! thanks so much for all your help.

    i removed it by adding `remove_action( ‘wp’, ‘bp_show_home_blog’, 2 );’ in the functions.php page.

    is there any way to avoid a core hack? i tried creating a template for /blog and putting the remove_action in it under a function, but it didn’t seem to work that way.

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    It’s not really a core hack. Functions.php is meant to be edited.

    The BP Home theme is just a mask over WPMU’s eyes. It uses functions.php to play some tricks on WPMU to allow it to hijack some urls. All that you’re doing is hardcoding it yourself.

    Avatar of thomasbp
    thomasbp
    Participant

    @thomasbp

    May I reopen? :)

    The solution above worked for me until BP 1.1.

    Now I don’t want to tamper around with the functions.php in the parent theme.

    Thus I’ve tried to unhook the “bp_dtheme_show_home_blog” function in the bp-sn-parent/function.php by entering

    remove_action( ‘wp’, ‘bp_dtheme_show_home_blog’, 2 );

    into the functions.php of my child theme. Even though other functions in my child functions.php are working the removing of this action does not succeed. Any idea why?

    Avatar of BeLogical
    BeLogical
    Participant

    @belogical

    I haven’t gotten my component converted to 1.1 yet, so I haven’t gotten to this stage yet. have you had any luck thomasbp?

    I’m using the WP 3.0 (multisite) and the latest BuddyPress upgrade. I’m using the default BP theme, but one of the “colours” child versions.

    I want to have a static front page – the About page – but this (as mentioned above) effectively “kills” the ability to display the main domain blog; it’s still listed on the blogs page as the first in the list, but click on it, and you’re back at the static front page. You can get to individual posts via the Activity stream, but that’s not the way I want it to work.

    Could someone walk me gently through what I need to change where to make this work? Thanks!

    Avatar of Shaun MacRae
    Shaun MacRae
    Participant

    @shaunmacrae

    I would also love to be able to do what @gtn is proposing. I’ve been able to set up a ‘News’ page that I can publish posts to which helps, but in the blogs listing, the main site blog is still linking through to my static home page rather than domain/news as I would like.

    I found this fix and it appears to be working for me:

    1. Open the index.php, save it to your theme as posts-page.php (or whatever template name you like).
    2. Edit the newly created posts-page.php file and place the following at the top to create a page template:

    `<?php
    /*
    Template Name: Posts Page
    */
    ?> `

    3. Now scroll down in the posts-page.php to the beginning of the WordPress loop and just before the line “ add this one line of code “ Note: (5 == the number of post to show you can change this to whatever you want.)
    4. Save the posts-page.php file.
    5. In your WordPress/BuddyPress admin panel create a new page called “Blog” (or something similar) and select “Posts Page” under Template.
    6. Publish page.

    You should now be able to go to your Settings -> Reading menu and set a static page and select your Posts Page to show your blog posts.

    I’m going to try and add the steps for the fix again. I didn’t see the note about using backticks for code…

    1. Open the index.php, save it to your theme as posts-page.php (or whatever template name you like).
    2. Edit the newly created posts-page.php file and place the following at the top to create a page template:

    `<?php
    /*
    Template Name: Posts Page
    */
    ?> `

    3. Now scroll down in the posts-page.php to the beginning of the WordPress loop and just before the line “ add this one line of code “ Note: (5 == the number of post to show you can change this to whatever you want.)
    4. Save the posts-page.php file.
    5. In your WordPress/BuddyPress admin panel create a new page called “Blog” (or something similar) and select “Posts Page” under Template.
    6. Publish page.

    You should now be able to go to your Settings -> Reading menu and set a static page and select your Posts Page to show your blog posts.

Viewing 15 replies - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.