• Resolved lukekorea

    (@lukekorea)


    Hi, I wish to use Wisechat in a sidebar. However, this sidebar is a php file that is present on all pages, hence I can’t insert a Wisechat widget for each individual page (or in this case, classroom) that I want to have.

    Is there a way to set the widget to generate a channel name based on the page ID it is loaded in? Say, a class on physics ,with the page ID ‘physics’. Could the widget then load the channel named physics just for that page?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marcin

    (@marcinlawrowski)

    Hi,

    You can insert Wise Chat using PHP function in your sidebar, for example:
    <?php if (function_exists('wise_chat')) { wise_chat('my-channel-name'); } ?>

    Instead of ‘my-channel-name’ you can use a PHP variable that is initialized with a page ID. Therefore you will have a separate channel for each WordPress page. You can also set a Custom Field for your pages to group them under common name (“physics” for example) and use that Custom Field as a channel in sidebar.

    Thanks

    Thread Starter lukekorea

    (@lukekorea)

    Thanks, that suggestion set me on the right path, and I was able to find out how to get the ID of a page from there. It works!

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Dynamic Channel in Widget’ is closed to new replies.