WordPress.org

Ready to get started?Download WordPress

Forums

Password-protect form in nav-dropdown/modal? (2 posts)

  1. Justin Picard
    Member
    Posted 1 year ago #

    I have password-protected some pages. I would like the password-form (that normally opens in a new page) to appear in a dropdown when hovering over the page-link in the main navigation. Is this possible? And how? If not, the second option is to have it in a modal-window/fancybox (or any other modal).

  2. Jerry
    Member
    Posted 1 year ago #

    You would need to check if the post is password protected in the loop via the post global (example).

    Edit: You can use the post_password_required() function instead.

    If it is, you would use your own function to pop out the say, thickbox or so with a password form. For the form you can use the get_the_password_form()

    More info on functions related can be found here.

    Tho, I do believe you gave me a plugin idea XD

Topic Closed

This topic has been closed to new replies.

About this Topic