Skip to:
Content
Pages
Categories
Search
Top
Bottom

custom theme appears to be overriding BP standard pages


  • highaltitudearcher
    Participant

    @highaltitudearcher

    I am trying to install BP on an existing WP installation. A few years ago, I hired an agency to customize my site, and they use a custom layout manager to build pages.

    Possibly as a result, now that I’m installing BP, the pages such as /members, /register, /activate etc are just being showing as blank pages.

    I’m suspecting that support here will be difficult to come by, but I’m hoping there’s some guidance on how to rebuild those pages using shortcodes, or maybe some advice for how to use custom php code to intercept and redirect to the standard BP templates or something.

    I’m not new to coding, but always have a hard time navigating the spaghetti dependencies and conventions of overrides that is WP.

    Please, ask me anything! Would love to figure this out.

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

  • shanebp
    Moderator

    @shanebp

    members should be a blank page that you then assign to the Members component.
    Look in the BuddyPress settings.

    Re template overloads in child theme.


    highaltitudearcher
    Participant

    @highaltitudearcher

    Yes yes yes yes … I’ve seen that page. It’s not very descriptive.

    In this 3rd party theme I have, I’ve noticed to support woocoomerce they’ve added the following in page.php in the main template directory:

    
    <?php while (have_posts()) : the_post(); ?>
        <?php if(is_cart() || is_checkout() || is_account_page() || is_wc_endpoint_url()) : ?>
            <?php get_template_part('templates/page', 'woocommerce'); ?>
        <?php endif; ?>
        <?php get_template_part('modules/module', 'loop'); ?>
    <?php endwhile; ?>
    

    So you can see that they’re directing WP to load the WC templates when it’s a WC page type, and to their custom block editor template if it’s not.

    Is there something similar so that I could add the get_template_part() function for the BP page types (e.g. is_members() or is_activity()…)?


    highaltitudearcher
    Participant

    @highaltitudearcher

    So, I found the bp_is_members_directory() function, and have added that to the stack. Regrettably, I’m struggling to figure out how to use get_template_part(). Any advice is valued.

    <?php while (have_posts()) {
      the_post(); 
      if(is_cart() || is_checkout() || is_account_page() || is_wc_endpoint_url()) {
        get_template_part('templates/page', 'woocommerce'); 
      } elseif( bp_is_members_directory()) {
        // proven to get here at the correct time -- but how to invoke the members/ templates correctly?
        get_template_part('members', 'buddypress');
      }
      get_template_part('modules/module', 'loop'); 
    }
    

    highaltitudearcher
    Participant

    @highaltitudearcher

    Solved.

    1. I had to copy the buddypress/bp-themes/members directory to my 3rd party theme directory
    2. rename <theme>/members/index.php to <theme>/members/members-index.php.
    3. updated <theme>/page.php to the following:
      <?php while (have_posts()) {
        the_post(); 
        if(is_cart() || is_checkout() || is_account_page() || is_wc_endpoint_url()) {
          get_template_part('templates/page', 'woocommerce'); 
        } elseif( bp_is_members_directory()) {
          get_template_part('members/members', 'index');
        }
        get_template_part('modules/module', 'loop'); 
      }
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar