Created
December 22, 2017 07:34
-
-
Save torounit/754fa256212021edf36cb7192d3ae38f to your computer and use it in GitHub Desktop.
WordPressでTOPページのみ、公開したい場合のハック。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'option_blog_public', function( $value ) { | |
if ( is_front_page() ) { | |
return 1; | |
} | |
return $value; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment