Is there a way to style password protected posts in WordPress? Plus I can only seem to protect the and not any custom fields outside of this.
Edit â Trying to avoid using a plugin if possible
Is there a way to style password protected posts in WordPress? Plus I can only seem to protect the and not any custom fields outside of this.
Edit â Trying to avoid using a plugin if possible
You must be logged in to post a comment.
I assume you mean styling the password protected posts on the front-end.
a) CSS:
If your theme is using the
post_class()
function, like:then it will generate:
for the password protected posts.
So you can simply target these posts with:
in your stylesheet.
b) Form:
i) If you want to add text to your password form, you can use the following:
ii) If you want to modify the HTML form directly, you can override it with:
where this is based on the example from the Codex. It uses the same form as the default one.
c) Title:
To change the default Protected: title prefix, you can use:
Hopefully this will help you to style your protected posts.
You can use Protected Post Personalizer plugin for doing the trick https://wordpress.org/plugins/protected-post-personalizer/