eUttaranchal

Re-Writing the Web

Archive for the ‘Wordpress’ Category

This is annoying if Wordpress asks for FTP username/password everytime you try to install or update plugin from admin panel.

Here is the quick hack to this.

1. Open the wp-config.php file (this will be located in the root of your wordpress installation)

2. Add the following line of code just after define(‘NONCE_KEY’, ‘put your unique phrase here’);

/* FTP login settings */
define('FTP_HOST', 'localhost');
define('FTP_USER', 'yourftpusername');
define('FTP_PASS', 'yourftppassword');

Note: Be sure to replace yourftpusername to your website’s FTP user name and yourftppassword to your website’s FTP password.

3. Upload the updated file. It works!

Custom User Registration Plugins for Wordpress

Posted by Bhupendra On February - 6 - 2010

I have been trying hard to find an easy way out to add custom registration field to the Wordpress default registration form.

I recommend the following wordpress plugin to customize, add custom fields, manage user registration, moderate user registration and edit the default email sent to the new registered users.

1. Cimy User Extra Fields
This plugin gives you the power to add custom fields to your wordpress registration form. You also get the choice to add different data types like text box, select box, radio button, text area etc with quite a few validation options.

Cimy User Extra Fields also unleashes the hidden registration fields that come with wordpress default registration form.

Download

2. Approve New Users

You can moderate New User Registration with this plugin. It adds another option “Approve New Users” under “Users” settings menu.

Download

3. New User Email Setup

New User Email Setup plugin lets you customize the default email sent to the new users upon registration. You can customize the email text, sender name, sender email and subject too. What’s more, you can even send HTML email!

Download

Thumbnail for Excerpts : Hack for Wordpress 2.8+

Posted by Bhupendra On October - 28 - 2009

I was stucked with Thumbnail for Excerpt plugin behaving unexpectedly with Wordpress 2.8.2

Thank you Cory for sharing the plugin hack to make it work.

Bug: The Thumbnail for Excerpt plugin showing the same thumbnail image with all the posts (with Wordpress 2.8.2+)

Solution: Edit the plugin in plugin editor. Replace lines 28 & 29 with this:

global $wp_query, $wpdb, $post;
$id = $post->ID;

The actual lines of code look like this

global $wp_query, $wpdb;
$id = $wp_query->post->ID;

Replace these lines with

global $wp_query, $wpdb, $post;
$id = $post->ID;

Yamidoo Theme Featured Content Image Slider Fix

Posted by Bhupendra On June - 26 - 2009

Yamidoo Magazine Theme is one of the popular wordpress theme to give your blog a professional and fresh look. However, one of the common problem encoutered by Yamidoo theme users is that the Featured Content Gallery doesn’t slide automatically.

A simple tweak below can fix this bug and make the Featured Content Gallery on the Yamidoo Theme sliding

Open the Main Index File: /wp-content/themes/yamidoo/index.php
(assuming that you have uploaded the theme under yamidoo folder)

Search for these 2 lines (somewhere near line number 36 on index.php file):



Right BEFORE these two lines, add this line:


If you want to control the autoslider, in your header.php file, there is one such line:
autorotateconfig: [1000, 0]

The first value (default: 1000) controls the speed (in miliseconds). 1000 = 1 second.
The second value (default: 0) controls how many cycles the slider should have. If you leave it 0 – it will autoslide over and over again, an infinite amount of times.

Custom Read More link for Wordpress

Posted by Bhupendra On March - 30 - 2009

The default “read more” link for the wordpress that comes with the_excerpt function shows [...] after every post listing WITHOUT a hyperlink to the post.  To make the_excerpt function more useful, you can add a custom read more link which will replace [...]

It require a small tweak in wp_trim_excerpt function.

Open your wordpress file /wp-includes/formatting.php

Go to line number 1482. The wp_trim_excerpt function would read like this

BEFORE

function wp_trim_excerpt($text) {
if ( '' == $text ) {
$text = get_the_content('');

$text = strip_shortcodes( $text );

$text = apply_filters(‘the_content’, $text);
$text = str_replace(‘]]>’, ‘]]>’, $text);
$text = strip_tags($text);
$excerpt_length = apply_filters(‘excerpt_length’, 55);
$words = explode(‘ ‘, $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, [...]);
$text = implode(‘ ‘, $words);
}
}
return $text;
}

AFTER (refer to the modified text in red)

function wp_trim_excerpt($text) {
if ( ” == $text ) {
$text = get_the_content(”);
$read_link=’<a href=”‘. get_permalink().’”>’;
$end_read_link=”</a>”;

$text = strip_shortcodes( $text );

$text = apply_filters(‘the_content’, $text);
$text = str_replace(‘]]>’, ‘]]&gt;’, $text);
$text = strip_tags($text);
$excerpt_length = apply_filters(‘excerpt_length’, 55);
$words = explode(‘ ‘, $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, ‘…’.$read_link.’[read more]‘.$end_read_link);
$text = implode(‘ ‘, $words);
}
}
return $text;
}

Cheers…you are done!

Best Wordpress Plugins

Posted by Bhupendra On March - 19 - 2009

Wordpress itself is a wonderful script for the bloggers and webmasters. And the plugins make it more delicious.

The list of great Wordpress Plugins is countless but still I have tried to collect a list of “Some” of the BEST Wordpress Plugins I have used so far

1. WP-TREE
This Widget-enabled plugin is highly configurable and can show the Categories, Links, Pages in a Tree menu structure.

Download Link: http://wordpress.org/extend/plugins/wp-dtree-30/

2. Featured Content Gallery
This plugin can fetch images from your specified post categories and display them nicely as an image gallery with rollover text.
Demo: http://www.featuredcontentgallery.com
Download Link: http://wordpress.org/extend/plugins/featured-content-gallery/

Highlight Author Comment Wordpress 2.7

Posted by Bhupendra On February - 5 - 2009

This is a simple way to highlight Author’s Comment in Wordpress 2.7

Create a new style li.bypostauthor and add your styling.


li.bypostauthor {
/* CSS styles for author comments */
}

li.byuser {
/* CSS styles for registered users comments */
}