Created
May 30, 2018 08:08
-
-
Save AbmSourav/88b8d5cf95a068d24f305d93b5a7690f to your computer and use it in GitHub Desktop.
password form is not showing
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 | |
$alpha_title_text = 'card-title'; | |
$alpha_content_text = 'card-text'; | |
$alpha_meta_wrap = 'card-footer text-muted'; | |
if ( !is_active_sidebar( 'sidebar-1' ) ) { | |
$alpha_title_text = 'text-center'; | |
$alpha_content_text = 'text-center'; | |
$alpha_meta_wrap = 'text-center'; | |
} | |
?> | |
<p class="<?php echo $alpha_content_text ?>"> | |
<?php echo get_the_excerpt(); ?> | |
</p> |
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
/** | |
*====================================== | |
*protected post function | |
*====================================== | |
*/ | |
function alpha_the_excerpt( $excerpt ){ | |
if ( !post_password_required() ) { | |
return $excerpt; | |
}else { | |
echo get_the_password_form(); | |
} | |
} | |
add_filter( "the_excerpt", "alpha_the_excerpt" ); | |
/** | |
*====================================== | |
*'protected' title change function | |
*====================================== | |
*/ | |
function alpha_protected_title_change(){ | |
return "%s"; | |
} | |
add_action( 'protected_title_format', 'alpha_protected_title_change' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment