I added a post and made it password protected. The post does not show up in a category list I placed on the Courses page, nor does it show up in the search unless you go directly to the page and then login. It then starts appearing on the Courses page. Any idea how to have the link to the post visible? The page they should show up are on: http://www.andrewruis.com/course/. If you search for “asb 129” nothing shows up in the search.
Leave a Reply
You must be logged in to post a comment.
If a post password is applied and the user is not logged in, the post will not show up in search results. This is the expected behavior of
WP_Query
:See the bottom part?
if ( !empty($search) ) {
checks to see if we’re queuing up a search and, if the user isn’t logged in, explicitly searches only for posts that have no password set.If you need to password protect content anyway, I recommend one of two routes:
1 Require an account
You can easily require users to log in before viewing content – either password-protected or private posts. This gives you complete control over who can see content.
2 Build your own widget
You’re trying to include a link to this password-protected content in a dynamic widget. Either use a static list instead (hand-edit the text to include the link) or build your own dynamic widget that does include password-protected posts.