• Resolved beatnik

    (@beatnik)


    Hello, i’m working on my website but i’d like to let the finished pages accessibles.

    I have excluded all the selected pages, but it doesn’t work for the home page.
    My home page is normally the posts page, but i’ve tried too with a static page as home page, and it’s still not working…

    Could you help please?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • George J

    (@georgejipa)

    Hello @beatnik,

    There is no built-in option to exclude the homepage because what you need is a very particular case.

    Anyway, you can try this snippet of code:

    
    /**
     * Disable maintenance mode on homepage 
     * 
     * @param boolean $is_excluded
     * @return boolean
     */
    function wpmm_disable_maintenance_on_homepage($is_excluded) {
    	if (is_home() || is_front_page()) {
    		$is_excluded = true;
    	}
    
    	return $is_excluded;
    }
    
    add_filter('wpmm_is_excluded', 'wpmm_disable_maintenance_on_homepage', 11, 1);
    

    Place the snippet at the end of the functions.php file (located inside your active theme/child-theme directory). If there is a PHP closing tag ?>, make sure you add the code before it.


    George

    • This reply was modified 6 years ago by George J.
    Thread Starter beatnik

    (@beatnik)

    It works fine, thank you ??

    i’ve come across the same issue multiple times and it’s actually not a very particular case: when developing a site for a client on a dev server you usually get to a point when you’d like to let them review the front page and not necessarily other pages.
    in another plugin this is possible by excluding the front page with a shortcode, [home] if i remember correct. maybe this solution could be implemented here as well?

    @getupworks This plugin is installed on 600k+ websites and, over the years, only a few people (<10) asked about this feature. That’s why I believe it is a very particular case.
    But the idea with the shortcode could be useful. Thanks. ??

    • This reply was modified 5 years, 10 months ago by George J.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t exclude the home page’ is closed to new replies.