wordpress and wordpress mu is merging in april 2010

This is really great news we got from wordpress. After wordpress 3.0 release wordpress and wordpress MU is merging.  This is really great news to multiple blogger community.

After April 2010 we can able to handle multiple blogs though only one wordpress instance. As per Automatic this is the biggest release ever of wordpress. Because more than 100 developers are working for wordpress 3.0 release. As Matt is celebrating the 6th anniversary of the open source blogging software.

People are always thinking about free wordpress plugins because there are thousands of plugin are available for singular wordpress. WordPressMu stands for his own advantages.

I am really fan of wordpressMU always because I started my carrier with wordpressMU. I written my first wordpress plugin for wordpressMU. Many big magazine and business companies always prefer to to use the WordPressMU.

wordpress 3.0

Automatic is targeting to launch the wordpress 3.0 in April. So many wordpress developers are contributing to wordpress 3.0.

wordpress 3.0

wordpress 3.0
wordpress 3.0

About wordpress 3.0, we are all very excited and want to know ab0out wordpress 3.0, what is coming in 3.0

Here is list what is coming in wordpress 3.0

  • If Pretty Permalinks on, enforce /search/ URL
  • Remove some variables unecessarily wrapped in quotes
  • Convert strpos/strtolower to stripos
  • Trashed pages can still be opened when logged in
  • Install.php confusing line
  • phpdoc and cleanup of deprecated $table globals
  • Comment Misspellings
  • Add FunnyOrDie.com oEmbed support
  • Edit media form has get variables in action
  • Better name for “themes_loaded”
  • wp_specialchars() is deprecated. use esc_html()
  • Add the Generator element in feeds through the {rss2|atom|rdf|rss}_head hook
  • redundancy in nicknames dropdown
  • XHTML well-formedness
  • Single function for intermediate image sizes
  • Ellipses for descriptions of actions in progress
  • Random order of Category List in Add/Edit Link
  • Navigation For Already Installed Page
  • Blank submenu entry created when register_taxonomy arg “label” set to false.
  • next_post_link() and previous_post_link() should be allowed in the loop, even if is_single()
  • Admin include file – post.php – doc update and cleanup
  • wp_widget_rss_output with show_summaryshows two ellipses
  • /wp-admin/categories.php needs a edit_category_form_fields hook.
  • Better handling of posts without titles in Bulk Edit
  • Remove unnecessary $posts_per_page global in admin.php
  • Use new $required_mysql_version global in wp-db.php
  • Cleanup in WP native CSS files
  • Update jQuery UI to newest version
  • Remove unused .fade class for admin message bars
  • Show action links after core update
  • Use new $required_php_version global
  • wp-settings.php is missing i18n
  • Wrong preview link for draft/preview on admin post index
  • body_class() creates an invalid class when page template contains a . [full stop]
  • in ms-edit.php, a query could be removed by using the object cache
  • define(‘WP_DEBUG’, false) generates a silent E_NOTICE
  • general-template.php echo/return fixes
  • MS-functions.php whitespaces and functions cleanup
  • Null value passed to apply_filters when get_post_class() is called without parameters.
  • Typo on wp-db.php: @war instead of @var
  • plugins_url() does not correctly detect mu-plugins on Windows
  • Hide bulk actions, item filters, and subpages when no items
  • Missing table cell close tag in ms.php
  • Top corners not rounded on Dashboard Menu
  • Should include default favicon
  • Deprecate get_alloptions()
  • Internally, pass arrays instead of query strings to functions that use wp_parse_args()
  • get_temp_dir() should be more flexible
  • Prepare queries using INSERT/UPDATE should use wpdb::insert() or wpdb::update()
  • New hook to replace the admin color scheme chooser in user-edit.php
  • Thickbox Should Not Close When Clicked Outside Of Window (while uploading)
  • Add more document file type extensions
  • _deprecated() version numbers.
  • Better location for the Categories to Tags converter
  • Support ‘atom_ns’ ‘atom_head’ & ‘atom_entry’ hooks in Atompub backend
  • wp_mkdir_p doesn’t work with safe mode enabled
  • array_merge() Error when Adding Roles via Plugins
  • Update Diff Engine
  • time() is not GMT time()
  • wp:meta_value does not escape correctly
  • Duplicate comment check is too strict
  • wp_crop_image() and image_resize() are inconsistent. Both should return WP_Error objects on error.
  • In Media Library, if file does not have an extension, try to fallback to mime type
  • create metaboxes for hierarchical taxonomies
  • Custom Taxonomy Tags not appearing in admin-new/edit-posts-screen
  • Consider using the PHP ZIP extension to extract Zip’s if available
  • wp_mail fails to send to multiple recipients
  • Fresh look for WP update notification on the top of page
  • Custom Image Size Settings
  • Undefined variable: term in wp-includes/taxonomy.php on line 188
  • wp_clear_scheduled_hook does not work when including an $args parameter
  • Allow closures as callbacks
  • PHP safe-mode prevents WordPress from creating new directories
  • load_textdomain() merges even if not needed.
  • Add get_search_link()
  • Improve do_action(): Make $wp_actions an assoc array.
  • Media library: tooltip of image menu “View” shows name of next post
  • return variable $new_array in wp-includes/wp-db.php is not initialized
  • Importing WXR breaks serialized postmeta value
  • Redirection should be disabled for HEAD requests
  • Meta_key sort for numeric values / Natural Sort Order
  • Improve get_comments()
  • Opt-out of content snuffing for admin ajax
  • QuickPress loading graphic cleanup
  • Deprecate get_profile
  • Update phpass to version 0.2 (check /dev/urandom before accessing it)
  • wp_count_terms() should call get_terms()
  • optimised unzip_file()
  • Make WP_User_Search plugin friendly
  • Standardize hooks across the transient and options APIs
  • Mark user levels as Deprecated
  • XMLRPC references level_8 capability
  • Filter for paginate_links please?
  • Add is_comment_feed()
  • Add *_user_meta() functions
  • OPML import file size limit
  • improve get_page_hierarchy
  • Add replace method to wpdb
  • filesystem’s put_content() methods have inconsistent arguments — causes .maintenance file to not be created
  • Consistent filters for single_*_title()

