Category Archives: WordPress

Twenty Thirteen and Standard Widget Extensions

Twenty Thirteen is a new default theme of WordPress for 2013. The default style of Twenty Thirteen is without sidebars. But you can use a sidebar in Twenty Thirteen with the sticky sidebar feature of Standard Widget Extensions plugin if you like. I’ll explain how to do that. 1. Enabling Sidebar Twenty Thirteen has two widget areas. One is for the footer and the other is for the sidebar. If you place widgets in ‘Secondary Widget Area’, a sidebar will appear automatically. 2. Theme Modification Twenty Thirteen’s sidebar doesn’t have a proper ID to use. So you need to attach an ID to it by editing theme files. In your … Continue reading Twenty Thirteen and Standard Widget Extensions

The truth of WordPress revision management

It seems that many people disable the revision feature of WordPress. But is it what you really want? If you learn what WordPress really do and take care of them, the revision feature will be certain benefit to you. In a default environment, WordPress works as follows. A post has only one autosaved revision at most. How revisions are made when you preview depends on post status. Revisions are made only in the wp_posts table. When you bulk edit posts, revisions are made. When you quick edit posts, revisions are made, too. The time of loading posts in permalinks is not proportional to the number of posts and revisions. I’ll … Continue reading The truth of WordPress revision management

WordPress in command line scripts

Though WordPress has wp-cron functionality to do scheduled tasks, I still like Unix crontab to do them. Fortunately, we can write script programs in PHP to run from a command line even if the scripts call WordPress functions. To do WordPress operation in a script, we have to include ‘wp-load.php’ before the operation. Below is a sample script to create a new post. You can run it from a command line. Before loading ‘wp-load.php’, you have to set PHP ‘$_SERVER’ variable. Especially in a multisite environment, WordPress will determine which site to involve by $_SERVER values. #!/usr/bin/php <?php // define(‘WP_DEBUG’, true); /* uncomment for debug */ $_SERVER = array( "HTTP_HOST" … Continue reading WordPress in command line scripts