This topic has 8 replies, 3 voices, and was last updated 8 years by Weird Mike.

  • Author

    Tagged: 

  • #68902
     Weird Mike
    Participant

    How to I go about setting a my Maintenance page to be a custom page?

    I’ve checked this site, and the documentation and found nothing. Please help.

    #68936
     sharmstr
    Moderator

    You can override the function that builds the page. Put this in your child theme functions.php file and edit as neccesary.

    COPY CODE
    
    function kleo_maintenance_mode() {
    
    		$logo_path = apply_filters('kleo_logo', sq_option_url('logo'));
    		$logo_img = '<img src="'. $logo_path .'" alt="maintenance" />';
    		
    		if (sq_option('maintenance_mode', 0) == 1) {
    
    			/* Theme My Login compatibility */
    			if ( class_exists( 'Theme_My_Login' ) && Theme_My_Login::is_tml_page( 'login' ) ) {
    				return;
    			}
    
    			if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
    				wp_die(
    						$logo_img 
    							. '<div style="text-align:center">'
    							. sq_option('maintenance_msg', '')
    							. '</div>',
    						get_bloginfo( 'name' )
    					);
    			}
    		}
    	}
    

    If that’s beyond your capabilities, then I suggest using a plugin. I use this one https://wordpress.org/plugins/coming-soon/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #69039
     Weird Mike
    Participant

    That did not work. You guys have a demo page in which it shows a page with the use of an actual page and not a styled maintenance section. Also, why is there a reference to a Theme My Login when it’s not the login I’m trying to change?

    I need this.

    #69064
     sharmstr
    Moderator

    What demo page?

    The function is adding compatibility as it states. If you look further on in the function, it says “If the user isnt admin and they are not logged in, then die and show the logo and message.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #69161
     Weird Mike
    Participant

    Doesn’t work. I tried it on a different browser that in no way could I be logged in as admin.

    You could just admit that it’s not possible to use a page as the Maintenance page.

    This demo page.
    http://seventhqueen.com/themes/kleo/get-connected-vertical-form/

    #69163
     sharmstr
    Moderator

    I think I was clear that there is no maintenance “page” and that’s its built using a single function which I provided.

    There’s nothing stopping you from using VC shortcodes copied from whatever page you want in the function.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #69168
     sharmstr
    Moderator

    About 1.5 years ago I used a plugin that allow me to redirect everyone except admins to a page. For the life of me I cant remember the name of it. If I come across it I’ll let you know.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #69241
     Abe
    Keymaster

    Hello, you can try with this code and modify the redirect link

    COPY CODE
    
    add_action( 'template_redirect', 'kleo_redirect_to_specific_page' );
    
    function kleo_redirect_to_specific_page() {
    
    if ( ! is_user_logged_in() && ! is_admin() ) {
    
      wp_redirect( 'http://www.example.com/your-page/', 301 ); 
      exit;
        }
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #69540
     Weird Mike
    Participant

    Thank you everyone for your help and even though nothing has worked so far, I’m just going to stick with the default maintenance settings for the time being and just hope that in the future having more maintenance options in the admin panel will come true.

    This is by far one of my most prized themes I’ve ever used (more so than X).

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?