FluentCommunity Theme for all pages (including TutorLMS, + any CPT
This is an update to my previous post about making FluentCommunity header and sidebar consistent on any page and custom post type without changing the layout of the page/post content, and the default FluentCommunity Frame forces page content into its grid which ends up loading Fluents CSS instead of the page/post layout.
With the custom post which I will share below, I have been able to integrate the header and sidebar menu to all pages (like buddyboss header/panel).
FluentCommunity on Elementor Page without content layout change
FluentCommunity on TutorLMS Lesson Page

TutorLMS with Dark Mode
I will develop this more to make sure the dark mode works with other plugins but this is my current snippet.
(If you want to load only for logged in users you can private message me, but this loads the header and footer for all pages either logged in or not.
Code Snippet
add_filter( 'show_admin_bar', '__return_false' );Βadd_action( 'template_redirect', function () {ΒΒ Β if ( is_admin() ) {Β Β Β Β return;Β Β }ΒΒ Β if ( ! has_action( 'fluent_community/enqueue_global_assets' ) ) {Β Β Β Β return;Β Β }ΒΒ Β do_action( 'fluent_community/enqueue_global_assets', true );ΒΒ Β add_filter( 'body_class', function ( $classes ) {Β Β Β Β $classes[] = 'fluent_com_wp_pages';Β Β Β Β return $classes;Β Β } );ΒΒ Β add_action( 'wp_head', function () {Β Β Β Β echo '<style id="fcom-chrome-layout">Β Β Β Β Β Β html { font-size: 100%; }Β Β Β Β Β Β .feed_layout { --global-vw: var(--fcom-main-content-width, 100vw); }Β Β Β Β Β Β <a data-user_name="media" class="fcom_mention fcom_route" href="https://community.wpmanageninja.com/portal/u/media/">Media Rocketeer</a> (min-width: 1024px) {Β Β Β Β Β Β Β Β .feeds_main.fcom_wp_content {Β Β Β Β Β Β Β Β Β Β padding: 0 !important;Β Β Β Β Β Β Β Β }Β Β Β Β Β Β }Β Β Β Β Β Β [data-vertical-spacing*="top"] {Β Β Β Β Β Β Β Β padding-top: 0 !important;Β Β Β Β Β Β }Β Β Β Β Β Β .hero-section[data-type=type-1] {Β Β Β Β Β Β Β Β margin-bottom: 0 !important;Β Β Β Β Β Β }Β Β Β Β </style>';ΒΒ Β Β Β if ( class_exists( '\FluentCommunity\App\Services\Helper' )Β Β Β Β Β Β && \FluentCommunity\App\Services\Helper::hasColorScheme() ) {Β Β Β Β Β Β echo '<script>Β Β Β Β Β Β Β Β (function(){Β Β Β Β Β Β Β Β Β Β var s = localStorage.getItem("fcom_global_storage");Β Β Β Β Β Β Β Β Β Β if(s){s=JSON.parse(s);if(s&&s.fcom_color_mode==="dark"){Β Β Β Β Β Β Β Β Β Β Β Β document.documentElement.classList.add("dark");Β Β Β Β Β Β Β Β Β Β Β Β document.documentElement.setAttribute("data-color-mode","dark");Β Β Β Β Β Β Β Β Β Β }}Β Β Β Β Β Β Β Β })();Β Β Β Β Β Β </script>';Β Β Β Β }Β Β }, 5 );ΒΒ Β ob_start();Β Β do_action( 'fluent_community/before_portal_dom' );Β Β $fc_before_portal = ob_get_clean();ΒΒ Β ob_start();Β Β do_action( 'fluent_community/portal_header', 'wp' );Β Β $fc_header = ob_get_clean();ΒΒ Β ob_start();Β Β do_action( 'fluent_community/portal_sidebar', 'wp' );Β Β $fc_sidebar = ob_get_clean();ΒΒ Β ob_start();Β Β do_action( 'fluent_community/template_footer' );Β Β $fc_footer = ob_get_clean();ΒΒ Β $fc_open =Β Β Β Β $fc_before_portalΒ Β Β Β . '<div class="fcom_wrap fcom_wp_frame">'Β Β Β Β . Β '<div class="fluent_com">'Β Β Β Β . Β Β '<div class="fhr_wrap">'Β Β Β Β . Β Β Β $fc_headerΒ Β Β Β . Β Β Β '<div class="fhr_content">'Β Β Β Β . Β Β Β Β '<div class="fhr_home">'Β Β Β Β . Β Β Β Β Β '<div class="feed_layout">'Β Β Β Β . Β Β Β Β Β Β '<div class="spaces">'Β Β Β Β . Β Β Β Β Β Β Β '<div id="fluent_community_sidebar_menu" class="space_contents">'Β Β Β Β . Β Β Β Β Β Β Β Β $fc_sidebarΒ Β Β Β . Β Β Β Β Β Β Β '</div>'Β Β Β Β . Β Β Β Β Β Β '</div>'Β Β Β Β . Β Β Β Β Β Β '<div class="feeds_main fcom_wp_content fcom_fallback_wp_content">';ΒΒ Β $fc_close =Β Β Β Β Β Β '</div>'Β Β Β Β . '</div>'Β Β Β Β . '</div>'Β Β Β Β . '</div>'Β Β Β Β . '</div>'Β Β Β Β . '</div>'Β Β Β Β . '</div>'Β Β Β Β . $fc_footer;ΒΒ Β ob_start( function ( $html ) use ( $fc_open, $fc_close ) {ΒΒ Β Β Β $html = preg_replace_callback(Β Β Β Β Β Β '/(<body\b[^>]*>)/i',Β Β Β Β Β Β function ( $match ) use ( $fc_open ) {Β Β Β Β Β Β Β Β return $match[1] . $fc_open;Β Β Β Β Β Β },Β Β Β Β Β Β $html,Β Β Β Β Β Β 1Β Β Β Β );ΒΒ Β Β Β $html = preg_replace_callback(Β Β Β Β Β Β '/<\/body>/i',Β Β Β Β Β Β function ( $match ) use ( $fc_close ) {Β Β Β Β Β Β Β Β return $fc_close . $match[0];Β Β Β Β Β Β },Β Β Β Β Β Β $html,Β Β Β Β Β Β 1Β Β Β Β );ΒΒ Β Β Β return $html;Β Β } );Β}, 1 );
if you can't copy the code snippet properly, you can get it here
FluentCommunity Header/Sidebar all pages and CPT - Pastebin.com
Will it work on Thrive Apprentice
Bryan WilliamΒ haven't tried it, but I believe it should 100%
Justice AkoredeΒ Thrive plugins are very stubborn; they hardly support external integration
Bryan WilliamΒ try it out first. if it does not work, delete it afterwards. But like I said, I'm still 100% positive it'll work
Is it possible to use only the header, without the sidebar?