Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Changing default INDEX? (9 posts)

Started 1 year, 9 months ago by: PH (porsche)

  • Profile picture of PH (porsche) PH (porsche) said 1 year, 9 months ago:

    Hello All,

    Is there a way to change the “main page” (index.php) to another page on BuddyPress?

    For example:

    http://www.my-websight.com/index.php is the default BP installation

    but, I want it to be

    http://www.my-websight.com/some-other-page-of-my-choice.html

    currently im using the HTACCESS method. which is:

    RewriteRule . index.php [L]
    DirectoryIndex main-splash-page.html

    (Ive added the DirectoryIndex) which changes my “default index”

    It seems to work the way I want it to. However, I fear unintended consequences.

    Question:
    1) Is there a preferred way to do this?
    2) Are there any checks/hooks on BuddyPress or Wordpress that would be aggrevated by me adding/specifying a “DirectoryIndex”
    3) Is this just a wordpress no/no?

    FYI: Im on WP 3.0 – latest BP (upgraded from WPMU)

    cc:
    @DJPaul
    @crashutah
    @johnjamesjacoby

    **any thoughts?

  • Profile picture of PH (porsche) PH (porsche) said 1 year, 9 months ago:

    any thoughts on this guys?

  • Profile picture of techguy techguy said 1 year, 9 months ago:

    Why not just use a child theme and modify the index.php to show whatever you want the page to be? You could also make it show one thing for logged in and one thing for not logged in. You probably could even look at referring page or set a cookie or something to know if it’s the first time they’ve been or not.

  • Profile picture of PH (porsche) PH (porsche) said 1 year, 9 months ago:

    @techguy

    creating a whole new “child theme” vs.. ONE LINE of httaccess

    seems like an easier choice to just add that one line of httaccess

  • Profile picture of techguy techguy said 1 year, 9 months ago:

    Almost always multiple ways to do it in WordPress. Depends on what type of changes you might want to make in the future.

  • Profile picture of Builder Builder said 1 year, 9 months ago:

    John, interesting. But how do you “show one thing for logged in and one thing for not logged in” /index page? Just with coding on the one page/template set for home or create a whole new page template?

  • Profile picture of techguy techguy said 1 year, 9 months ago:

    @bpuser44 It’s really simple. I did it as one page template that was set as the home page. Then, in the page template you just add this code:
    if ( is_user_logged_in() ) {
    //Content you want people to see if they’re logged in
    } else {
    //Content you want people to see if they’re not logged in
    }

  • Profile picture of Roger Coathup Roger Coathup said 1 year, 9 months ago:

    @porscheheritage :

    you can do this very simply from your wp-admin backend -

    Goto “settings … reading … front page displays:”

    [if you want to do anything more complex, child themes (as suggested by @crashutah) aren't too much work - you can create a bare bones one just with style.css , and inherit everything else from the bp-default theme. If you are making any mods to design / layout of your site, this is the way to go anyway.
    http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/ ]

  • Profile picture of PH (porsche) PH (porsche) said 1 year, 8 months ago:

    Thanks for the reply guys!

    Hat tip* to @rogercoathup @crashutah