get recent comments without wordpress plugin

Showing the most recent comments is great for SEO purpose. Our code snippet will able to get recent comments without wordpress plugin in your wordpress site.

get recent comments without wordpress plugin

You can display the most recent comments of your entire blog without any wordpress plugin. Showing the most recent comments is great for SEO purpose. Your site will increase the visibility and people interaction. Socially you and your blog will became more famous. Using following code snippet you will be able to add the recent comments in your wordpress site.

I want to display the comments in footer area. I created following code. You can copy paste the code in your sidebar.php or footer.php file.

Using following code you are able to display recent comments with author’s gr-avatar also.


<?php
$total_comments = $wpdb->get_results("SELECT comment_date_gmt, comment_author, comment_ID, comment_post_ID, comment_author_email FROM $wpdb->comments WHERE comment_approved = '1' and comment_type != 'trackback' ORDER BY comment_date_gmt DESC LIMIT 10");
$comment_total = count($total_comments);
echo '<ul>';
for ($comments = 0; $comments < $comment_total; $comments++) {
echo "<div style='clear:both;width:355px;padding-top:3px;'><div style='float:left;width:35px;'>";
echo get_avatar($total_comments[$comments]->comment_author_email,$size='32',$default='<path_to_url>' );
echo "</div> <div style='width:320px;'>";
echo '<li>';
echo $total_comments[$comments]->comment_author . ' says ';
echo '<a href="'. get_permalink($total_comments[$comments]->comment_post_ID) . '#comment-' . $total_comments[$comments]->comment_ID . '">';
echo get_the_title($total_comments[$comments]->comment_post_ID);
echo '</a></li></div></div>';
}
echo '</ul>'
?>

My footer is looking like as follows:

get recent comments without wordpress plugin
get recent comments without wordpress plugin

Solved : Kill command is not working on linux or Fedora

Many times this issue is happened with me I tried the kill command to stop the process. Solved, Kill command is not working on linux.
But that is really not responding. For Example, following command executed but not worked.

Kill command is not working on linux

[siwan@siwank-pc ~]$ ps -ef|grep skype
siwan     3140     1  1 09:50 ?        00:04:46 skype
siwan    13857 13818  0 17:24 pts/1    00:00:00 grep skype
[siwan@siwank-pc ~]$ kill 3140

There are really very nice unix commands present in Linux like:

[siwan@siwank-pc ~]$ killall firefox

