Showing posts with label themes. Show all posts
Showing posts with label themes. Show all posts

Thursday, December 23, 2010

Turn Your WordPress Into A Private Twitter-like System

inhouse-twitter-mainWordPress is best known as a blogging platform, but it can be a versatile piece of software as well, allowing you to turn it to almost anything you want. Here is how you can turn a WordPress installation into a in-house private Twitter-like microblogging system.

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.

WordPress Prologue Theme
Prologue Theme

WordPress P2-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.

inhouse-twitter-p2-options

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.

inhouse-twitter-sidebar-login

At the sidebar-login option page, remember to set the "Login Redirect Url" to your Home page.

inhouse-twitter-login-options

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.

inhouse-twitter-not-logged-in

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.

Thursday, December 2, 2010

How to Add Custom Navigation Menus to Your Themes

menus-compassWordPress 3.0 comes with support for custom navigation menu. The new feature is a good way for you to add navigation menu to your theme with little configuration. Best of all, it allows you to administer the menus from your dashboard. No longer do you need to tamper with the code to add/remove items from the menus.

Now, unless you are using an updated theme, chances are, your old theme does not support this new custom navigation menu feature. Here is how you can modify your current theme to support the menus feature.

Wednesday, December 1, 2010

Dropbox-CDN Uses Your Dropbox Account As Free CDN

dropbox-cdnI am sure you have heard of Dropbox - the web storage service that allows you to access your files from almost everywhere. If you are a WordPress user as well as a Dropbox user, you can now host (some of) your theme files in Dropbox and save some bandwidth.

A new plugin known as Dropbox-CDN helps you automate the process. All you need to do is go to your Dropbox's Public folder, create several level of folders with the same folder structures as your WordPress server (for example: /wp-content/themes/your-theme-folder/) and place all your js, css and image files into it. Copy and paste your Dropbox public link to the Dropbox-CDN options page and it will do the rest for you.

Note: This plugin only supports themes who use the filters 'template_directory', 'template_directory_uri', 'stylesheet_directory', and 'stylesheet_directory_uri' to determine the paths to the theme's template and stylesheet files.

Monday, November 29, 2010

How to Test Drive New Plugins And Themes Without Making Them Live On Your Site

testdrive-mainApart from being a user-friendly CMS, what makes WordPress really great is the support for plugins and themes. With a huge library of plugins and themes, you can instantly add new features and new skins to your blog without any coding on your part.

However, if you have been blogging long enough, you will know that sometime a badly coded plugin can break the site. Worst still, it can even cause the site to crash. This goes the same for a new theme. Without any tweaking and configuration, 9 out of 10 times the theme won't look great on your site. For such cases, it is wise to test them out before making them live.