Botoscope creates special pages (Privacy Policy, Shipping Policy, Product Details, etc.) that open in Telegram WebApp. These pages have a default CSS styling, but you can completely replace it with your own custom styles.
๐ง The Magic Hook
Botoscope loads its page styles using this filter:
botoscope_page_styles_link
By default, it points to BOTOSCOPE_ASSETS_LINK . 'css/page.css', but you can change this to load your own CSS file instead.
๐ How to Use It
Add this code to your theme’s functions.php file (or create a custom plugin):
add_filter('botoscope_page_styles_link', function($default_css_url) {
// Return the path to YOUR custom CSS file
return get_stylesheet_directory_uri() . '/css/botoscope-pages.css';
});
๐ฏ Examples
Example 1: Custom CSS in Your Theme
add_filter('botoscope_page_styles_link', function($default_css_url) {
return get_stylesheet_directory_uri() . '/css/botoscope-pages.css';
});
File location: /wp-content/themes/your-theme/css/botoscope-pages.css
Example 2: Custom CSS in Child Theme
add_filter('botoscope_page_styles_link', function($default_css_url) {
return get_stylesheet_directory_uri() . '/botoscope-custom.css';
});
File location: /wp-content/themes/your-child-theme/botoscope-custom.css
Example 3: CSS from a Plugin
add_filter('botoscope_page_styles_link', function($default_css_url) {
return plugin_dir_url(__FILE__) . 'css/botoscope-styles.css';
});
File location: /wp-content/plugins/your-plugin/css/botoscope-styles.css
Example 4: External CDN
add_filter('botoscope_page_styles_link', function($default_css_url) {
return 'https://your-cdn.com/botoscope-styles.css';
});
๐ Default CSS File Reference
Here’s what the default Botoscope CSS includes (as a starting point for your custom file):
body{
margin:0;
padding:12px 20px;
background:#fff;
color:#111;
font:16px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
body::before {
content: "";
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -1;
background: url(../img/page-bg.svg) center repeat;
background-size: 320px auto;
opacity: 0.05;
pointer-events: none;
}
img,video{
max-width:100%;
height:auto;
}
a{
color:#0a84ff;
text-decoration:none;
}
a:hover{
text-decoration:underline;
}
h1,h2,h3{
line-height:1.25;
margin:1.2em 0 .5em;
}
p,ul,ol,table{
margin:0 0 1em;
}
footer, header, .woocommerce-breadcrumb {
display: none;
}
.botoscope-telegram-products {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 20px;
margin: 20px 0;
}
.botoscope-product {
border: 1px solid #ddd;
padding: 12px;
border-radius: 8px;
text-align: center;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
transition: box-shadow 0.3s;
}
.botoscope-product > p{
display: inline-block;
max-height: 211px;
overflow: hidden;
}
.botoscope-product:hover {
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.botoscope-product img {
width: 100%;
height: auto;
max-height: 180px;
object-fit: contain;
margin-bottom: 10px;
}
.botoscope-product h2 {
font-size: 16px;
margin: 0 0 6px;
color: #0077cc;
}
.botoscope-product span[itemprop="price"] {
font-weight: bold;
font-size: 14px;
}
.botoscope-pagination {
margin-top: 30px;
text-align: center;
}
.botoscope-pagination > ul{
display: flex;
list-style: none;
justify-content: center;
}
.botoscope-pagination > ul > li{
padding: 5px;
}
.wp-audio-shortcode.mejs-audio{
margin-bottom: 5px !important;
}
๐จ Customization Ideas
Here are some things you can customize in your CSS file:
- ๐จ Colors: Change
background,color, link colors - ๐ Fonts: Replace
font-familywith your brand fonts - ๐ Layout: Adjust padding, margins, max-width
- ๐ผ๏ธ Product Grid: Change
.botoscope-telegram-productscolumns and gaps - โจ Effects: Add shadows, borders, hover effects
- ๐ญ Background: Replace or remove the
body::beforepattern
๐ฑ Pages That Use This CSS
Your custom CSS will be applied to all these Botoscope pages:
- ๐ Privacy Policy
- ๐ Shipping Policy
- ๐ฐ Refund Policy
- ๐ฆ Product Details
- ๐จ Variation Gallery
- ๐ฌ Support Chat
- ๐ฌ Media Casting
- ๐ Product Filter
๐ Quick Start Guide
- Create your CSS file in your theme folder (e.g.,
/css/botoscope-pages.css) - Copy the default CSS from above as a starting point
- Customize colors, fonts, and layout to match your brand
- Add the filter hook to your
functions.php - Test by opening any Botoscope page in Telegram WebApp
๐ Troubleshooting
CSS Not Loading?
- โ Check the file path is correct
- โ Make sure the CSS file exists
- โ Clear your browser cache
- โ Check file permissions (should be readable)
- โ Use browser DevTools to verify which CSS file is loading
๐ Complete Example
Here’s a complete example to get you started:
Step 1: Add to functions.php
add_filter('botoscope_page_styles_link', function($default_css_url) {
return get_stylesheet_directory_uri() . '/css/botoscope-pages.css';
});
Step 2: Create the CSS file
Create /wp-content/themes/your-theme/css/botoscope-pages.css with your custom styles:
/* Custom Botoscope Pages Styling */
body {
margin: 0;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #ffffff;
font-family: 'Poppins', sans-serif;
}
a {
color: #ffd700;
text-decoration: none;
}
h1, h2, h3 {
color: #ffffff;
}
.botoscope-telegram-products {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 15px;
}
.botoscope-product {
background: rgba(255, 255, 255, 0.1);
border: none;
border-radius: 12px;
padding: 15px;
}
/* Add your custom styles here */
Now you can create a unique design for your Botoscope pages! ๐