Skip to:
Content
Pages
Categories
Search
Top
Bottom

How Do I Set a Static Home Page and Custom Blog Page in BuddyPress on WP Multi-Site?


  • Lee
    Participant

    @diondeville

    I’m using WP Multi-Site with BuddyPress activated network wide. I want the home page of each site to point to a static welcome page situated on that site. I want each site’s blog to be displayed on a separate blog page. For example

    For site one:

    Welcome page at site-one.example.com/
    Blog page at site-one.example/blog/

    For site two:

    Welcome Page: site-two.example.com/
    Blog Page: site-two.example/blog/

    To try to achieve this for each site, I have configured WordPress to show static “Welcome” page when someone visits the site’s hostname and I have configured the “blog” page to show when people click the blog page URL. The problem is that in the BuddyPress blogs directory, each site’s blog name still links to the site’s hostname e.g Blog One points to site-one.example.com/ and Blog Two points to site-two.example.com but I want them to point to site-one.example.com/blog/ and site-two.example.com/blog/, respectively.

    In wp-config.php, I’ve tried setting

    `define ( ‘BP_HOME_BLOG_SLUG’, ‘blog-name’ );`

    I’ve tried adding the same custom slug config to /plugins/bp-custom.php.

    Neither of the above methods of setting a custom blog slug helped.

    I am aware there are themes that do this naturally i.e. some themes set a static home page that uses widgets to show custom content on the home page. Such themes provide a separate widget that can be used to display blog posts in any page. But again, the BuddyPress blogs directory still associates a blog’s title with its site’s hostname as opposed to the URL of the custom page set for the blog.

    I have thought of using a plugin to rewrite the URLs as pages are served but this could have unintended consequences.

    So, how do I set a custom blog page and a custom home page for each site in BuddyPress in a multi-site environment and still use the blogs directory?

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

  • @mercime
    Participant

    @mercime

    Simplest way: On lines 38 and 42 of https://buddypress.trac.wordpress.org/browser/tags/1.5.1/bp-themes/bp-default/blogs/blogs-loop.php try changing

    to
    `/blog`

    So if you’re using a bp-default child theme, create a folder named blogs and copy over blogs-loop.php over from bp-default theme and make the changes. If you used BP template pack plugin, open up the file in blogs folder transferred to your WP theme.


    Lee
    Participant

    @diondeville

    @mercime, thank you very, very much. Works perfectly. I might have a go at writing a plugin to do this automatically, unless someone else gets there before me.

    Edit to add: just one thing, there’s no need for the forward slash prefix before the slug name but there should be one after it, e.g

    blog/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How Do I Set a Static Home Page and Custom Blog Page in BuddyPress on WP Multi-Site?’ is closed to new replies.
Skip to toolbar