• Resolved davidblood

    (@davidblood)


    Hi,

    Is there an option to inject custom inline JS code with this maintenance plugin? Can either be inline code <script> block or via a .js file doesn’t matter which just wondering if its possible?

Viewing 1 replies (of 1 total)
  • Plugin Support rodicaelena

    (@rodicaelena)

    Hi there,

    Thanks for reaching out!

    LightStart does not currently have a built-in setting or textarea to inject custom JS (inline or file-based) directly through the plugin dashboard.

    However, since you need this functionality, you can still achieve it using the LightStart Action Hooks.

    LightStart uses its own hooks to render the maintenance page. You can add this snippet to your theme’s functions.php file (or a functionality plugin like Code Snippets) to force your code into the maintenance mode head or footer:

    For inline code:

    add_action('wpmm_head', function() {
        ?>
        <script>
            // Your custom JS here
            console.log('Maintenance mode script active');
        </script>
        <?php
    });
    

    For a .js file:

    add_action('wpmm_head', function() {
        echo '<script src="https://yourdomain.com/path/to/script.js"></script>';
    });
    

    Hope this helps.

    Kind regards!

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.