• Wordpress
  • Redirect non logged in user

    There are many plugins which can be used for redirection. We can use small code on our theme file rather using plugins. To redirect non logged in member to custom login page or to specific page or to normal login page, we can put the following code on our functions.php inside active theme: For is_user_logged_in, […]

  • Wordpress
  • How to show blank search on wordpress

    By default, wordpress do not search for blank. It redirects to the home page for blank search. To prevent this we can use pre_get_posts hook. We can use pre_get_posts action to manipulate the query variables for specific pages. We can modify $wp_query object before any results are returned. In this example, we are using pre_get_posts […]