There is little or no coding required. What you need here is a custom theme and some plugins. There are currently two themes that can instantly turn your blog into a status update system: Prologue and P2.
Both themes require little or no configuration. As soon as you activate the theme, your blog frontend instantly become a Twitter clone.
Prologue Theme
P2 Theme
Prologue theme is just a basic Twitter-like theme with no configuration option. On the other hand, P2 theme is more comprehensive and allows you to switch between "status update", "blog post", "Quote" and "Link".
With the P2 theme, you can also configure who can post update, the background image/color, show/hide sidebar etc.
Adding a login form to the sidebar
Instead of getting your users to go to the wp-login page, it will be great if you can add a login form to your sidebar and let your users login from the front page.
What you need here is the sidebar-login plugin. Install the plugin and add the widget to your sidebar.
At the sidebar-login option page, remember to set the "Login Redirect Url" to your Home page.
Show status update only for logged in users
If you want to use this as a in-house private Twitter system, you won't want the public to see your update. The best way is to show the update only for logged in users.
Open the
index.php
file in your P2 theme folder.Scroll down until you see the code:
[php]</h2>
<ul id="postlist">
<?php if ( have_posts() ) : ?>[/php]
Insert in the following code after
</h2>
[php]<?php if(!is_user_logged_in()): ?>
<p>You need to log in to view the status update!</p>
<?php else : ?>[/php]
So now you should have:
[php]</h2>
<?php if(!is_user_logged_in()): ?>
<p>You need to log in to view the status update!</p>
<?php else : ?>
<ul id="postlist">
<?php if ( have_posts() ) : ?>[/php]
and don't forget to close the loop. Insert
<?php endif; ?>
before the </div><!-- main-->
.[php] <?php endif; ?>
</div> <!-- main -->[/php]
Repeat the same for the
single.php
file as well. You should see the following for non-logged in users.Alternatively, you can also use the Private-WP plugin to force your users to login before they can read your status update. This is an easier implementation, but a less elegant solution.
This tutorial only touches the tip of the iceberg. If you have added your own modifications/enhancement, do let us know in the comments.
No comments:
Post a Comment