[siwan@siwank-pc ~]$ ps -ef|grep skype
siwan     3140     1  1 09:50 ?        00:04:46 skype
siwan    13857 13818  0 17:24 pts/1    00:00:00 grep skype

[siwan@siwank-pc ~]$ kill -9 3140

I specially like the kill -9 processid command. Using kill -9 on a process is like just hitting the power button on your running PC. You already know that powering off a running PC can damage your filesystem because of run-time inconsistent data, why would you do the same thing to your applications? You risk the _exact same_ data corruption.

Kill command is not working on linux
Kill command is not working on linux

How to setup Firefox Profile Manager on Fedora or Linux

How to set up Firefox Profile Manager on Fedora or Linux

Firefox has new functionality called Profile manager which will allow you to switch with multiple Users.
You can create many user profiles in Firefox and save that as per your choice.

setup Firefox Profile Manager on Fedora

Many times on same Firefox some user don’t want some addons or theme. That time we got some difficulties.
For avoiding this issue we can create the firefox profile in firefox.

In windows creating Firefox profile is very easy. Just open windows run window and type “firefox -P”. That sit!

You will see following screens.

Using this you can create the firefox profiles.

Now I am going to show you how to create the firefox profile in Fedora.

Open terminal and just type following command

[siwan@siwank-pc ~]$ /usr/lib/firefox-3.5.6/firefox -ProfileManager
[siwan@siwank-pc ~]$

setup Firefox Profile Manager on Fedora
setup Firefox Profile Manager on Fedora

See following screens.
Note: when you got “choose user profile” window. Don’t forget to uncheck the “Don’t ask startup” checkbox.

Note:  I am using the Fedora 11 here for this example.

How to customize the comments template or wp_list_comments()

In single.php file we have function to add comments functionality. Here in this article I will give the code for customize the comments template.

From wordpress 2.7 version we got the functionality of changing or customizing the comments template as per your theme. As we all know in single.php file we called following function to add comments functionality. wordpress comments is very important functionality. Here in this article I will give the code for customize the comment template.

customize the comments template


<?php comments_template(); ?>

This function basically calls the comments.php file and add the data from wordpress database.

If we check the comments.php file. Usually we are having following content in comments.php file

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]


<?php

// Do not delete these lines
 if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
 die ('Please do not load this page directly. Thanks!');

 if ( post_password_required() ) { ?>
 <p>This post is password protected. Enter the password to view comments.</p>
 <?php
 return;
 }
?>

<!-- You can start editing here. -->
<div id="comment">
<?php if ( have_comments() ) : ?>
 <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>

 <div>
<div><?php paginate_comments_links(); ?></div>
 </div>

 <ol>
 <?php wp_list_comments('callback=wordpressapi_comments'); ?>

 </ol>

 <div>
<div><?php paginate_comments_links(); ?></div>
 </div>
 <?php else : // this is displayed if there are no comments so far ?>

 <?php if ('open' == $post->comment_status) : ?>
 <!-- If comments are open, but there are no comments. -->

 <?php else : // comments are closed ?>
 <!-- If comments are closed. -->
 <p>Comments are closed.</p>

 <?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>

<div id="respond">

<h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>

<div>
 <small><?php cancel_comment_reply_link(); ?></small>
</div>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( $user_ID ) : ?>

<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>

<?php else : ?>

<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label></p>

<?php endif; ?>

<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->

<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<?php comment_id_fields(); ?>
</p>
<?php do_action('comment_form', $post->ID); ?>

</form>

<?php endif; // If registration required and not logged in ?>
</div>

<?php endif; // if you delete this the sky will fall on your head ?>
</div>

In the comments loop for showing the comments we used the wp_list_comments() function. Use this for customize the comments template.

We can customize this function as per our requirement. We can pass the following parameters to this function. use following for customize the comments template.


[/viral-lock]

For customize the comments template following parameter is important.

callback (string) The name of a custom function to use to display each comment. Defaults to null. Using this will make your custom function get called to display each comment, bypassing all internal WordPress functionality in this respect. Use to customize comments display for extreme changes to the HTML layout. Not recommended.

In my theme I used that in following way. I changed and passed parameter in comments.php file.


<?php wp_list_comments('callback=wordpressapi_comments'); ?>

Then Open the functions.php file put following code in that. This code I am using as per wordpress api.


