-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Header and Footer Scripts is a lightweight, powerful WordPress plugin that allows you to insert custom code (HTML, JavaScript, CSS) into your site's header, body, and footer areas without editing your theme files.
- Go to your WordPress Dashboard.
- Navigate to Plugins > Add New.
- Search for "Header and Footer Scripts".
- Click Install Now and then Activate.
Alternatively, you can upload the plugin folder to your /wp-content/plugins/ directory.
You can add scripts that run on every page of your website from the plugin settings.
Navigate to: Settings > Header and Footer Scripts
-
Location: Inside the
<head>tag. -
Usage: Best for verification tags (Google Search Console), CSS styles (
<style>), and scripts that must load early (e.g., critical analytics). -
Hook:
wp_head
-
Location: Immediately after the opening
<body>tag. - Usage: Required for certain tracking pixels like Google Tag Manager (noscript part) or Facebook Pixel.
-
Hook:
wp_body_open -
Note: Your theme must support the
wp_body_open()function (standard in most modern themes since WP 5.2).
-
Location: Just before the closing
</body>tag. - Usage: The best place for most JavaScript (Google Analytics, Chat widgets, etc.) to prevent slowing down your page load speed.
-
Hook:
wp_footer
The settings page includes a code editor with syntax highlighting, line numbers, and error checking to help you write valid code.
You can inject a specific script into the Header of a single Post or Page.
- Edit any Post or Page.
- Scroll down to the "Insert Script to " meta box.
- Paste your specific CSS or JS code.
- Update/Publish the post.
Currently, per-post scripts are only supported for the Header section.
Security is a priority. Loading raw scripts allows executing arbitrary code (XSS), so access is restricted by default.
-
Default: Only Administrators (or users with the
unfiltered_htmlcapability). - Granular Control: You can grant access to trusted Authors and Contributors.
- Go to
Settings > Header and Footer Scripts. - Look for the "Who can insert scripts?" section.
- Check "Allow Authors" or "Allow Contributors".
- Save settings.
Warning
Security Notice: Granting this permission adds the unfiltered_html capability to that role. This allows those users to post raw HTML/JS anywhere on the site (not just in this plugin). Only enable this for trusted users.
- Clear Cache: If you use a caching plugin (WP Rocket, W3 Total Cache), clear the cache after saving scripts.
-
Check Theme Support:
- For Header scripts, your theme
header.phpmust contain<?php wp_head(); ?>. - For Body scripts, your theme
header.phpmust contain<?php wp_body_open(); ?>just after the<body>tag. - For Footer scripts, your theme
footer.phpmust contain<?php wp_footer(); ?>.
- For Header scripts, your theme
-
Syntax Errors: Check if your JS code has errors. The built-in editor usually highlights these. Ensure you wrap JS in
<script>tags and CSS in<style>tags.
You do not have permission to edit scripts. Ensure you are an Administrator or have been granted access via the settings.
jQuery(document).ready(function($) {
// Проверяем, что это мобильное устройство (ширина экрана)
if ($(window).width() <= 768) {
var descriptionTabTitle =
// Изначально скрываем панель описания, чтобы избежать "мелькания"
descriptionPanel.removeClass('is-open').css({'max-height': '0', 'padding-top': '0', 'padding-bottom': '0', 'opacity': '0', 'visibility': 'hidden'});
descriptionTabTitle.removeClass('active');
// Обработчик клика по заголовку "Описание"
descriptionTabTitle.on('click', function(e) {
e.preventDefault(); // Предотвращаем переход по ссылке
e.stopPropagation(); // Предотвращаем всплытие события, если есть другие обработчики
// Переключаем класс 'active' для заголовка
$(this).toggleClass('active');
// Переключаем класс 'is-open' для панели описания
descriptionPanel.toggleClass('is-open');
// Дополнительная логика для анимации, если необходимо (уже есть в CSS)
});
}
});
Next Generation AI Sandbox IDE
Sandbox CodeX là một AI Sandbox IDE thế hệ mới giúp lập trình viên xây dựng, chạy thử và triển khai ứng dụng ngay trên trình duyệt trong môi trường cô lập (Sandbox).
- AI Agent
- Secure Sandbox
- Multi AI Models
- Browser IDE
- Docker Workspace
- Live Preview
- Terminal
- Git Integration
- API Integration
- OpenAI
- Claude
- Gemini
- Grok
- DeepSeek
- Qwen
- Mistral
- Llama
- Code Editor
- AI Assistant
- AI Agent
- Browser Preview
- Linux Terminal
- Docker Sandbox
- File Manager
- Git
- Extension System
- Plugin Marketplace
🚧 Đang phát triển
Version 0.1.0 Alpha
Repository này sẽ là nền tảng để phát triển Sandbox CodeX từ phiên bản Alpha đến v1.0, bao gồm:
- Landing Page hiện đại
- AI Agent
- IDE trên trình duyệt
- Sandbox Runtime
- Docker Container
- Terminal
- File Manager
- GitHub Integration
- Plugin System
- Marketplace
- Tài liệu đầy đủ
- Triển khai lên môi trường production
- Giai đoạn 1: Hoàn thiện tài liệu và landing page.
- Giai đoạn 2: Xây dựng giao diện IDE.
- Giai đoạn 3: Thêm AI Agent và Sandbox.
- Giai đoạn 4: Hoàn thiện backend, xác thực và triển khai bản phát hành đầu tiên (v1.0.0).