Currently my pages are set up as follows:
Event List: Is on a page called “Training” with a shortcode to display the list of events. This is great no changes needed to this page.
Event Single: looks great except for the section right above the page which contains the page title and breadcrumbs. The theme (Sterling) uses a template part to display this. There is a woocommerce option I have tweaked were the page.php detects if the current page is the woocommerce product page and displays an alternative template part. I figure this same logic can be applied to the event single page. I’m just not sure how to write the conditional code since I’m a little shaky on my php coding.
Here is the conditional code that looks for the woocommerce product page and replaces the template part with the alternative “template-part-woocommerce-banner.php”:
// Check for WooCommerce. If true, load WooCommerce custom layout.
if ( class_exists( 'woocommerce' ) && ( ( 'true' == is_woocommerce() ) || ( 'true' == is_checkout() ) || ( 'true' == is_cart() ) || ( 'true' == is_account_page() ) ) ) : ?>
<section class="small_banner">
<?php get_template_part( 'template-part-woocommerce-banner', 'childtheme' ); ?>
</section>
I’m using a child theme as well. So I can replace the modified page.php in the child theme directory. Just need help writing the “else if” code.
Thanks
P