function wordpressapi_comments($comment, $args, $depth) {
 $GLOBALS['comment'] = $comment; ?>
 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
 <div id="comment-<?php comment_ID(); ?>">
 <div>
 <?php echo get_avatar($comment,$size='32',$default='<path_to_url>' ); ?>
 <?php $user_name_str = substr(get_comment_author(),0, 20); ?>
 <?php printf(__('<cite><b>%s</b></cite> <span>says:</span>'), $user_name_str) ?>
 </div>
 <?php if ($comment->comment_approved == '0') : ?>
 <em><?php _e('Your comment is awaiting moderation.') ?></em>
 <br />
 <?php endif; ?>

 <div><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(),&nbsp; get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),'&nbsp; ','') ?></div>

 <?php comment_text() ?>

 <div>
 <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
 </div>
 </div>
<?php
 }

Many times some people add the full URL of website in the name parameter. That time showing author name of comment writer is looks so ugly. So I used following trick in this function. Using this line of code we can show only 20 characters of author.


<?php $user_name_str = substr(get_comment_author(),0, 20); ?>
 <?php printf(__('<cite><b>%s</b></cite> <span>says:</span>'), $user_name_str) ?>

I changed the this function as per my choose. You can customize this function as per your theme requirement.

customize the comments template
customize the comments template

If you found any issue in this article “customize the comments template” about this. please write comments.

 

wordpress migration to new hosting service or domain

how to do wordpress migration to new hosting service – This question always came to web developers. After searching on Internet I really did not found satisfied answer for this question. Using our steps wordpress migration to new hosting service or domain made easy

wordpress migration to new hosting service or domain

Earlier I did wordpress migration to new hosting service or new domain so many times. It was like 5 minutes job for any web developer. Don’t be afraid about wordpress migration at all.

Many people suggest to use wordpress utility which import and export xml. This is given by wordpress itself. But I strongly say don’t use that tool. that is not really full proof.

Just follow my steps to do wordpress migration to new hosting or domain.

1. First take backup of file system of your wordpress website using FTP credential.

2. Open wp-config.php file and change database name(what you want)

3. wp_options -Table name
option_name column – change(siteurl and home)

4. wp_blogs- Table name
domain column – change to your domain name

5. wp_site- Table name
domain column – change to your domain name

6. wp_usermeta
meta_key column – change(source_domain)

Most important part of migration. Fixing the image path of wordpress website

7. Just run following query using phpmyadmin or command prompt and any sql editor.

UPDATE wp_posts SET post_content = REPLACE(post_content, ’NEW_DOMAIN.com’, ‘OLD_DOMAIN.com’);

For changing the mysql queries you can use the following URL:

https://purabtech.in/mysql-queries-wordpress-website-migration/

Follow above steps and your are done with migration.

wordpress migration to new hosting service or domain
wordpress migration to new hosting, question always came to web developers. Using our steps wordpress migration to new hosting service or domain made easy

That sit!

fetch wordpress posts which starting with specific word or alphabet

If you want to fetch wordpress posts which is starts with specific word or alphabet. That is really easy to achieve in wordpress.

Article for fetch wordpress posts which starting with specific word.

Just follow my steps:

Open your functions.php file from your wordpress theme folder.


add_action( 'posts_where', 'starting_word' );
function starting_word( $sql ){
 global $wpdb;
 $starting_word = get_query_var( 'starting_word' );

 if( $startswith ){
 $sql .= $wpdb->prepare( " AND $wpdb->posts.post_title LIKE %s ", $starting_word.'%' );
 }

 return $sql;
}

Open your index.php file or any file where you want show the wordpress posts which is starting with specific word or alphabet.

Use following code in that file.


