Sunday, June 26, 2011

Wordpress Timeout Problem

If you got this error message when you are using the wordpress API to access plugins and themes:

"An Unexpected HTTP Error occurred during the API request in wordpress"

You probably need to do 2 things to fix it:

1. Edit the wp-includes/class-http.php and find the line:


'timeout' => apply_filters( 'http_request_timeout', 5),

then, change to timeout value from 5 to some values like 30 or 60.

2. Increase the memory limit of your php setting to 64MB.

Wordpress NextGen Gallery Plugin


The wordpress plugin "NextGen Gallery" requires php 5.2 or above but my CentOS is running 5.1. So I need to update it with the following steps:
step 1:
Add PHP 5.3 repository
# rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm 

enable and install 
# yum --enablerepo=webtatic install php 

or update 
# yum --enablerepo=webtatic update php 

Congratulation, You/We have installed php5.3 

we can verify that it is installed or not by 
 [root@server tmp]# rpm -q php php-5.3.6-1.w5


** Remark
You may also want to install the GD library to allow WP resizes your images:
# yum --enablerepo=webtatic install php-gd

Friday, June 10, 2011

Tips for Wordpress

  1. When WP is configured to use permalink, WP will create a .htaccess file in its root directory which uses the mod_rewrite module to rewrite an url. In this case, make sure that your Apache is configured to allow override by the sub-configs located in the document root.
  2. Custom post type
    http://codex.wordpress.org/Post_Types#Custom_Types
    Five types of post: post, page, attachment, revisions, nav menus
  3. Template Hierarchy
    http://codex.wordpress.org/Template_Hierarchy
  4. Wordpress Query
    http://codex.wordpress.org/Query_Overview
    http://codex.wordpress.org/Function_Reference/query_posts
    http://codex.wordpress.org/Class_Reference/WP_Query
    http://codex.wordpress.org/Function_Reference/get_posts
  5. Change the default Wordpress notification mail subject:
    http://www.yakupgovler.com/we-change-wordpresssitenamecom.html
  6. Hide Menu items from user based on user's role
    http://www.tomauger.com/2011/web-development/wordpress/wordpress-hiding-menu-items-from-users-based-on-their-roles-using-a-custom-walker
  7. What is Hook, Action and Filter?
    http://codex.wordpress.org/Plugin_API
  8. Debugging in Wordpress
    http://codex.wordpress.org/Debugging_in_WordPress