Make WordPress K2 Themes Refresh Faster

December 7, 2006 by angelchen1111 · 1 Comment
Filed under: wordpress 

The pages with wordpress K2 theme loads fast when you click them, but if you try to refresh the page it will be very slow to load, while other themes don’t have this problem. To fix this follow this guide taken from K2’s forum:

find the folder js inside the K2 folder, then for each .js.php file comment out the ‘require(….. wp-blog-header.php)’ line and replace ‘!get_settings(’gzipcompression’)’ with ‘( ob_get_length() === FALSE)’. After that the first few lines should look like this:

//require(dirname(__FILE__)."/../../../../wp-blog-header.php");
// check to see if the user has enabled gzip compression in the WordPress admin panel
if ( (ob_get_length() === FALSE) and !ini_get('zlib.output_compression') and ini_get('output_handler') != 'ob_gzhandler' and ini_get('output_handler') != 'mb_output_handler' ) {
ob_start('ob_gzhandler');
}

Then add the following lines on the top of the files livesearch.js.php and rollingarchives.js.php after the php tag:

// Echo a translated string.
function _e($text, $domain = 'default') {
global $l10n;

if (isset($l10n[$domain]))
echo apply_filters(’gettext’, $l10n[$domain]->translate($text), $text);
else
echo $text;
}

For livesearch.js.php, comments.js.php:
replace all
bloginfo("template_url")
with
echo str_replace($_SERVER['DOCUMENT_ROOT'],”,realpath(dirname(__FILE__) . ‘/../’))
There are two instances of these in comments.js.php, and one in livesearch.js.php.

After all these the pages will refresh very fast.

Original post in which this guide is taken from…

Today I changed my blog’s template to TripleK2

November 16, 2006 by angelchen1111 · 7 Comments
Filed under: wordpress 

Today I changed my blog’s template to TripleK2, a theme based on K2 but with three columns, with a very nice style TechnoBlue(found in the same website). Now I have one sidebar on the left and one on the right. The theme is similar to 3k2, but I didn’t use 3k2 since the last time it’s updated is like half years ago, it uses a much older version of K2 which probably has some bugs that cause trouble. I really liked the style TechnoBlue, since it looks very nice and neat, if you’re looking for a three-column K2 with a nice style it should be your choice.

How to add social bookmarking in wordpress

November 14, 2006 by angelchen1111 · 1 Comment
Filed under: wordpress 

In the entry Let Your Blog Be Social nongeek talked about the advantage of social bookmarking and how to add bookmark area in blogger’s template. You can also do that in wordpress too, using the same way he said in that post, but substitute Blogger’s template tags with wordpress’s tags. For example, if you want a “Submit to del.icio.us” line you should add

Submit to: <a href="http://del.icio.us/post?url=<?php the_permalink()
?>;title=<?php the_title(); ?>" >del.icio.us</a>

instead of

Submit to: <a href="http://del.icio.us/post?url=<$BlogItemPermalinkURL$>;title=<$BlogItemTitle$>"
>del.icio.us</a>

to your template’s php file before or after the line <?php the_content('something'); ?> depending on if you want it to appear before or after the posts.

If you want to submit to Digg there’s a great WordPress plugin called Digg This for WordPress Reloaded that lets you to add a very cool “Digg This button” like the one I have in the posts, without changing the template’s codes. It also comes with a Complete admin interface with options for many customizations, like positioning the button, what pages to show the button, the style of the button , and many others.

how to fix wordpress 404 error when posting in wordpress

November 5, 2006 by angelchen1111 · 2 Comments
Filed under: tips, wordpress 

If you have mod_security turned on in your server you will sometimes get a 404 not found error when you try to save or publish your post. To fix this add the lines
SecFilterEngine Off
SecFilterScanPOST Off

to your .htaccess file in your wordpress’s root directory to turn off mod_security’s keyword filtering feature for posting forms, and you should not get the error anymore when you try to post.

