Skip to content

Tom Moitié

  • Home
  • About me
  • Command line fun
  • Privacy Policy – OWIK
  • OWIK
  • Twitter
  • Facebook
  • Google Plus

Monthly Archives: April 2014

Simple redirect unauthenticaed WordPress users

Put this at the top of your template you want to restrict: <?php /** * If user’s not logged in, send to login page. */ if (!current_user_can(‘read’)) { header(‘Location: ‘ . wp_login_url(get_permalink())); exit; }

Posted byTom Moitié3rd April, 201424th August, 2014Posted inCode, WordpressTags: php, wordpressLeave a comment on Simple redirect unauthenticaed WordPress users

Categories

  • Code
  • Wordpress

Archives

  • August 2014
  • April 2014
  • October 2013

Tags

bootstrap composer featured php symfony2 wordpress
Tom Moitié, Proudly powered by WordPress.