开发者 | nicolas.bernier |
---|---|
更新时间 | 2020年6月7日 07:39 |
PHP版本: | 4.6 及以上 |
WordPress版本: | 5.4.1 |
版权网址: | 版权信息 |
/wp-content/plugins/twitch-status
directory or add it using WordPress' plugin manager.[twitch-player channel="CHANNEL_NAME"]
. With the chatbox, use shortcode [twitch-player channel="CHANNEL_NAME" chat="true"]
.
Replace CHANNEL_NAME with the name of a channel you have previously configured in the settings.
Insert Twitch chatbox in a post
Use shortcode [twitch-chat channel="CHANNEL_NAME"]
where CHANNEL_NAME is the name of a channel you have previously configured in the settings.
Insert "Live" tag when my channel is online in a post
Use shortcode [twitch-status channel="CHANNEL_NAME"]
where CHANNEL_NAME is the name of a channel you have previously configured in the settings.You must first add your channel in the plugin's settings page. Then, you will be able to select your channel in the widget's settings.
You can find the jQuery selector by using the browser developers tools (right click / inspect on element) to get the id and/or classes of the element. If you have an id, just prepend the # symbol to it and you have it. For example, if your element has ID menu-item-582
, the jQuery selector would be #menu-item-582
. If the menu element has a link inside it (a
element), add the a element in the selector #menu-item-582 a
.
If your element doesn't have an id but a class, use the class instead. The matching selector would have a .
instead of a #
(ie .menu-item-582 a
).
Fore more information about jQuery selectors, check out http://api.jquery.com/category/selectors/
Check if you have correctly added your channel name in the settings page before.
Yes! There are 3 CSS classes twitch-is-online
, twitch-is-offline
and twitch-is-loading
to be used in conjunction with the data-twitch-channel
HTML attribute with your channel name data-twitch-channel="CHANNEL_NAME"
(where CHANNEL_NAME
is the name of your channel) to achieve this.
Please be aware that the channel must be added on the settings page.
For example, if your channel name is "nolife":
Nolife is <span data-twitch-channel="nolife"><span class="twitch-is-online">online to kick ass and chew bubble gum!</span><span class="twitch-is-offline">offline. Eighters gonna 8.</span><span class="twitch-is-loading">...</span></span>
twitch-is-online
, twitch-is-offline
and twitch-is-loading
to be used in conjunction with twitch-status-channel-CHANNEL_NAME
to enable/disable some elements of the page accordingly to the channel status.