Skip to main content

Custom code (JS/CSS/snippets) not loading in Fluent Community Portal? Here’s why.

If you’ve ever noticed that your tracking scripts, custom JavaScript, or even CSS snippets don’t load properly inside Fluent Community’s portal pages, you’re not alone.

Just like I did, you might have added your code via hooks like wp_head, wp_footer, or code snippet plugins—only to find they don’t run inside the portal.

That’s because Fluent Community uses its own rendering system, and doesn’t always fire the default WordPress hooks like wp_head, wp_footer, or wp_body_open.


✅ The fix: use Fluent-specific action hooks

To make sure your code gets injected into the portal views, use these dedicated Fluent Community hooks:

  • fluent_community/portal_head → for <head> content (scripts, styles, meta...)
  • fluent_community/portal_footer → for anything you’d usually put before </body> (tracking pixels, JS, cookies...)

Here’s an example:

add_action( 'fluent_community/portal_footer', 'my_custom_script_loader' );

function my_custom_script_loader() {

echo '<script src="https://example.com/my-script.js"></script>';

}


💡 Real-world example

I had issues getting Google Analytics (GA4) and Tarteaucitron.js to load correctly on Fluent’s portal pages.

Adding add_action( 'fluent_community/portal_footer', 'my_tracking_code' ) solved it immediately.

So if your:

  • Analytics tracking doesn’t fire
  • Cookie banners don’t show up
  • Snippets seem to “vanish” inside the portal…

Try hooking into portal_head or portal_footer—it might be all you need.


Hope this helps someone save time! 😊
Feel free to share your tips too.

It's also on Github Projet page https://github.com/WPManageNinja/fluent-community-docs/blob/master/code-snippets.md#custom_css

Jonathan Gwyer

^ this.

Shahjahan Jewel it would be so cool if FluentSnippets had options for inserting in the portal hooks. (I'm using WPCodeBox at the moment)

Please I'll like to add a custom code after two post and inside a post after first paragraph? What hook is needed? I don't want to put the custom code on header, footer or sidebar. I want it after two post on my portal and inside a post when reading a post the custom code displays.