Theme Compatibility Guide for Devs
Just published the theme compatibility guide for developers. If you want to load the FluentCommunity frame programmatically, like for all the blog posts, archives, or any custom post types, then you can easily do that witha PHP code snippet.
If you are using a block-based theme, then maybe you don't need this snippet as you can build your own template with the FluentCommunity Page Layout Block.
https://github.com/WPManageNinja/fluent-community-docs/blob/master/theme-compatibility.md
Please leave a comment if you have any questions about the code snippets.
Shahjahan JewelΒ this code works with blog post type, what about woocommerce page?
Michal PaczulaΒ The code I have shared for the blog posts or all the pages or only for the blog post types including author, archives and single.
For woo, you can check if it's a single product or specific woo pages and load the frame.
Shahjahan JewelΒ Please tell me exactly how I can load a Fluent iframe into WooCommerce. I havenβt found this in any of your tutorials or documentation, and I also donβt see such an option directly in Woo itself. Iβd really appreciate your help with this.
Michal PaczulaΒ This snippet will load the woo pages (product, cart, checkout) into the FluentCommunity Frame:
add_filter('fluent_community/template_slug', function ($templateSlug) {
if ( defined('WC_PLUGIN_FILE') && is_woocommerce() ) {
return 'fluent-community-frame.php';
}
return $templateSlug;
});
Shahjahan JewelΒ thanks for answers but this snippet dont work for me :( (yep, i try clear cookies)
Shahjahan JewelΒ
I'm using this code to differentiate between logged in users and those without. The shopping cart and checkout are displayed in the Fluent template, but the product page isn't. We're using the Kadence theme. Any idea why it's not working?
add_filter('fluent_community/template_slug', function ($templateSlug) {
if (is_user_logged_in()) {
// WooCommerce: Warenkorb oder Kasse
if (function_exists('is_cart') && is_cart()) {
return 'fluent-community-frame.php';
}
if (function_exists('is_checkout') && is_checkout()) {
return 'fluent-community-frame.php';
}
// WooCommerce: Einzelne Produktseite
if (function_exists('is_product') && is_product()) {
return 'fluent-community-frame.php';
}
}
return $templateSlug;
});
AndrΓ© SalierΒ the same here, cart and checkout with iframe, but product page dont...
Shahjahan JewelΒ any solution for this?
Michal PaczulaΒ Shahjahan JewelΒ
I urgently need a solution for this, can you help us π
Shahjahan JewelΒ
Hi Shahjahan, we tested the code; it works perfectly for the shopping cart and checkout, but not for product pages.
We use the Kadence Pro theme. Do you have an explanation for this? I would be very grateful for a solution.
Michal PaczulaΒ - did you find a solution?
AndrΓ© SalierΒ We have investigated the issue. The problem is that WooCommerce overwrites the template, whether it's modified by other hooks or not. We will take a look again.
Shahjahan JewelΒ thank you for the quick reply. Can you give us an approximate timeframe for a solution?
If that doesn't work, we'll have to resort to a very complex solution and create separate pages for the products β we'd like to avoid that work.
Shahjahan JewelΒ - any news about that?
Michal PaczulaΒ Shahjahan JewelΒ we also urgently need a solution π
Still without any answer.... Shahjahan JewelΒ ?
Can it work with "Thrive Themes?" I'm still looking for a good solution for this
Bryan WilliamΒ You follow the Theme Compatibility Guide for Devs. It works with Thrive Themes (I just tested it with the post, and it works fine) π
Hoang HxnΒ Wow! This is sounding so good, but how do I add the code? Do I need a plugin to achieve this? I don't have tech skills please
Bryan WilliamΒ The easiest way to add any of these snippets is with the Fluent Snippets plugin.
https://community.wpmanageninja.com/portal/space/community-meta/post/fluentsnippets-10-50-released
Add a new php snippet and add the code provided.
Bryan WilliamΒ It's very easy, You just need to install FluentSnippets Plugin (It's free) > Then Copy the Code at https://github.com/WPManageNinja/fluent-community-docs/blob/master/theme-compatibility.md and paste it into FluentSnippets
Ross FCAΒ I love this plugin, it works like magic. Currently I 3 options as listed below
-
Run Everywhere:
Snippet gets executed everywhere (both frontend and admin area) -
Frontend Only:
Snippet gets executed only in frontend area -
Admin Only
Snippet gets executed only in admin area (/wp-admin/)
I understand option 1 very clearly, but I don't understand options 2 & 3
Again, after choosing option 1, when I tried to edit the page in Thrive Themes, I was unable, as you can see in the image
Hoang HxnΒ I love this plugin, it works like magic. Currently I 3 options as listed below
-
Run Everywhere:
Snippet gets executed everywhere (both frontend and admin area) -
Frontend Only:
Snippet gets executed only in frontend area -
Admin Only
Snippet gets executed only in admin area (/wp-admin/)
I understand option 1 very clearly, but I don't understand options 2 & 3
Again, after choosing option 1, when I tried to edit the page in Thrive Themes, I was unable, as you can see in the image
Not working at all on blocksy theme on woo pages, not even on shop page by setting the page template in page settings...