Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the gVectors community!

Merry Christmas and Happy Holidays! 🎄

[Solved] Disable wp-embed unless on forum pages

5 Posts
2 Users
0 Reactions
2,875 Views
Posts: 4
Customer
Topic starter
(@sho-down)
Member
Joined: 9 years ago

I noticed the default wp-embed loads on every page by default, I'd like to only load it on single.php and the forum pages (so wpForo Embeds works correctly). I have this in my functions.php file but it's not working:

//Disable WP-Embed Unless Single or Forums

if ( !is_single() && !is_page('community') ) {

function deregister_wpembed_script(){

wp_deregister_script('wp-embed');}

add_action( 'wp_footer', 'deregister_wpembed_script');

}

4 Replies
Posts: 4
Customer
Topic starter
(@sho-down)
Member
Joined: 9 years ago

I guess my question is what code would I put to enable loading wp-embed javascript on all forum pages? is_page('community') doesn't work for all forum pages.


Reply
Posts: 4
Customer
Topic starter
(@sho-down)
Member
Joined: 9 years ago

For example bbpress has if( is_bbpress(), does wpforo have something like that?


Reply
Posts: 4234
 Tom
Admin
(@tomson)
Famed Member
Joined: 11 years ago

Hi Sho-Down,

try this:

if ( is_wpforo_page() ){
....
}

Reply
Posts: 4
Customer
Topic starter
(@sho-down)
Member
Joined: 9 years ago

Thanks, that worked!


Reply
Share:
Scroll to top