WordPress Hacks for Members Only Website

By default wordrepss is blogging tool. Nevertheless, you can truly customize to make it however you want. Many of people use wordpress to create members only website. You can only always use a plugin, but if you only needed a little modification, why install a plugin when you can do it with few lines of code. Here are some simple yet effective hacks for creating a member only site.

Content for Members only Without Plugin

If there are certain content on your site you wanted to show only to the registered member, you can do so by use the following code in your theme. Whatever goes between is_user_logged_in will be seen by only members.

Show WordPress Login Form Anywhere and Customize It

If you want include wordpress login form anywhere in your theme, which is mentioned in this post you can do so by using following function:

[php]
<?php wp_login_form(); ?>
[/php]

However, it does not give you option to customize the login form, because it just directly pulls default wordpress login form. What if you want show something like this?
Here is code to do that. Paste the following code wherever you want the form to show up.

You can add a CSS div tag to style it. The advantage of using this login form you can almost create a mini dashboard for members by using get_currentuserinfo() function and show any information about the user.

Now you need to actually create the menu on wordpress backhand . The “Menus” setting should be under Appearance tab. Create a menu with the name main and visitor. On both menu add whatever you want to show. For example: if you want a page to show up only when user looged, add it in the main menu . Look at the following image.