Add mfunc to bbpress sidebar (w3 total cache)

Hi,

I am trying to add the W3 Total Cache

<!-- mfunc mystring -->
[do_widget "(BuddyPress) Log In"]
<!-- /mfunc mystring -->

to my bbpress sidebar in order for my login widget to avoid caching.

Normally I would use the PHP Widget to include this code but W3TC states that this string cannot be wrapped within the php tag, which is what I assume the PHP widget is doing. Instead, it must be added to the template outside of php, but how do I do this and ensure that the login widget I am trying to add appears at the top of the sidebar?

I know I have to call the bbpress sidebar within functions.php but I’m struggling a bit.

Many thanks.

Hey @demonboy,

The code looks like a combination of HTML and a shortcode. You can add that in a Text Widget in WordPress.

If you want it assigned to a bbPress sidebar, you need to create a sidebar and assign it to bbPress pages. You can learn how to do that here https://theme.co/docs/work-with-unlimited-sidebars

Hope that helps.

Hi Christian. I’ve just tried it and it doesn’t work but logically it should as it is HTML, as you say. Let me try something and I’ll get back to you. I already have a bbpress sidebar but it is not appearing in Appearance/Sidebars. Why is this, when it is appearing in my Widgets section?

Hey @demonboy,

Did you add your bbPress sidebar using the Unlimited Sidebars feature? If not, that could be the reason. If yes, there might be a 3rd party plugin causing the issue or changed the setup. I’d recommend you troubleshoot a copy of your site deactivating all 3rd party plugins except bbPress and see if your sidebar appears in Appearance > Sidebars]

Thanks.

Thanks. No, I didn’t use Unlimited Sidebars. Before I do any of this, however, I’m going to make the transfer to Pro and put my site on hold while I work my way through it. Thanks for your help so far.

Hi @demonboy,

You are most welcome, please let us know if you need any further help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.