Created
September 17, 2011 13:55
-
-
Save miya0001/1223958 to your computer and use it in GitHub Desktop.
WordPressで記事の一部に認証をかける
This file contains 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 | |
function login_read_more($atts, $content = null) { | |
if (is_user_logged_in() && !is_null( $content ) && !is_feed()) { | |
return $content; | |
} else { | |
return '続きを読むにはログインしてね'; | |
} | |
} | |
add_shortcode('auth', 'login_read_more'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment