Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
password form is not showing
<?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>
/**
*======================================
*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
You can’t perform that action at this time.