Notifications
Clear all

[Solved] Chatbox on forum page

12 Posts
3 Users
1 Reactions
525 Views
Posts: 51
 guts
Topic starter
(@guts)
Trusted Member
Joined: 4 months ago

Hello,

I would like to position the chatbox between two categories on the forum page.

I already have the code to insert into the functions.php file:

 

function my_chat_function(){
do_shortcode( '[wise-chat]' );
}
add_action('wpforo_top_hook', 'my_chat_function', 10);

 

However, the chatbox doesn't appear; perhaps I edited the wrong functions.php file.

Any assistance would be greatly appreciated.

11 Replies
Tutrix
Posts: 1301
(@tutrix)
Noble Member
Joined: 4 years ago

@guts 

You have to edit the forum.php (2022 Theme)
the code looks like this

<?php if (function_exists('wise_chat')) { wise_chat(array('Channel1','Channel2','Channel3')); } ?>

use your channel

1 Reply
 guts
(@guts)
Joined: 4 months ago

Trusted Member
Posts: 51

@tutrix It works but how to put it between 2 categories?
I mean, I don't want it on the top of the page.

Thanks.

 
Posts: 51
 guts
Topic starter
(@guts)
Trusted Member
Joined: 4 months ago

Also, it looks weird on my forum, can you please tell me if you encountered this issue or help me?

WiseChat is stuck to my first category.

 

BlackRaz
Posts: 406
Admin
(@blackraz)
Contributor
Joined: 8 years ago

Hi  @guts 

add_action( 'wpforo_loop_hook', function( $key ){
	if( $key === 0 ){
		apply_shortcode('[wise-chat]');
	}
});

 

Try this hook: the $key is a index of the forums current iteration.

For the styling you should write the CSS codes for solving the website css conflicts

1 Reply
 guts
(@guts)
Joined: 4 months ago

Trusted Member
Posts: 51

@blackraz Thanks for your reply.

Which template should I edit, please?

I am having difficulty comprehending the CSS issues as I am currently using the default template. :/

BlackRaz
Posts: 406
Admin
(@blackraz)
Contributor
Joined: 8 years ago

You should use the Snippets Plugin for custom PHP codes 

https://wordpress.org/plugins/code-snippets/

1 Reply
 guts
(@guts)
Joined: 4 months ago

Trusted Member
Posts: 51

@blackraz I installed and added your code, but my forums disappeared.
Could you please provide me with step-by-step instructions?

 

Page 1 / 2