• Resolved dntel

    (@dntel)


    I’ve created a custom maintenance page and added a widget area in it. I’ve activated the maintenance mode of WordPress trough the functions.php. Currently the widget seems to be loaded correctly however no ‘succeed’ or ‘error’ message is showing upon entering an e-mail address. How can i use this plugin with my maintenance page?

    Please ignore the SSL warning. I’m working on it.

    • This topic was modified 4 years, 1 month ago by dntel.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support dimned

    (@dimned)

    Hi @dntel,
    Thanks for the update. Let us know if you need further assistance.

    Thread Starter dntel

    (@dntel)

    Which update?

    Plugin Support dimned

    (@dimned)

    Hi @dntel,
    I’m sorry I thought this was an update that you have identified the reason for the issue ??

    Please ignore the SSL warning. I’m working on it.

    Could you specify the way you have embedded the subscription form to the maintenance page?

    Thread Starter dntel

    (@dntel)

    Hi Dmytro,

    No problem! I’ve created my own maintenance plugin and registered a widget area. With the following code:

    add_action( 'wp_loaded', function() 
    {
        global $pagenow;
    
        // - - - - - - - - - - - - - - - - - - - - - - 
        // Turn on/off you Maintenance Mode (true/false)
        define('IN_MAINTENANCE', true);
        // - - - - - - - - - - - - - - - - - - - - - - 
    
        if(
            defined( 'IN_MAINTENANCE' )
            && IN_MAINTENANCE
            && $pagenow !== 'wp-login.php'
            && ! is_user_logged_in()
        ) {
            header('HTTP/1.1 503 Service Unavailable');
            header( 'Content-Type: text/html; charset=utf-8' );
            if ( file_exists( WP_CONTENT_DIR . '/plugins/maintenance_mode/index.php' ) ) {
                require_once( WP_CONTENT_DIR . '/plugins/maintenance_mode/index.php' );
            }
            die();
        }
    });
    
    // WIDGET AREA
    function maintenance_widget_area() {
        register_sidebar(
            array(
                'id' => 'maintenance-widget',
                'name' => esc_html__( 'Maintenance', 'theme-domain' ),
                'before_widget' => '<div id="%1$s" class="widget %2$s">',
                'after_widget' => '</div>',
                'before_title' => '<div class="widget-title-holder"><h3 class="widget-title">',
                'after_title' => '</h3></div>'
            )
        );
    }
    
    add_action( 'widgets_init', 'maintenance_widget_area' );

    In my maintenance template (index.php) I’ve used the widget hook. It’s visible in the wordpress dasboard under the widget area.

    <div id="widget"><?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("maintenance-widget") ) : ?>
    <?php endif;?></div>
    • This reply was modified 4 years, 1 month ago by dntel.
    Plugin Support dimned

    (@dimned)

    Hi @dntel,
    It looks like you have added the form using a shortcode that was pasted to Text Widget. Could oyu try to add ‘Another Mailchimp widget’ instea of Text widget and shortcode? There is a special widget to add a form to widget area.

    Thread Starter dntel

    (@dntel)

    Hi @dimned,

    I’ve changed it, however I get the same result. Does the plugin require the wp header or so? It looks like it doesn’t show the p class=”notification error” on the maintenance page.

    The shortcode and the ‘Another Mailchimp widget’ appears to be working when placed in theme itself.

    • This reply was modified 4 years ago by dntel.
    Plugin Support dimned

    (@dimned)

    Hi @dntel,
    Yes, Another MailChimp widget requires wp_head in the template file of the page since it loads styles and scripts.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No error/succeed message’ is closed to new replies.