Notifications
Clear all

wpForo 1.x.x [Closed] Getting the current forum id

2 Posts
2 Users
0 Reactions
1,826 Views
Posts: 5
Topic starter
(@apollo)
Active Member
Joined: 6 years ago

Hi

I'm building a widget that needs to display custom content based on the forum that is being shown.Β  Β I therefore need to get the forum id.Β  Β  I've tried usingΒ 

 $forumid = $forum['forumid'];

but no value is returned. How can I get the ID for the sidebar widget?

Thanks

Topic Tags
1 Reply
Sofy
Posts: 4772
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @apollo,

The current forum id is located in theΒ  WPF()->current_object['forumid'] variable. When the wpforo template is 'topic' or 'post'Β  this value is 0.