Tag Archives: WordPress

Python Script to Import Simple Tagging tags to Wordpress 2.3

Wordpress 2.3 database now supports tags. For some reason, the Wordpress importer for Simple Tagging doesn’t work for me, it imports only halfway.
I wrote this python script stp-import.py to import the tags to Wordpress 2.3 database.
[~]$ python stp-import.py
The script will ask for the Wordpress database name, the database user and password, and the Wordpress database [...]

Modify WP-Cache to avoid caching Password Protected Post

This will allow the post to be seen after password is entered correctly.
Changes are made to wp-cache-phase2.php.

function wp_cache_ob_callback($buffer) {
..
/* we avoid caching incomplete files */
if (is_404() || !preg_match(’/(||)/i’,$buffer) ) {
$new_cache = false;
return $buffer;
}
// dun cache password protect post post_password)) {
$new_cache = false;
return $buffer;
}

Added Twitter Tools in Sidebar

Twitter Tools is a plugin by Alex King that creates an integration between your WordPress blog and your Twitter account.
I am using WP-Cache plugin also, so twitter updates may not be seen immediately (for up to an hour).
Modified Twitter Tools so that tweets from my blog posts don’t show the tinyurl link.

Showing Digg Popular Stories

Digg Popular Stories are now shown at the bottom of some of the categories and browse tag pages.
The categories include Diversion, Game, Science, Sports, Technology, World, Php and Python. The tags include Astronomy, environment, nba, php, python, Microsoft and video.
I wrote python scripts to retrieve the popular stories provided by Digg api and format the [...]

Adding Html Title for Tag Pages

This is done by modifying the function wp_title in general-template.php (add the below code).

if ( empty($title) ) {
$tag = get_query_var(’tag’); // assume
if ( !empty($tag) )
$title = “Browse by “.$tag;
}

Related Tags Navigation added

I am using plugin Simple Tagging. I made a slight modification to STP_RelatedTags and outputRelatedTags functions and uses STP_RelatedTags to show the related tags to the current tag being viewed. Basically, if a post is tagged with A and B, then tag A and B are related.
I also use the below to generate the browse [...]

Showing Only WordPress Top Categories

My sub-categories links are not working! I decided to show only the top categories on my sidebar. The following describes how I do it:
Modify function get_categories in category.php

Add show_top option in $defaults.

$defaults = array(’type’ => ‘post’, ‘child_of’ => 0, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’,
‘hide_empty’ => true, ‘include_last_update_time’ => false, ‘hierarchical’ => 1, ‘exclude’ => [...]