post_type) ) { $file = AMPFORWP_CUSTOM_THEME . '/single.php'; } } if ( is_page() ) { if( 'single' === $type && ! ('product' === $post->post_type) ) { $file = AMPFORWP_CUSTOM_THEME . '/page.php'; } } // Loop Template if ( 'loop' === $type ) { $file = AMPFORWP_CUSTOM_THEME . '/loop.php'; } // Archive if ( is_archive() ) { if ( 'single' === $type ) { $file = AMPFORWP_CUSTOM_THEME . '/archive.php'; } } $ampforwp_custom_post_page = ampforwp_custom_post_page(); // Homepage if ( is_home() ) { if ( 'single' === $type ) { $file = AMPFORWP_CUSTOM_THEME . '/index.php'; if ($redux_builder_amp['amp-frontpage-select-option'] == 1) { $file = AMPFORWP_CUSTOM_THEME . '/page.php'; } if ( $ampforwp_custom_post_page == "page" && ampforwp_name_blog_page() ) { $current_url = home_url( $GLOBALS['wp']->request ); $current_url_in_pieces = explode( '/', $current_url ); if( in_array( ampforwp_name_blog_page() , $current_url_in_pieces ) ) { $file = AMPFORWP_CUSTOM_THEME . '/index.php'; } } } } // is_search if ( is_search() ) { if ( 'single' === $type ) { $file = AMPFORWP_CUSTOM_THEME . '/search.php'; } } return $file; } // Custom Footer function ampforwp_custom_footer_file($file, $type) { if ( 'footer' === $type ) { $file = AMPFORWP_CUSTOM_THEME . '/footer.php'; } return $file; } // Load the Core Styles of Custom Theme add_action('amp_css', 'ampforwp_custom_style'); function ampforwp_custom_style() { global $redux_builder_amp; require_once( AMPFORWP_CUSTOM_THEME . '/style.php' ); // Custom CSS echo $redux_builder_amp['css_editor']; }