Okay so I made it work with include this is my updated code:
<?php /* Template Name: pw-protect */ ?>
<?php
global $post;
get_header();
if ( ! post_password_required( $post ) ) {
// Your custom code should here
include('indiPartnership.php');
}else{
// we will show password form here
echo get_the_password_form();
}
?>
Related Posts:
- How to change user password with wp-cli?
- wordpress redirect after password reset
- Loosen/disable password policy
- Password Protect Custom Page
- Password protecting a page
- How to save Admin FTP password
- If I change the salt keys in my wp-config will all passwords break?
- Bypass password protected posts via GET variable
- How to add Wp_error using lostpassword_post hook when validating custom field?
- Why do generated passwords start/end with spaces?
- Duplicate hash method for password in .NET
- Hide password protected posts
- Safe to store SMTP password in wp-config.php?
- Access code/password only restricts page access, no user registration..?
- PasswordHash not found in namespace
- Force all users in MU to change their passwords
- How to shorten length of auto generated password sent during registration?
- Forgot password not working
- wp_hash_password unexpected behaviour
- Password reset message – change the network_home_url( ‘/’ )
- Lost password link is redirecting to /shop/my-account/lost-password/
- WordPress: force users to change password on first login
- Can’t login to wordpress despite changing password to something known directly in MySQL or using “Password Reset by Email” feature
- Lost password link redirects to my-account/lost-password/,how to fix it back to default lost password
- Set content type to HTML for lost password email only
- Where is the reset password key stored/generated?
- Password protecting template, secured content not showing if even password is right
- How validate usernames/passwords against WP’s database?
- Make post password required to publish
- Add error message on password protected pages
- User password field is empty
- Get plain password on register
- post_password_required() not recognizing cookie set with correct password
- How Authentication in wordpress works? wp_authenticate_username_password()
- Password protect the site (without htaccess or membership)
- Password Protected page not asking for a password
- I would like to password protect my entire WordPress site (ip validated), except for one page
- Custom login form for front-end user as well as admin
- how to remotely check a username / password from within a plugin
- Password changed [duplicate]
- How to get user password before being encrypted outside the wordpress core once add a new user from dashboard?
- wp_hash_password create a different hash everytime
- Custom password form allows unlock two posts with the same password
- How to change password
- password recovery key is invalid on custom reset
- Like to store multiple passwords in db table wp_posts field post_password?
- Password Protected Post is invisible until you login
- Send password to user instead of reset password link
- Protect Passwords in wp_users with stronger protection than MD5
- How secure is a wp-config file?
- How to check user’s password?
- How to Remove or Deactivate “Application Passwords” in WordPress
- What’s the algorithm to verify user password?
- How to change “Reset Password” text on submit button
- Customize retrieve password message
- resend user login & password with custom button
- WordPress admin creation through phpmyadmin not working
- How to show my wordpress admin username & password?
- Why does hashing a password result in different hashes, each time?
- Can’t alter $lostpassword_url
- How to initiate password reset flow by code
- How to read third party cookie to access password protected pages
- Ask logged in user to re-enter password to access page “x”
- Password protected sites
- 2 accounts under same email preventing me from loging in
- How would I create a Password Protected Page with Content on it?
- Site only for users authenticated by different PHP application
- wordpress custom password change problem
- Allow all reset password links within the past 24 hours to be valid and accepted
- WooCommerce Lost Password reset goes to 404
- Set id and password for each post
- I have to reset the admin password each time
- I need help with wp_lostpassword, wp_register and wp_login_form
- Create Member who can’t be changed
- I can’t recover my password
- $expiration_duration = apply_filters( ‘password_reset_expiration’, DAY_IN_SECONDS );
- Frontend custom forgot password page
- Entering a WP site with a SMS code
- Password Protect content() on homepage
- Function called by password_reset action passed only 1 argument instead of 2 in PHP 7.2.11
- How to set password from frontend if have activation key and user login in url in wordpress?
- Allow users from my ASP.Net MVC site to access my private WordPress site
- Multiple pages protected by different passwords. Possible to track multiple passwords at a time?
- WordPress Protected Page Redirects to PDF
- Bypass a WordPress Password Protected Post or Page via a URL
- Custom page password recovery
- Can I use core passworded page/post functions outside of wp-login.php?
- Is it possible to display newly generated password after wp_generate_password()?
- How do I password protect a page of posts on WordPress?
- forgot password
- WordPress not taking password and username
- mysql update user’s password and activation key
- Is it possible to have users register without having a password?
- Password Protection for posts and pages [duplicate]
- How WordPress hashes passwords
- WordPress reset password button not working
- Override the default password length when creating or updating a user profile
- ‘random_password’ filters not taking effect
- FTP Password (not private key-value pair) for EC2 Instance
- My WordPress password for admin account is changing automatically