Category: wordpress

How to run cron and execute function inside plugin in WordPress 3

How to run cron and execute function inside plugin in WordPress 3

Running cronjobs in WordPress is easy but seem there are lack of documentation that talking about this. Especially, if we want to running our custom plugin in WordPress from our cronjobs. Actually, there are two methods of running cron in WordPress. First, it’s running from loaded pages. Seconds, it’s running through cron UNIX servers (wget, …

+ Read More

Download image and attach into post programmatically in WordPress 3

Download image and attach into post programmatically in WordPress 3

All we know, we can use wp_insert_post() to create content programmatically in WordPress. But, there more magic goodies bag in WordPress. We can download images and attach into post programmatically by using media_sideload_image(). There are several issue while using this function because lack of documentation about how to implement it. The common error when using …

+ Read More

How to create custom table from plugin in WordPress 3

How to create custom table from plugin in WordPress 3

When creating plugin, we need to create a custom table. We will use register hook activation, de-activation and uninstall to handle database creation and removal. Now, we start with database created automatically when plugin installed / activated. 123456789101112131415161718/* Register installation into hook */ register_activation_hook(__FILE__, ‘your_plugin_install’); /* Install montage SQL into database */ function your_plugin_install() { …

+ Read More

Showing WordPress 3 query database error

Showing WordPress 3 query database error

When you building plugin or themes, sometimes you need to contact with database ( select, update, insert or delete ). Somehow after executing database, there no result and no changes in database. That mean some problem with your code. You should check it with showing query error in WordPress by : 1$wpdb->show_errors(); For example : …

+ Read More

How to load Zend Framework in WordPress 3 plugin

How to load Zend Framework in WordPress 3 plugin

Loading Zend Framework into WordPress 3 plugin is quite easy. You can download latest ZendFramework on http://framework.zend.com/download/latest . To use Zend Framework with our plugin, extract it on inside plugin folder. 1234set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) ); require_once ‘Zend/Loader/Autoloader.php’; Zend_Loader_Autoloader::getInstance();

How to load Zend Framework into PHP files

How to load Zend Framework into PHP files

Zend Framework provide a lot of interesting libraries. Instead re-invent the wheel, using Zend Framework libraries will boost our development time. You can download latest ZendFramework on http://framework.zend.com/download/latest . To use Zend Framework with our system like individual php files, CMS or Framework, we should configure our path. This is scheme of folders and extracted …

+ Read More

How to create WordPress 3 Custom Plugin for dummies

How to create WordPress 3 Custom Plugin for dummies

Creating custom plugin in WordPress 3.2 is easy and it will fast if we do on the right way. So, what we need to know as newbie / n00b to build a custom wordpress plugin ? First, you should read : http://codex.wordpress.org/Writing_a_Plugin. Now you have insight to build a plugin on WordPress. I will guide …

+ Read More

Configuring WordPress on Localhost NGINX sub-folder

Configuring WordPress on Localhost NGINX sub-folder

Using WordPress on localhost with sub-folder in Apache is very easy. But using NGINX, it will little bit differents. Usually, we use custom domain like http://wordpress, register domain into “/etc/hosts” and define into NGINX sites-available. But, this is not effective way. We like to access our wordpress like Apache. Access WordPress from localhost like http://localhost/wordpress …

+ Read More

Upgrade WordPress using command-line in 10 seconds

Upgrade WordPress using command-line in 10 seconds

WordPress always release their engine most in every 2 month or less. Using command-line will make upgrading wordpress done in 10 seconds. I assume you have latest version of wordpress in folder called “wordpress”. And i have “wordpress-old” as my old wordpress. Make latest and old on same level folder and do this : 1. …

+ Read More

How to fix memcached problem in WordPress 3

How to fix memcached problem in WordPress 3

When using memcached plugin in WordPress 3 and multiple sites used same memcached server, all sites seems have wrong redirection. Thought it was my firefox cache problem but it doesn’t. This is because bug in object-cache.php. Mohanjit give solution for this problem by patching them. Here are object-cache.php that you should put into wp-content : …

+ Read More

Google Street Map can’t work in WordPress 3.2 Solved!

Google Street Map can’t work in WordPress 3.2 Solved!

I tried to embed Google Map into WordPress 3.2 and see it’s works without any failure. But, not with Google Street Map. When i trying embed this javascript code, it’s only show boxes and not images. I thought it was my NGINX configuration or w3-total cache plugin conflict with Google Street Map. So, i try …

+ Read More