WordPress – Shortcode API

This function has been used since WP 2.5, for some more details: http://codex.wordpress.org/Shortcode_API, Here I will show you some usages.

Continue Reading 1 comment November 29th, 2010

Add copyright information to every post

Sometimes we want to show our copyright to the readers, we can add the copyright information under every post, for WordPress users, it’s not difficult, just put some code into functions.php, here is the code…

Continue Reading Add comment October 21st, 2010

PHP functions in Javascript using PHP.JS

PHP programmers usually have to handle HTML & Javascript front-end coding as well and I’m sure a lot of us have been frustrated with the lack of those easy to use PHP functions in Javascript like those array, encode/decode and string functions. Here’s a Javascript project which provides you just that.

Continue Reading Add comment October 4th, 2010

wp_link_pages…

Displays page-links for paginated posts. This works in much the same way as link_pages(), the difference being that arguments are given in query string format. This tag must be within The_Loop.

Continue Reading Add comment September 23rd, 2010

Random display by PHP

Sometimes I need to display a Ad or codes Randomly on my website. here is the php code can give out the result, share with you! you can use it for the Ads, Images, Flash…all kinds of codes.

Continue Reading Add comment September 10th, 2010

The Pictures News effect on Sina.com.cn

This is a great effect I found on the internet, for some reasons I dont use it now, coz I used another plugin on www.crazyenglish.info instead of the effect, but I think I will try it some day, so collect it here, just in case…

Continue Reading Add comment August 26th, 2010

Add Favicon for Links

This is a interesting function, that we can add the favicon for the links on our website, like the friend links page…if you dont know what favicon is, plz visit http://en.wikipedia.org/wiki/Favicon, in this post i just want to show you how to add it just by a few lines codes…

Continue Reading Add comment August 25th, 2010

A short code for HTTP Gzip

I got an amazing short code for HTTP Gzip from Willin Kan’s Blog, Just add it in the functions.php file, all done! easy but powerful!

Here is the code below:

/* HTTP Gzip */
$host = $_SERVER['HTTP_HOST'];
if ( !strstr($host, '192.168') && !strstr($host, '127.0.0') && !stristr($host, 'localhost') ) { // 本地調試不用
function wp_gzip() {
  // Don't use on Admin HTML editor
  if ( strstr($_SERVER['REQUEST_URI'], '/js/tinymce') )
    return false;
  // Can't use zlib.output_compression and ob_gzhandler at the same time
  if ( ( ini_get('zlib.output_compression') == 'On' || ini_get('zlib.output_compression_level') > 0 ) || ini_get('output_handler') == 'ob_gzhandler' )
    return false;
  // Load HTTP Compression if correct extension is loaded
  if (extension_loaded('zlib') && !ob_start('ob_gzhandler'))
    ob_start();
}
add_action('init', 'wp_gzip');
}
// -- END ----------------------------------------

It doesn’t work for JS and CSS coz Willim has used CSSTidy and packer. If you want to active the code for them you can modify it by yourself.

Add comment August 21st, 2010

How to Widget-Enable WordPress Themes

Wordpress Widgets are an amazing way to customize your blog besides wordpress plugins. How to widgetize your wordpress theme? I use a heavily modified version of the Blix wordpress theme, which does not support widgets…Here is a tutorial on how to add multiple dynamic sidebars to wordpress template and support multiple combinations of widgets.

Continue Reading Add comment August 20th, 2010

The Submenu here…

I really spend much time in making the submenu here at Wheat Notes, when I first saw the submenu effect from Denis on his blog, I am always wondering to make it here, actually, I began the work from last night, I got a article about using CSS to make the wonderful submenu, I made it but it was a little complicated indeed, and there was still a problem about the menu when I change the menu the shadow kept still on the same one…

Continue Reading 1 comment August 19th, 2010

Colorful Tag Cloud without Any Plugin

The tags cloud page can show the most discussed topics to your readers.Using the wp_tag_cloud function can add the tag cloud in your wordpress page. You can learn more about wp_tag_cloud function from wordpress codex. But the default tag cloud in wordpress show in single color, it’s blankness and hard to read. So if you make the tag cloud show up colorful, the readers can easily get your main topics and know what are you talking about in your blog.

Firstly, open the functions.php file in your theme directory, copy the subjacent code and paste it in your functions.php file.

//Start of colorful tag cloud
function colorCloud($text) {
 $text = preg_replace_callback('|<a (.+?)>|i', 'colorCloudCallback', $text);
 return $text;
}
function colorCloudCallback($matches) {
 $text = $matches[1];
 $color = dechex(rand(0,16777215));
 $pattern = '/style=(\'|\")(.*)(\'|\")/i';
 $text = preg_replace($pattern, "style=\"color:#{$color};$2;\"", $text);
 return "<a $text>";
}
add_filter('wp_tag_cloud', 'colorCloud', 1);
//End of colorful tag cloud

Add the subjacent code to where you want the tag cloud show.

<?php wp_tag_cloud( 'smallest=8&largest=24&number=50' ); ?>

via:

http://www.aowaa.com/how-to-add-colorful-tag-cloud-without-any-plugin-in-wordpress/

http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/

http://wanwp.com/tips-tricks/howto-make-a-colorful-tag-cloud/

Add comment June 12th, 2010


Calendar

May 2012
MTWTFSS
« Nov  
 123456
78910111213
14151617181920
21222324252627
28293031 

Posts by Month

Posts by Category