Title: Call v_forcelogin() from theme header.php?
Last modified: August 30, 2016

---

# Call v_forcelogin() from theme header.php?

 *  Resolved [todditron](https://wordpress.org/support/users/todditron/)
 * (@todditron)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/call-v_forcelogin-from-theme-headerphp/)
 * Since it looks like some people were having problems with wp-cron, xmlrpc and
   other native WP functions, can you think of any reason why you couldn’t just 
   call v_forcelogin() fist thing in header.php? (not initialize it with an action)
 * It seems to work perfectly for me, and it might solve the problems of having 
   to hunt down and whitelist all the misc. system and plugin files.
 * I just want to make sure there wasn’t a downside I was missing here.
 * [https://wordpress.org/plugins/wp-force-login/](https://wordpress.org/plugins/wp-force-login/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Kevin Vess](https://wordpress.org/support/users/kevinvess/)
 * (@kevinvess)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/call-v_forcelogin-from-theme-headerphp/#post-6465227)
 * I wanted to let people block access to everything and whitelist only the parts
   of the site they need to.
 * Also, if I were to run the function on the `wp_head` hook instead, I would have
   to rely on everyone’s theme to be built correctly with the `wp_head()` function
   included in their header.php file.
 * Good suggestion though, thanks!

Viewing 1 replies (of 1 total)

The topic ‘Call v_forcelogin() from theme header.php?’ is closed to new replies.

 * ![](https://ps.w.org/wp-force-login/assets/icon.svg?rev=1904031)
 * [Force Login](https://wordpress.org/plugins/wp-force-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-force-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-force-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-force-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-force-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-force-login/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kevin Vess](https://wordpress.org/support/users/kevinvess/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/call-v_forcelogin-from-theme-headerphp/#post-6465227)
 * Status: resolved