Flash objects break wordpress in Internet Explorer

October 25, 2006 by angelchen1111 · Leave a Comment
Filed under: wordpress 

Today I had problem loading my pages properly in Firefox but not Internet Explorer, I wondered why this happen as I never had this problem with my blog before. At first I thought there was a problem with the scripts, but it still won’t load completely even after disabling the scripts, then I tried to disable activex controls, and it loaded perfectly without the flash objects. Then I suspect the flash videos I have is causing those problems, I tried different flash objects and I found out that those with <object> tags won’t break the page, but those with <embed> actually do. I changed all my videos to

<ins><object type=’application/x-shockwave-flash’ data=’somefile.swf’><param
name=’allowScriptAccess’ value=’sameDomain’ /><param name=’movie’ value=’somefile.swf’><param
name=’quality’ value=’best’/><param name=’bgcolor’ value=’#ffffff’ /><param
name=’scale’ value=’noScale’ /><param name=’wmode’ value=’window’/><param name=’salign’
value=’TL’ /></object></ins>

Before changes: After changes:

My former Blogger’s blog doesn’t update in technorati

October 24, 2006 by angelchen1111 · 5 Comments
Filed under: blogger 

My former blog angelchen1111.blogspot.com doesn’t update in technorati at all, except for the links. The last date I updated it was Saturday, October 21, 2006. but in technorati it says it was updated 67 days ago, the exact day I created that blog in Blogger. I don’t know why, I only have problem with that blog, I don’t have problem with other blogs like this blog and the other blog from Blogger.

How to get rid of the wide spaces between the post body in WordPress

October 22, 2006 by angelchen1111 · Leave a Comment
Filed under: tips, wordpress 

Sometimes we see some annoying wide spaces in between the post body, which makes the post looks wierd, like this one in the picture. That’s because the theme’s stylesheet made the post body’s texts to align justified. To get rid of those wide spaces we have to open the file style.css in the folder “wp-content/themes/your theme”, find the .post { section or .entry-content { section if you’re using K2 and change text-align: justify; to text-align: left; to make the text to align left, so that they won’t make wide spaces by sometimes aligning left and sometimes aligning right. After changing this file the wide spaces will be gone.

I got too many wide space in between the post body(solved)

October 22, 2006 by angelchen1111 · Leave a Comment
Filed under: wordpress 

I got too many wide space in between the post body, does anyone know how to get rid of them? too-many-wide-space.JPG

Finally I moved my blog to http://www.theusefulblog.com

October 21, 2006 by angelchen1111 · Leave a Comment
Filed under: blog 

Today I decided to use the domain theusefulblog.com for my blog and use Wordpress to host my blog instead of Blogger. I decided not to use tipspedia.info since .info domain kinda sucks. I bought a very cheap web hosting from CirtexHosting which is only $2.50 a month or $24 a year. Despite its low price, I found the service is excellent, it gives you 5000 MB Storage, 100 GB Bandwidth, PHP, CGI, MYSQL, and 5 Email / FTP Accounts in the basic plan, it’s almost never down and its support is also excellent, and it has Live Support where they answer your questions very quickly, the email support is also very fast.

After I created the host and installed WordPress on it I started to migrate the old posts from Blogger to WordPress. Because my Blogger was beta I can’t import it directly, I had to import its post’s RSS to the new blog, after importing I found the timestamp was off by seven hours I had to change them back one by one by hand, I also had to type the comments in one by one again since I don’t know how to import them from Blogger to WordPress :(. It took me about three hours to do all those…. Finally I finish migrating by putting the customization I had from Blogger to here and pick a theme for my new blog.

Right now I just don’t know how to change the top menu for this K2 style TrueBlue, the links over there are not obvious enough,topmenu.JPG

if anybody know how to make it look better please tell me about that by leaving a comment here.

Bad Behavior has blocked 270 access attempts in the last 7 days.