@highaltitudearcher
Active 4 years, 11 months ago
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Solved.
- I had to copy the
buddypress/bp-themes/membersdirectory to my 3rd party theme directory - rename
<theme>/members/index.phpto<theme>/members/members-index.php. - updated
<theme>/page.phpto 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'); }
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 useget_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'); }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.phpin 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()oris_activity()…)? - I had to copy the
Viewing 3 replies - 1 through 3 (of 3 total)