Password-protected Posts lead to 404 Error

Ok, figured it out myself! I had used add_filter to customize the password form in order to add css classes. Everything in add_filter was either old or simply wrong. I found it in a tutorial, but this has been a lesson to me. Never trust code found on the web unless it from the Codex … Read more

Password Protection for posts and pages [duplicate]

I’ve used the following to protect individual pages: First add a field to the Publish Metabox: add_action( ‘post_submitbox_misc_actions’, ‘my_post_submitbox_misc_actions1’ ); function my_post_submitbox_misc_actions1(){ echo ‘<div class=”misc-pub-section my-options”> <input type=”checkbox” id=”fgpsn_protected_content” name=”fgpsn_protected_content” value=”true”‘; if ( get_post_meta(get_the_ID(), ‘fgpsn_protected_content’, true) == ‘true’ ){ echo ‘ checked’; } echo ‘> <label for=”fgpsn_protected_content”>FGPSN Content</label></div>’; } Then save the meta data – … Read more

How to set custom validation for WordPress Passwords?

By Using following hook, you can customize your login page and password validations with ajax or PHP. add_action( ‘login_form’, ‘myplugin_add_login_fields’ ); function myplugin_add_login_fields() { //Get and set any values already sent $user_extra = ( isset( $_POST[‘user_extra’] ) ) ? $_POST[‘user_extra’] : ”; ?> <p> <label for=”user_extra”><?php _e(‘Extra Field’,’mydomain’) ?><br /> <input type=”text” name=”user_extra” id=”user_extra” class=”input” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)