<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Design Philippines &#124; MikeWagan.net &#187; Web Design Resources</title>
	<atom:link href="http://www.mikewagan.net/category/web-design-resources/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikewagan.net</link>
	<description>Web Design, Life, and Everything in Between</description>
	<lastBuildDate>Sat, 10 Jul 2010 06:15:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>20+ WordPress Codes You Might Need On Your Next Project</title>
		<link>http://www.mikewagan.net/2010/04/20-wordpress-codes-you-might-need-on-your-next-project/</link>
		<comments>http://www.mikewagan.net/2010/04/20-wordpress-codes-you-might-need-on-your-next-project/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 08:13:13 +0000</pubDate>
		<dc:creator>Mike Wagan</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Design Resources]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress codes]]></category>

		<guid isPermaLink="false">http://www.mikewagan.net/?p=348</guid>
		<description><![CDATA[Undeniably, WordPress has been a premiere choice by web designers and internet publishers as their main blogging platform. One of the considerations of their choice is the flexibility of WordPress and easy customization of templates. Also, a lot of resources are available online on how to make the popular platform even more. Here are 20+ [...]


Related posts:<ol><li><a href='http://www.mikewagan.net/2009/09/10-plugins-to-make-wordpress-a-great-cm/' rel='bookmark' title='Permanent Link: 10 Plugins to Make WordPress a Great CMS'>10 Plugins to Make WordPress a Great CMS</a> <small>I&#8217;ve been using the blogging platform, WordPress, as a CMS for the company I&#8217;m working with right now because I...</small></li><li><a href='http://www.mikewagan.net/2009/11/search-and-replace-in-mysql/' rel='bookmark' title='Permanent Link: Search and Replace in MySQL'>Search and Replace in MySQL</a> <small>I just went through a domain transfer for one of our websites, and the links in the posts are all...</small></li><li><a href='http://www.mikewagan.net/2009/12/100-new-free-but-premium-like-wordpress-themes/' rel='bookmark' title='Permanent Link: 100 New Free but Premium-like WordPress Themes'>100 New Free but Premium-like WordPress Themes</a> <small>If you&#8217;re a Worpress Theme addict and you&#8217;ve not yet visited this post, I suggest you do because these are...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Undeniably, WordPress has been a premiere choice by web designers and internet publishers as their main blogging platform. One of the considerations of their choice is the flexibility of WordPress and easy customization of templates. Also, a lot of resources are available online on how to make the popular platform even more. Here are 20+ WordPress Codes that you can use on your next WordPress project. <span id="more-348"></span>
<center>
<table><tr><td>
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 336x280, created 8/4/09 mikewagan.net */
google_ad_slot = "3873552827";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td><td>
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 160x90, created 10/8/09 mikewagan.net */
google_ad_slot = "0020347340";
google_ad_width = 160;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 160x90, created 10/8/09 mikewagan.net */
google_ad_slot = "0020347340";
google_ad_width = 160;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td></tr></table>
</center>
</p>
<h3>Display Tags In A Dropdown Menu</h3>
<p>In your theme folder, paste the following code to the functions.php  file. If you don’t have a functions.php file, create one.</p>
<pre><code>&lt;?php
function dropdown_tag_cloud( $args = '' ) {
	$defaults = array(
		'smallest' =&gt; 8, 'largest' =&gt; 22, 'unit' =&gt; 'pt', 'number' =&gt; 45,
		'format' =&gt; 'flat', 'orderby' =&gt; 'name', 'order' =&gt; 'ASC',
		'exclude' =&gt; '', 'include' =&gt; ''
	);
	$args = wp_parse_args( $args, $defaults );

	$tags = get_tags( array_merge($args, array('orderby' =&gt; 'count', 'order' =&gt; 'DESC')) ); // Always query top tags

	if ( empty($tags) )
		return;

	$return = dropdown_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args
	if ( is_wp_error( $return ) )
		return false;
	else
		echo apply_filters( 'dropdown_tag_cloud', $return, $args );
}

function dropdown_generate_tag_cloud( $tags, $args = '' ) {
	global $wp_rewrite;
	$defaults = array(
		'smallest' =&gt; 8, 'largest' =&gt; 22, 'unit' =&gt; 'pt', 'number' =&gt; 45,
		'format' =&gt; 'flat', 'orderby' =&gt; 'name', 'order' =&gt; 'ASC'
	);
	$args = wp_parse_args( $args, $defaults );
	extract($args);

	if ( !$tags )
		return;
	$counts = $tag_links = array();
	foreach ( (array) $tags as $tag ) {
		$counts[$tag-&gt;name] = $tag-&gt;count;
		$tag_links[$tag-&gt;name] = get_tag_link( $tag-&gt;term_id );
		if ( is_wp_error( $tag_links[$tag-&gt;name] ) )
			return $tag_links[$tag-&gt;name];
		$tag_ids[$tag-&gt;name] = $tag-&gt;term_id;
	}

	$min_count = min($counts);
	$spread = max($counts) - $min_count;
	if ( $spread &lt;= 0 )
		$spread = 1;
	$font_spread = $largest - $smallest;
	if ( $font_spread &lt;= 0 )
		$font_spread = 1;
	$font_step = $font_spread / $spread;

	// SQL cannot save you; this is a second (potentially different) sort on a subset of data.
	if ( 'name' == $orderby )
		uksort($counts, 'strnatcasecmp');
	else
		asort($counts);

	if ( 'DESC' == $order )
		$counts = array_reverse( $counts, true );

	$a = array();

	$rel = ( is_object($wp_rewrite) &amp;&amp; $wp_rewrite-&gt;using_permalinks() ) ? ' rel="tag"' : '';

	foreach ( $counts as $tag =&gt; $count ) {
		$tag_id = $tag_ids[$tag];
		$tag_link = clean_url($tag_links[$tag]);
		$tag = str_replace(' ', '&amp;nbsp;', wp_specialchars( $tag ));
		$a[] = "\t<span>&lt;<span>option</span><span> value=</span>'$tag_link'&gt;</span>$tag ($count)<span>&lt;/<span>option</span>&gt;</span>";
	}

	switch ( $format ) :
	case 'array' :
		$return =&amp; $a;
		break;
	case 'list' :
		$return = "<span>&lt;<span>ul</span><span> class=</span>'wp-tag-cloud'&gt;</span>\n\t<span>&lt;<span>li</span>&gt;</span>";
		$return .= join("<span>&lt;/<span>li</span>&gt;</span>\n\t<span>&lt;<span>li</span>&gt;</span>", $a);
		$return .= "<span>&lt;/<span>li</span>&gt;</span>\n<span>&lt;/<span>ul</span>&gt;</span>\n";
		break;
	default :
		$return = join("\n", $a);
		break;
	endswitch;

	return apply_filters( 'dropdown_generate_tag_cloud', $return, $tags, $args );
}
?&gt;</code></pre>
<p>Now open the file where you want the list to be displayed and paste  the following code:</p>
<pre><code><span>&lt;<span>select</span><span> name=<span>"tag-dropdown"</span></span><span> onchange=<span>"document.location.href=this.options[this.selectedIndex].value;"</span></span>&gt;</span>
	<span>&lt;<span>option</span><span> value=<span>"#"</span></span>&gt;</span>Tags<span>&lt;/<span>option</span>&gt;</span>
	&lt;?php dropdown_tag_cloud('number=0&amp;order=asc'); ?&gt;
<span>&lt;/<span>select</span>&gt;</span></code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/wordpress-hack-display-your-tags-in-a-dropdown-menu">WpRecipes</a> <strong>Credits:</strong> <a href="http://wphacks.com/how-to-display-wordpress-tags-dropdown-menu/">WpHacks</a></p>
<h3>Get Posts Published Between Two Particular Dates</h3>
<p>Just before the loop starts, paste the following code. Change the  dates on line 3 according to your needs.</p>
<pre><code>&lt;?php
  <span><span>function</span> <span>filter_where</span><span>($where = <span>''</span>)</span> {</span>
        $where .= <span>" AND post_date &gt;= '2009-05-01' AND post_date &lt;= '2009-05-15'"</span>;
    <span>return</span> $where;
  }
add_filter(<span>'posts_where'</span>, <span>'filter_where'</span>);
query_posts($query_string);
?&gt;</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/wordpress-loop-get-posts-published-between-two-particular-dates">WpRecipes</a> <strong>Credits:</strong> <a href="http://codex.wordpress.org/Template_Tags/query_posts#Time_Parameters">Codex</a></p>
<h3>Get Posts With A Specific Custom Field &amp; Value</h3>
<p>Add the query_posts() function just before the Loop. Change the <code>meta_key</code> and <code>meta_value</code> accordingly. The example shown below will  get posts with custom field &#8220;review_type&#8221; with value &#8220;movie&#8221;.</p>
<pre><code>&lt;?php query_posts('meta_key=review_type&amp;meta_value=movie');  ?&gt;
&lt;?php if (have_posts()) : ?&gt;
&lt;?php while (have_posts()) : the_post(); ?&gt;
...
...</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/easily-get-posts-with-a-specific-custom-fieldvalue-on-your-wordpress-blog">WpRecipes</a> <strong>Credits:</strong> <a href="http://www.johnkolbert.com/">John  Kolbert</a></p>
<h3>Get Latest Sticky Posts</h3>
<p>Paste the following code before the loop. This code will retrieve the  5 most recent sticky posts. To change the number of retrieved posts,  just change the 5 by the desired value on line  4.</p>
<pre><code>&lt;?php
	$sticky = get_option('sticky_posts');
	rsort( $sticky );
	$sticky = array_slice( $sticky, 0, 5);
        query_posts( array( 'post__in' =&gt; $sticky, 'caller_get_posts' =&gt; 1 ) );
?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-get-latest-sticky-posts">WpRecipes</a> <strong>Credits:</strong> <a href="http://justintadlock.com/archives/2009/03/28/get-the-latest-sticky-posts-in-wordpress">Justin  Tadlock</a></p>
<h3>Automatically Insert Content In Your Feeds</h3>
<p>In your theme folder, functions.php file, paste the following code.  This code will automatically insert the content after each post in your  RSS feeds. Hence you can use this code to insert ads or promotional  text.</p>
<pre><code>function insertFootNote($content) {
        if(!is_feed() &amp;&amp; !is_home()) {
                $content.= "<span>&lt;<span>h4</span>&gt;</span>Enjoyed this article?<span>&lt;/<span>h4</span>&gt;</span>";
                $content.= "<span>&lt;<span>p</span>&gt;</span>Subscribe to our <span>&lt;<span>a</span><span> href=</span>'#'&gt;</span>RSS feed<span>&lt;/<span>a</span>&gt;</span><span>&lt;/<span>p</span>&gt;</span>";
        }
        return $content;
}
add_filter ('the_content', 'insertFootNote');

</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-automatically-insert-content-after-each-post">WpRecipes</a> <strong>Credits:</strong> <a href="http://www.wordpress-tutoriel.com/tutoriel/comment-inserer-du-texte-automatiquement-apres-chaque-article/">Cédric  Bousmane</a></p>
<h3>Display The Most Commented Posts</h3>
<p>Just paste the following code in your template file where you want to  display the most commented posts (eg. sidebar.php). To change the  number of displayed posts, simply change the 5 on line 3.</p>
<pre><code><span>&lt;<span>h2</span>&gt;</span>Popular Posts<span>&lt;/<span>h2</span>&gt;</span>
<span>&lt;<span>ul</span>&gt;</span>
&lt;?php $result = $wpdb-&gt;get_results("SELECT comment_count,ID,post_title FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0 , 5");
foreach ($result as $post) {
setup_postdata($post);
$postid = $post-&gt;ID;
$title = $post-&gt;post_title;
$commentcount = $post-&gt;comment_count;
if ($commentcount != 0) { ?&gt;

<span>&lt;<span>li</span>&gt;</span><span>&lt;<span>a</span><span> href=<span>"&lt;?php echo get_permalink($postid); ?&gt;"</span></span><span> title=<span>"&lt;?php echo $title ?&gt;"</span></span>&gt;</span>
&lt;?php echo $title ?&gt;<span>&lt;/<span>a</span>&gt;</span> {&lt;?php echo $commentcount ?&gt;}<span>&lt;/<span>li</span>&gt;</span>
&lt;?php } } ?&gt;

<span>&lt;/<span>ul</span>&gt;</span>
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-display-your-most-popular-content-in-your-blog-sidebar">WpRecipes</a> <strong>Credits:</strong> <a href="http://www.problogdesign.com/wordpress/create-your-own-popular-posts-page/">ProBlogDesign</a></p>
<h3>Display Most Commented Posts In 2008</h3>
<pre><code><span>&lt;<span>h2</span>&gt;</span>Most commented posts from 2008<span>&lt;/<span>h2</span>&gt;</span>
<span>&lt;<span>ul</span>&gt;</span>
&lt;?php
$result = $wpdb-&gt;get_results("SELECT comment_count,ID,post_title, post_date FROM $wpdb-&gt;posts WHERE post_date BETWEEN '2008-01-01' AND '2008-12-31' ORDER BY comment_count DESC LIMIT 0 , 10");

foreach ($result as $topten) {
    $postid = $topten-&gt;ID;
    $title = $topten-&gt;post_title;
    $commentcount = $topten-&gt;comment_count;
    if ($commentcount != 0) {
    ?&gt;
         <span>&lt;<span>li</span>&gt;</span><span>&lt;<span>a</span><span> href=<span>"&lt;?php echo get_permalink($postid); ?&gt;"</span></span>&gt;</span>&lt;?php echo $title ?&gt;<span>&lt;/<span>a</span>&gt;</span><span>&lt;/<span>li</span>&gt;</span>

    &lt;?php }
}
?&gt;
<span>&lt;/<span>ul</span>&gt;</span>
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-display-the-most-commented-posts-of-2008">WpRecipes</a></p>
<h3>Display Related Posts Based On Post Tags</h3>
<p>This code will display related posts based on the current post  tag(s). It must be pasted within the loop.</p>
<pre><code>&lt;?php
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post-&gt;ID);
if ($tags) {
  echo 'Related Posts';
  $first_tag = $tags[0]-&gt;term_id;
  $args=array(
    'tag__in' =&gt; array($first_tag),
    'post__not_in' =&gt; array($post-&gt;ID),
    'showposts'=&gt;5,
    'caller_get_posts'=&gt;1
   );
  $my_query = new WP_Query($args);
  if( $my_query-&gt;have_posts() ) {
    while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;

      <span>&lt;<span>p</span>&gt;</span><span>&lt;<span>a</span><span> href=<span>"&lt;?php the_permalink() ?&gt;"</span></span><span> rel=<span>"bookmark"</span></span><span> title=<span>"Permanent Link to &lt;?php the_title_attribute(); ?&gt;"</span></span>&gt;</span>&lt;?php the_title(); ?&gt;<span>&lt;/<span>a</span>&gt;</span><span>&lt;/<span>p</span>&gt;</span>
      &lt;?php
    endwhile;
  }
}
?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-show-related-posts-without-a-plugin">WpRecipes</a> <strong>Credits:</strong> <a href="http://wordpress.org/support/topic/247918">MichaelH</a></p>
<h3>Display The Number Of Search Results</h3>
<p>Open search.php, copy and paste the following code.</p>
<pre><code><span>&lt;<span>h2</span><span> class=<span>"pagetitle"</span></span>&gt;</span>Search Results for &lt;?php /* Search Count */ $allsearch = &amp;new WP_Query("s=$s&amp;showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch-&gt;post_count; _e(''); _e('<span>&lt;<span>span</span><span> class=<span>"search-terms"</span></span>&gt;</span>'); echo $key; _e('<span>&lt;/<span>span</span>&gt;</span>'); _e(' — '); echo $count . ' '; _e('articles'); wp_reset_query(); ?&gt;<span>&lt;/<span>h2</span>&gt;</span>
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-display-the-number-of-results-in-wordpress-search">WpRecipes</a> <strong>Credits:</strong> <a href="http://www.problogdesign.com/wordpress/3-codes-for-a-far-better-wordpress-search-page/">ProBlogDesign</a></p>
<h3>Display The Comment Page Number In The &lt;Title&gt; Tag</h3>
<p>Open the header.php file. Paste the following code in between the <code>&lt;title&gt;</code> tag.</p>
<pre><code>&lt;?php if ( $cpage &lt; 2 ) {}
else { echo (' - comment page '); echo ($cpage);}
?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-avoid-duplicate-content-in-paged-comments">WpRecipes</a> <strong>Credits:</strong> <a href="http://www.malcolmcoles.co.uk/blog/avoid-duplicate-content-paged-comments-wordpress-27/">Malcolm  Coles</a></p>
<h3>Display The Future Posts</h3>
<p>The following code will display 10 future posts.</p>
<pre><code>
	<span>&lt;<span>p</span>&gt;</span>Future events<span>&lt;/<span>p</span>&gt;</span>
	&lt;?php query_posts('showposts=10&amp;post_status=future'); ?&gt;
	&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;

			<span>&lt;<span>p</span>&gt;</span>&lt;?php the_title(); ?&gt; &lt;?php the_time('j. F Y'); ?&gt;<span>&lt;/<span>p</span>&gt;</span>

	&lt;?php endwhile; else: ?&gt;<span>&lt;<span>p</span>&gt;</span>No future posts.<span>&lt;/<span>p</span>&gt;</span>&lt;?php endif; ?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-list-future-posts">WpRecipes</a></p>
<h3>Randomize Posts Order</h3>
<p>To randomize posts order, just add the following code before the  Loop.</p>
<pre><code>query_posts('orderby=rand');
//the Loop here...
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-randomize-posts-order">WpRecipes</a></p>
<h3>Display Word Count Of The Post</h3>
<p>Open single.php and paste the following code where you want to  display the word count.</p>
<pre><code>&lt;?php <span><span>function</span> <span>count_words</span><span>($str)</span>{</span>
     $words = <span>0</span>;
     $str = eregi_replace(<span>" +"</span>, <span>" "</span>, $str);
     $array = explode(<span>" "</span>, $str);
     <span>for</span>($i=<span>0</span>;$i &lt; count($array);$i++)
 	 {
         <span>if</span> (eregi(<span>"[0-9A-Za-zÀ-ÖØ-öø-ÿ]"</span>, $array[$i]))
             $words++;
     }
     <span>return</span> $words;
 }?&gt;

 Word count: &lt;?php echo count_words($post-&gt;post_content); ?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/laura-asked-how-to-get-words-count-of-your-post">WpRecipes</a></p>
<h3>Fetch RSS Feeds</h3>
<p>To display RSS feeds, you can use the WordPress built-in RSS parser.  To do so, include the rss.php file, and then use its <code>wp_rss()</code> function.</p>
<pre><code>&lt;?php include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('http://feeds2.feedburner.com/WebDesignerWall', 5); ?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-display-your-latest-delicious-bookmark-on-your-wordpress-blog">WpRecipes</a></p>
<h3>Highlight Searched Text In Search Results</h3>
<p>Open search.php file and find the <code>the_title()</code> function.  Replace it with the following:</p>
<pre><code>echo $title;</code></pre>
<p>Now, just before the modified line, add this code:</p>
<pre><code>&lt;?php
	$title 	= get_the_title();
	$keys= explode(" ",$s);
	$title 	= preg_replace('/('.implode('|', $keys) .')/iu',
		'<span>&lt;<span>strong</span><span> class=<span>"search-excerpt"</span></span>&gt;</span>\0<span>&lt;/<span>strong</span>&gt;</span>',
		$title);
?&gt;</code></pre>
<p>Then open the style.css file. Add the following line to it:</p>
<pre><code><span>strong</span><span>.search-excerpt</span> <span>{ <span>background</span>:<span> yellow</span>; }</span>
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-enlight-searched-text-in-search-results">WpRecipes</a> <strong>Credits:</strong> <a href="http://yoast.com/wordpress-search/">Joost  de Valk</a></p>
<h3>Display A Greeting Message On A Specific Date (PHP)</h3>
<p>The following code will dispaly a greeting message only on Christmas  day.</p>
<pre><code>&lt;?php
if ((date('m') == 12) &amp;&amp; (date('d') == 25)) { ?&gt;
    <span>&lt;<span>h2</span>&gt;</span>Merry Christmas!<span>&lt;/<span>h2</span>&gt;</span>
&lt;?php } ?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-wish-your-reader-a-merry-christmas">WpRecipes</a></p>
<h3>Automatically Create A TinyURL For Each Post</h3>
<p>Open the functions.php file and paste the following code:</p>
<pre><code><span><span>function</span> <span>getTinyUrl</span><span>($url)</span> {</span>
    $tinyurl = file_get_contents(<span>"http://tinyurl.com/api-create.php?url="</span>.$url);
    <span>return</span> $tinyurl;
}
</code></pre>
<p>In the single.php file, paste the following within the loop where you  want to display the TinyURL:</p>
<pre><code>&lt;?php
$turl = getTinyUrl(get_permalink($post-&gt;ID));
echo 'Tiny Url for this post: <span>&lt;<span>a</span><span> href=<span>"'.$turl.'"</span></span>&gt;</span>'.$turl.'<span>&lt;/<span>a</span>&gt;</span>'
?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-automatically-provide-tinyurls-for-your-wordpress-blog-posts">WpRecipes</a></p>
<h3>Exclude Categories From Search</h3>
<p>Open the search.php file in your theme folder, paste the following  code before the Loop. The code will exclude categories with ID 1, 2, 3  in the search results.</p>
<pre><code>&lt;?php if( is_search() )  :
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("s=$s&amp;paged=$paged&amp;cat=-1,-2,-3");
endif; ?&gt;

//the Loop here...
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-limit-search-to-specific-categories">WpRecipes</a></p>
<h3>Exclude Categories From RSS</h3>
<p>Open the functions.php file from your theme. If your theme doesn’t  have a functions.php file, create one. Paste the following code in it:</p>
<pre><code>&lt;?php <span><span>function</span> <span>myFilter</span><span>($query)</span> {</span>
    <span>if</span> ($query-&gt;is_feed) {
        $query-&gt;set(<span>'cat'</span>,<span>'-5'</span>); <span>//Don't forget to change the category ID =^o^=</span>
    }
<span>return</span> $query;
}

add_filter(<span>'pre_get_posts'</span>,<span>'myFilter'</span>);
?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-exclude-categories-from-your-rss-feed">WpRecipes</a> <strong>Credits:</strong> <a href="http://www.jangro.com/a/2008/03/01/excluding-posts-from-your-blog-feed/"> Scott Jangro</a></p>
<h3>Using Shortcodes</h3>
<p>Open the functions.php file, paste the following code.</p>
<pre><code>&lt;?php <span><span>function</span> <span>wprecipes</span><span>()</span> {</span>
    <span>return</span> <span>'Have you checked out WpRecipes today?'</span>;
}

add_shortcode(<span>'wpr'</span>, <span>'wprecipes'</span>);
?&gt;
</code></pre>
<p>You’re now able to use the <em>wpr</em> shortcode. To do so, paste  the following line of code on the editor (in HTML mode) while writing a  post:</p>
<pre><code>[wpr]</code></pre>
<p>This short code will output the “Have you checked out WpRecipes  today?” message.</p>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-save-time-by-using-wordpress-shortcodes">WpRecipes</a> <strong>Source:</strong> <a href="http://codex.wordpress.org/Shortcode_API">Codex</a></p>
<h3>Display The Number Of Your Twitter Followers</h3>
<p>Paste the code anywhere you want to display the Twitter follower  count. Replace &#8220;YourUserID&#8221; with your Twitter account in last line.</p>
<pre><code>&lt;?php <span><span>function</span> <span>string_getInsertedString</span><span>($long_string,$short_string,$is_html=false)</span>{</span>
  <span>if</span>($short_string&gt;=strlen($long_string))<span>return</span> <span>false</span>;
  $insertion_length=strlen($long_string)-strlen($short_string);
  <span>for</span>($i=<span>0</span>;$i&lt;strlen($short_string);++$i){
    <span>if</span>($long_string[$i]!=$short_string[$i])<span>break</span>;
  }
  $inserted_string=substr($long_string,$i,$insertion_length);
  <span>if</span>($is_html &amp;&amp; $inserted_string[$insertion_length-<span>1</span>]==<span>'&lt;'</span>){
    $inserted_string=<span>'&lt;'</span>.substr($inserted_string,<span>0</span>,$insertion_length-<span>1</span>);
  }
  <span>return</span> $inserted_string;
}

<span><span>function</span> <span>DOMElement_getOuterHTML</span><span>($document,$element)</span>{</span>
  $html=$document-&gt;saveHTML();
  $element-&gt;parentNode-&gt;removeChild($element);
  $html2=$document-&gt;saveHTML();
  <span>return</span> string_getInsertedString($html,$html2,<span>true</span>);
}

<span><span>function</span> <span>getFollowers</span><span>($username)</span>{</span>
  $x = file_get_contents(<span>"http://twitter.com/"</span>.$username);
  $doc = <span>new</span> DomDocument;
  @$doc-&gt;loadHTML($x);
  $ele = $doc-&gt;getElementById(<span>'follower_count'</span>);
  $innerHTML=preg_replace(<span>'/^&lt;[^&gt;]*&gt;(.*)&lt;[^&gt;]*&gt;$/'</span>,<span>"<span>\\</span>1"</span>,DOMElement_getOuterHTML($doc,$ele));
  <span>return</span> $innerHTML;
}
?&gt;

&lt;?php echo getFollowers(<span>"YourUserID"</span>).<span>" followers"</span>; ?&gt;
</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/display-the-total-number-of-your-twitter-followers-on-your-wordpress-blog">WpRecipes</a></p>
<h3>Display FeedBurner Subscriber Count In Text</h3>
<pre><code>&lt;?php
	$fburl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=feed-id";
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_URL, $fburl);
	$stored = curl_exec($ch);
	curl_close($ch);
	$grid = new SimpleXMLElement($stored);
	$rsscount = $grid-&gt;feed-&gt;entry['circulation'];
	echo $rsscount;
?&gt;</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-display-your-feedburner-count-in-full-text">WpRecipes</a></p>
<h3>Display The Latest Twitter Entry</h3>
<p>Just paste this code in the template file (eg. sidebar.php) where you  want to display the latest tweet.</p>
<pre><code>&lt;?php

// Your twitter username.
$username = "TwitterUsername";

$prefix = "<span>&lt;<span>h2</span>&gt;</span>My last Tweet<span>&lt;/<span>h2</span>&gt;</span>";

$suffix = "";

$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&amp;rpp=1";

function parse_feed($feed) {
    $stepOne = explode("<span>&lt;content<span> type=</span>\"<span>html</span>\"&gt;</span>", $feed);
    $stepTwo = explode("<span>&lt;/content&gt;</span>", $stepOne[1]);
    $tweet = $stepTwo[0];
    $tweet = str_replace("&amp;lt;", "&lt;", $tweet);
    $tweet = str_replace("&amp;gt;", "&gt;", $tweet);
    return $tweet;
}

$twitterFeed = file_get_contents($feed);
echo stripslashes($prefix) . parse_feed($twitterFeed) . stripslashes($suffix);
?&gt;</code></pre>
<p><strong>Via:</strong> <a href="http://www.wprecipes.com/how-to-display-your-latest-twitter-entry-on-your-wp-blog">WpRecipes</a> <strong>Credits:</strong> <a href="http://scriptplayground.com/tutorials/php/Latest-Twitter-Update-With-PHP/"> Ryan Barr</a></p>
<h3>Social Buttons</h3>
<h4>Facebook Share Button</h4>
<pre><code><span>&lt;<span>a</span><span> href=<span>"http://www.facebook.com/sharer.php?u=&lt;?php the_permalink();?&gt;&amp;t=&lt;?php the_title(); ?&gt;"</span></span>&gt;</span>Share on Facebook<span>&lt;/<span>a</span>&gt;</span></code></pre>
<h4>Digg it</h4>
<pre><code><span>&lt;<span>a</span><span> href=<span>"http://www.digg.com/submit?phase=2&amp;url=&lt;?php the_permalink();?&gt;"</span></span>&gt;</span>Digg It<span>&lt;/<span>a</span>&gt;</span></code></pre>
<h4>Stumble upon it</h4>
<pre><code><span>&lt;<span>a</span><span> href=<span>"http://www.stumbleupon.com/submit?url=&lt;?php the_permalink(); ?&gt;&amp;title=&lt;?php the_title(); ?&gt;"</span></span>&gt;</span>Stumble upon it<span>&lt;/<span>a</span>&gt;</span></code></pre>
<h4>Add to delicious</h4>
<pre><code><span>&lt;<span>a</span><span> href=<span>"http://delicious.com/post?url=&lt;?php the_permalink();?&gt;&amp;title=&lt;?php the_title();?&gt;"</span></span>&gt;</span>Add to delicious<span>&lt;/<span>a</span>&gt;</span></code></pre>
<h4>Share on technorati</h4>
<pre><code><span>&lt;<span>a</span><span> href=<span>"http://technorati.com/faves?sub=addfavbtn&amp;add=&lt;?php the_permalink();?&gt;"</span></span>&gt;</span>Share on technorati<span>&lt;/<span>a</span>&gt;</span></code></pre>
<h4>Tweet this</h4>
<pre><code><span>&lt;<span>a</span><span> href=<span>"http://twitter.com/home?status=Currently reading &lt;?php the_permalink(); ?&gt;"</span></span>&gt;</span>Tweet this<span>&lt;/<span>a</span>&gt;</span></code></pre>


<p>Related posts:<ol><li><a href='http://www.mikewagan.net/2009/09/10-plugins-to-make-wordpress-a-great-cm/' rel='bookmark' title='Permanent Link: 10 Plugins to Make WordPress a Great CMS'>10 Plugins to Make WordPress a Great CMS</a> <small>I&#8217;ve been using the blogging platform, WordPress, as a CMS for the company I&#8217;m working with right now because I...</small></li><li><a href='http://www.mikewagan.net/2009/11/search-and-replace-in-mysql/' rel='bookmark' title='Permanent Link: Search and Replace in MySQL'>Search and Replace in MySQL</a> <small>I just went through a domain transfer for one of our websites, and the links in the posts are all...</small></li><li><a href='http://www.mikewagan.net/2009/12/100-new-free-but-premium-like-wordpress-themes/' rel='bookmark' title='Permanent Link: 100 New Free but Premium-like WordPress Themes'>100 New Free but Premium-like WordPress Themes</a> <small>If you&#8217;re a Worpress Theme addict and you&#8217;ve not yet visited this post, I suggest you do because these are...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.mikewagan.net/2010/04/20-wordpress-codes-you-might-need-on-your-next-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>100 New Free but Premium-like WordPress Themes</title>
		<link>http://www.mikewagan.net/2009/12/100-new-free-but-premium-like-wordpress-themes/</link>
		<comments>http://www.mikewagan.net/2009/12/100-new-free-but-premium-like-wordpress-themes/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 13:01:51 +0000</pubDate>
		<dc:creator>Mike Wagan</dc:creator>
				<category><![CDATA[Web Design Resources]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.mikewagan.net/?p=302</guid>
		<description><![CDATA[If you&#8217;re a Worpress Theme addict and you&#8217;ve not yet visited this post, I suggest you do because these are some of the best Premium-like WordPress Themes available. I&#8217;ve gone through the list, and 90% of it I really like. Especially the themes Magiting, Matiyaga, Mainam and Marangal from Padd Solutions (a fellow Pinoy web [...]


Related posts:<ol><li><a href='http://www.mikewagan.net/2009/09/10-plugins-to-make-wordpress-a-great-cm/' rel='bookmark' title='Permanent Link: 10 Plugins to Make WordPress a Great CMS'>10 Plugins to Make WordPress a Great CMS</a> <small>I&#8217;ve been using the blogging platform, WordPress, as a CMS for the company I&#8217;m working with right now because I...</small></li><li><a href='http://www.mikewagan.net/2010/04/20-wordpress-codes-you-might-need-on-your-next-project/' rel='bookmark' title='Permanent Link: 20+ WordPress Codes You Might Need On Your Next Project'>20+ WordPress Codes You Might Need On Your Next Project</a> <small>Undeniably, WordPress has been a premiere choice by web designers and internet publishers as their main blogging platform. One of...</small></li><li><a href='http://www.mikewagan.net/2008/10/my-first-0-18-from-adsene/' rel='bookmark' title='Permanent Link: My First $0.18 from AdSene'>My First $0.18 from AdSene</a> <small>Its been almost 1 month since I started blogging here at my main blog. I also have side projects like...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" title="100 Free Premium WordPress Themes" src="http://www.1stwebdesigner.com/wp-content/uploads/2009/12/100-wordpress-themes-2009/touch-river-free-premium-wordpress-theme.jpg" alt="" width="509" height="354" /></p>
<p>If you&#8217;re a Worpress Theme addict and you&#8217;ve not yet visited this post, I suggest you do because these are some of the best Premium-like WordPress Themes available. I&#8217;ve gone through the list, and 90% of it I really like. Especially the themes Magiting, Matiyaga, Mainam and Marangal from <a href="http://www.paddsolutions.com" target="_blank">Padd Solutions</a> (a fellow Pinoy web development firm). I&#8217;ve already bookmarked it, and I think you should too. Here are some of the WordPress themes I plan to use in my future projects:<span id="more-302"></span><br />

<center>
<table><tr><td>
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 336x280, created 8/4/09 mikewagan.net */
google_ad_slot = "3873552827";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td><td>
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 160x90, created 10/8/09 mikewagan.net */
google_ad_slot = "0020347340";
google_ad_width = 160;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 160x90, created 10/8/09 mikewagan.net */
google_ad_slot = "0020347340";
google_ad_width = 160;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td></tr></table>
</center>
</p>
<p><strong>Folio Elements WordPress Theme</strong></p>
<p><a href="http://www.press75.com/the-folio-elements-wordpress-theme/"><img class="aligncenter" title="Folio Elements WordPress Theme" src="http://www.1stwebdesigner.com/wp-content/uploads/2009/12/100-wordpress-themes-2009/folio-elements-free-premium-wordpress-theme.jpg" alt="" width="509" height="322" /></a></p>
<p>I really like this theme. Simple, minimalist, dark Portfolio wordpress theme. I plan to use this for my design portfolio with some modifications.</p>
<p><strong>Vodpod WordPress Theme</strong></p>
<p><a href="http://www.press75.com/the-vodpod-wordpress-theme/"><img class="aligncenter" title="Vodpod Free WordPress Theme" src="http://www.1stwebdesigner.com/wp-content/uploads/2009/12/100-wordpress-themes-2009/vodpod-free-premium-wordpress-theme.jpg" alt="" width="508" height="344" /></a><strong></strong></p>
<p><strong>Moneyblog WordPress Theme</strong></p>
<p><a href="http://designdisease.com/blog/money-theme-released/"><img class="aligncenter" title="Moneyblog WordPress Theme" src="http://www.1stwebdesigner.com/wp-content/uploads/2009/12/100-wordpress-themes-2009/moneyblog-free-premium-wordpress-theme.jpg" alt="" width="508" height="351" /></a></p>
<p>The Moneyblog theme is really cool. I like the color green &#8211; definitely the color of money! I&#8217;m using this on my <a href="http://seo.mikewagan.net">Random blog</a> right now. Works great!</p>
<p>There are a lot more great wordpress themes listed on the original post. Do visit <a href="http://www.1stwebdesigner.com/wordpress/premium-free-fresh-wordpress-themes-year-2009/" target="_blank">1st Web Designer</a> for the complete list!</p>


<p>Related posts:<ol><li><a href='http://www.mikewagan.net/2009/09/10-plugins-to-make-wordpress-a-great-cm/' rel='bookmark' title='Permanent Link: 10 Plugins to Make WordPress a Great CMS'>10 Plugins to Make WordPress a Great CMS</a> <small>I&#8217;ve been using the blogging platform, WordPress, as a CMS for the company I&#8217;m working with right now because I...</small></li><li><a href='http://www.mikewagan.net/2010/04/20-wordpress-codes-you-might-need-on-your-next-project/' rel='bookmark' title='Permanent Link: 20+ WordPress Codes You Might Need On Your Next Project'>20+ WordPress Codes You Might Need On Your Next Project</a> <small>Undeniably, WordPress has been a premiere choice by web designers and internet publishers as their main blogging platform. One of...</small></li><li><a href='http://www.mikewagan.net/2008/10/my-first-0-18-from-adsene/' rel='bookmark' title='Permanent Link: My First $0.18 from AdSene'>My First $0.18 from AdSene</a> <small>Its been almost 1 month since I started blogging here at my main blog. I also have side projects like...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.mikewagan.net/2009/12/100-new-free-but-premium-like-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>5 Amazing Online Image Editors For Designers</title>
		<link>http://www.mikewagan.net/2009/11/5-amazing-online-image-editors-for-designers/</link>
		<comments>http://www.mikewagan.net/2009/11/5-amazing-online-image-editors-for-designers/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 19:57:08 +0000</pubDate>
		<dc:creator>Mike Wagan</dc:creator>
				<category><![CDATA[Web Design Resources]]></category>
		<category><![CDATA[online image editors]]></category>

		<guid isPermaLink="false">http://www.mikewagan.net/?p=270</guid>
		<description><![CDATA[About 10 years ago, I used to crop my images using MS Paint because either image editing software were expensive or my slow computer cannot compliment the requirements of Adobe Photoshop 1. But nowadays online image editors are now available, and they are far more better than p..p..Paint. Here are 5 online image editors that [...]


Related posts:<ol><li><a href='http://www.mikewagan.net/2009/11/what-happens-to-your-online-accounts-when-you-die/' rel='bookmark' title='Permanent Link: What Happens to Your Online Accounts When You Die'>What Happens to Your Online Accounts When You Die</a> <small>You&#8217;re a web designer, you have 22 Gmail accounts, 13 Yahoo Messenger accounts, 50,000 MySpace contacts and 26,000 Facebook friends....</small></li><li><a href='http://www.mikewagan.net/2009/06/4-free-tools-to-add-watermarks-to-images/' rel='bookmark' title='Permanent Link: 4 Free Tools To Add Watermarks To Images or Pictures'>4 Free Tools To Add Watermarks To Images or Pictures</a> <small>One popular way to avoid people stealing your online pictures is by adding a watermark on them; those translucent texts...</small></li><li><a href='http://www.mikewagan.net/2009/08/thank/' rel='bookmark' title='Permanent Link: Thanks'>Thanks</a> <small>I&#8217;ve been in the Internet industry for almost 4 years now. I&#8217;ve worked as a C &amp; PHP programmer, a...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-271" title="online-image-editors" src="http://www.mikewagan.net/wp-content/uploads/2009/11/sumo-paint.jpg" alt="online-image-editors" width="480" height="168" /></p>
<p>About 10 years ago, I used to crop my images using MS Paint because either image editing software were expensive or my slow computer cannot compliment the requirements of Adobe Photoshop 1. But nowadays <strong>online image editors</strong> are now available, and they are far more better than p..p..Paint. Here are 5 online image editors that designers should bookmark.<span id="more-270"></span><br />

<center>
<table><tr><td>
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 336x280, created 8/4/09 mikewagan.net */
google_ad_slot = "3873552827";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td><td>
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 160x90, created 10/8/09 mikewagan.net */
google_ad_slot = "0020347340";
google_ad_width = 160;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4709798263732366";
/* 160x90, created 10/8/09 mikewagan.net */
google_ad_slot = "0020347340";
google_ad_width = 160;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td></tr></table>
</center>
<br />
Web Resourece Depot has a great article about the pros and cons of using <strong>online image editors</strong>. And they listed out 5 great image editors available online:</p>
<ul>
<li><a href="http://www.sumopaint.com/" target="_blank">SumoPaint</a></li>
<li><a href="http://aviary.com/tools/phoenix" target="_blank">Aviary Phoenix</a></li>
<li><a href="https://www.photoshop.com/">Photoshop.com</a></li>
<li><a href="http://www.pixlr.com/">Pixlr</a></li>
<li><a href="http://www.splashup.com/">Splashup</a></li>
</ul>
<p>Some of them have a similar look and feel as Photoshop, and can integrate with other online photo sharing services like Flickr and Picasa.</p>
<p>For brief descriptions, screenshots, and pros &amp; cons of these great <strong>online image editors</strong>, visit this post at <a href="http://www.webresourcesdepot.com/online-image-editors-why-to-use-them-and-5-amazing-ones-for-designers/" target="_blank">Web Resource Depot</a>.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 83px; width: 1px; height: 1px;">https://www.photoshop.com/PPho</div>


<p>Related posts:<ol><li><a href='http://www.mikewagan.net/2009/11/what-happens-to-your-online-accounts-when-you-die/' rel='bookmark' title='Permanent Link: What Happens to Your Online Accounts When You Die'>What Happens to Your Online Accounts When You Die</a> <small>You&#8217;re a web designer, you have 22 Gmail accounts, 13 Yahoo Messenger accounts, 50,000 MySpace contacts and 26,000 Facebook friends....</small></li><li><a href='http://www.mikewagan.net/2009/06/4-free-tools-to-add-watermarks-to-images/' rel='bookmark' title='Permanent Link: 4 Free Tools To Add Watermarks To Images or Pictures'>4 Free Tools To Add Watermarks To Images or Pictures</a> <small>One popular way to avoid people stealing your online pictures is by adding a watermark on them; those translucent texts...</small></li><li><a href='http://www.mikewagan.net/2009/08/thank/' rel='bookmark' title='Permanent Link: Thanks'>Thanks</a> <small>I&#8217;ve been in the Internet industry for almost 4 years now. I&#8217;ve worked as a C &amp; PHP programmer, a...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.mikewagan.net/2009/11/5-amazing-online-image-editors-for-designers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