<?php  query_posts('paged='.$paged.'&starting_word=wordpressapi&category_name=Your Category&posts_per_page=10'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>

<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?></a>

<br />
<?php the_content(); ?>
<?php endwhile; ?>

fetch wordpress posts which starting with specific word
fetch wordpress posts which starting with specific word

WordPress vs Joomla vs Drupal, Which is more popular and user friendly

Which CMS is most popular and most user-friendly in the world. WordPress vs Joomla vs Drupal all are best cms. you need to decide what type of site you want.  This is most common question among the developers and clients.

So many times this question is questioned the answered But still I am going answer this question with my opinions.

WordPress vs Joomla vs Drupal

Biggest growth of jobs is WordPress. I am wordpress developer and  I can feel this trend today.
We can this graph that displays the growth of wordpress. Seeing this graph We can say that in 2009 and 2010 wordpress is really rocking.

Wordpress vs Joomla vs Drupal
WordPress vs Joomla vs Drupal

I worked on all the  cms like wordpress, drupal, joomla and many more. But in this year I worked on wordpress for quite some extra time.

When we choose CMS we consider following points.

1. Which CMS will provide you Best Seo options

Ans: When we see and check the all CMS then I can easily say that wordpress has ability to provide you best seo option. After that I will must say Drupal is best option to go with. This will also provide you best seo option.

2. Which CMS is easy to make custom theme from custom design PSD

Ans: I can say with wordpress and drupal both creating a theme is very easy. any web developer who have very basic knowledge of PHP they can develop custom theme very easily.

3. Which CMS is easy  for developer to make custom plugins, modules and components easily

Ans: If you started learning API’s of both the CMS. All are good and easy and all provided good amount of help on internet. But I can rate myself as follows:

a. WordPress

b. Drupal

c. Joomla

Anyways that is depending on your knowledge and understanding. All you need to spend some time to understand the API’s of all CMS.

4. Which CMS admin is most user-friendly and easy to use for non-technical people

Ans: For this point I must say wordpress is the best tool. Drupal has admin panel but little complex to understand and same with joomla.

5. Which CMS is most good for  E-commerce site, Blog, Small site, News sites and company website.

Ans:  I recommend again wordpress here. you can set up wordpress very easily and quickly with minium effort. For big websites like magazine and news sites wordpress is the great tool.

Next point is,  for ecommerce and blogging wordpress is the great tool. If you are aware with wordpress then go with drupal.

Conclusion:  If you want to develop very complex website with multiple features like ad management, forums, client support, video gallery, media gallery then go with Drupal.

So many very big websites are built-in Drupal and WordPress. Choosing the CMS is all depending on your client requirement.

Best IDE for WordPress, Drupal Plugin and Theme development

Many developer who are experienced in development. But with another CMS development. we look for Best IDE for WordPress, Drupal Plugin and Theme development.  But still that comes to another cms or project development. We are always search for good IDE which are free and open source that is the first requirement.

Best IDE for WordPress, Drupal Plugin and Theme development

Our basic need are as follows in any IDE, the IDE need to support following things:

  • CSS
  • XHTML/HTML
  • JavaScript
  • PHP
  • MySQL

I created a list of IDE which I used daily  to do a development. Here I need to clarify IDE is language specific. I work in PHP, Ruby on Rails, Adobe Air, Flex, Javascript, CSS.

I recommend following IDEs which I really found useful for all the developer who are working in wordpress, joomla, drupal development.

1. eclipse (Compatible  on Windows and Linux)

Best IDEs for WordPress, Joomla, Drupal Plugin and Theme development
Best IDE for WordPress, Drupal

Description: Eclipse is best IDE for all language development. Eclipse IdE is basically Java development but still that provides PHP, ROR and other language support. I like this IDE for java development but I did not recommend for PHP or Ruby on Rails.

2. NetBeans (Compatible  on Windows and Linux)

Best IDEs for WordPress, Joomla, Drupal Plugin and Theme development
Best IDE for WordPress, Drupal

Description: This IDE has also all language support. I specially like this IDE from Ruby on Rails development. I Used this IDE for Ruby on Rails development as well as some times for PHP development. Among the Ruby on Rails developer this IDE is so popular.

3. Komodo (Compatible  on Windows and Linux)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description : This IDE is also support for all languages. This IDE is really good support for PHP. I really love this IDE for PHP development. Simple and fast and still nice features about PHP. This IDE is really popular among the PHP developers.

4. Aptana (Compatible  on Windows and Linux)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description : This IDE is mainly made for Ruby on Rails development. This is also popular among Ruby developers. This IDE has features like eclipse. I like this IDE for Adobe Air and flex development.  This IDE has also PHP support.

5. EditPlus (Compatible  on Windows)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description: This IDE is plain simple text editor. Shows you simple color highlight features. I specially recommend this IDE for PHP development and new PHP developer always start with this IDE so they will get filmier with PHP functions and methods because this IDE is does not provide any help. I love the use this IDE in daily use for any language development.

If you want to add any more IDEs. You can comments on this article.