Message Button Device Visibility
Show or hide the message button based on device type using CSS.
This guide explains how to control the visibility of the WSMS Message Button on different devices using CSS.
Show Only on Mobile
To display the message button only on mobile devices:
- Go to Appearance → Customize
- Select Additional CSS
- Add this code:
.wpsms-chatbox {
display: none !important;
}
@media only screen and (max-width: 600px) {
.wpsms-chatbox {
display: block !important;
}
}
- Click Publish
Show Only on Desktop
To display the message button only on desktop devices:
.wpsms-chatbox {
display: block !important;
}
@media only screen and (max-width: 600px) {
.wpsms-chatbox {
display: none !important;
}
}
Adjusting the Breakpoint
The 600px width is a common breakpoint for mobile devices. Adjust this value to match your theme’s responsive design requirements.
Related
- Message Button Settings - Configure the message button
Last updated: December 26, 2024