Conditional statement for password protected posts
-
In a nutshell, I’m wondering if there’s a conditional statement for when a post is password protected. Something like: is_post_logged_in() or similar.
Here’s why:
I’ve built our company’s website, but I have an estimator that we don’t want to be public for our website. Since it is a php and javascript based estimator, I needed to use the header and the body to make it run, so I had to create different templates for both the header and the body pages. Because of this and other reasons, I didn’t want to put the body in the post area of that page in wordpress, so I basically have a blank post and all the content lives inside the actual template file.
Right now I’ve got it using the must be logged in to view the page system, but we definitely don’t want to give our clients access to our entire backend.
So it seems it would be easier if I could just wrap all that code in a conditional statement for that password protected page. Did that all make sense?
- The topic ‘Conditional statement for password protected posts’ is closed to new replies.