<?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>Just Another Dang Blog &#187; Wordpress</title>
	<atom:link href="http://blog.lopau.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lopau.com</link>
	<description>A tech blog about web development, graphic designs, freelancing, cloud computing, mobile development, innovations and seo.</description>
	<lastBuildDate>Thu, 06 Oct 2011 03:01:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Create rewrite rules for friendly url for WordPress plugin custom queries</title>
		<link>http://blog.lopau.com/create-rewrite-rules-for-friendly-url-for-wordpress-plugin-custom-queries/</link>
		<comments>http://blog.lopau.com/create-rewrite-rules-for-friendly-url-for-wordpress-plugin-custom-queries/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 05:23:42 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rewrite rules]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1473</guid>
		<description><![CDATA[I have this personal web application that was built from scratch last year and has already been considerably indexed by google. I used some Apache mod rewrite to make the urls friendly. Last week I decided it would be faster/easier to jumpstart the project again if I just focus on my application and just use [...]]]></description>
			<content:encoded><![CDATA[<p>I have this personal web application that was built from scratch last year and has already been considerably indexed by google. I used some Apache mod rewrite to make the urls friendly. Last week I decided it would be faster/easier to jumpstart the project again if I just focus on my application and just use a framework to handle other intracacies like abstractions, security and etc. I was aiming for CodeIgniter but got a glimpse on BuddyPress for WordPress(not a framework) which has most of the features I want for my app. So long story short I ended up porting my application to be a plugin for WordPress.</p>
<p><span id="more-1473"></span></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
<br />
One thing that got me stuck for awhile was how to recreate my old URLs. Posting some tips for an example on how I got the issue solved.</p>
<p>Target: Make WordPress rewrite this URLs</p>
<blockquote>
<p>http://www.thesite.com/mypage/food/</p>
<p>to </p>
<p>http://www.thesite.com/mypage/?ingredients=food</p>
<p>http://www.thesite.com/mypage/food/asia/</p>
<p>to </p>
<p>http://www.thesite.com/mypage/?ingredients=food&#038;origin=asia</p>
</blockquote>
<p>1. Create your plugin and create a shortcode </p>
<blockquote>
<p>(eg. add_shortcode(&#8216;myapp&#8217;, &#8216;myfunction&#8217;); )</p>
</blockquote>
<p>2. Create a new Page and add the shortcode </p>
<blockquote>
<p>[myapp]</p>
</blockquote>
<p>With Permalinks off your page looks like</p>
<blockquote><p>http://www.thesite.com/?page_id=5</p></blockquote>
<p>And is basically the same as </p>
<blockquote><p>http://www.thesite.com/index.php?page_id=5</p></blockquote>
<p>With Permalinks on</p>
<blockquote><p>http://www.thesite.com/mypage/</p></blockquote>
<p>3. If you pass a query on your app the URL may look like this, Im passing the queries on the URL</p>
<blockquote><p>http://www.thesite.com/mypage/?ingredients=food</p></blockquote>
<p>or</p>
<blockquote><p>http://www.thesite.com/mypage/?ingredients=food&#038;origin=asia</p></blockquote>
<p>Depending on the queries passed the contents on your page changes.</p>
<p>4. Now to rewrite the URLs to be friendly you need to add a filter and use query_vars</p>
<blockquote>
<p>add_filter(&#8216;query_vars&#8217;, &#8216;my_query_vars&#8217;);<br />
function my_query_vars($public_query_vars) {<br />
	$public_query_vars[] = &#8220;ingredients&#8221;;<br />
	$public_query_vars[] = &#8220;origin&#8221;;<br />
	return $public_query_vars;<br />
}</p>
</blockquote>
<p>This ensure that when WordPress parses the URL, the <em>ingredients </em> and <em>origin </em> gets saved in the query variables.</p>
<p>4. Next is create your rewrite rules and store in an array</p>
<blockquote><p>
add_filter(&#8216;generate_rewrite_rules&#8217;, &#8216;my_rewrite&#8217;);</p>
<p>function my_rewrite($wp_rewrite) {<br />
	$wp_rewrite->rules =<br />
	array_merge(array<br />
	(<br />
	&#8216;^mypage/([^/]+)/?$&#8217; => &#8216;index.php?page_id=5e&#038;ingredients=$matches[1]&#8216;,<br />
	&#8216;^mypage/([^/]+)/([^/]+)/?$&#8217; => &#8216;index.php?page_id=5&#038;ingredients=$matches[1]&#038;origin=$matches[2]&#8216;</p>
<p>	), $wp_rewrite->rules);<br />
}
</p></blockquote>
<p>Note: That you are rewriting to the original URL of the page. You are storing each rewrite rule to an array and finally adding them to a filter by generate_rewrite_rules.</p>
<p>5. To get the variables back just call the get_query_vars function on your plugin.</p>
<blockquote><p>echo get_query_var(&#8216;ingredients&#8217;); </p></blockquote>
<p>So this is how I got my problem solved. Hopefully it would be a great help to others. Happy rewriting and coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/create-rewrite-rules-for-friendly-url-for-wordpress-plugin-custom-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.6.5 released</title>
		<link>http://blog.lopau.com/wordpress-265-released/</link>
		<comments>http://blog.lopau.com/wordpress-265-released/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 05:56:31 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=357</guid>
		<description><![CDATA[WordPress latest update 2.6.5 has been released,this fixes several security issues like XSS exploits for IP based virtual servers running Apache 2.x. Official release From 2.6.3 version there are no 2.6.4 release and there never will be. Go update now.]]></description>
			<content:encoded><![CDATA[<p>WordPress latest update 2.6.5 has been released,this fixes several security issues like XSS exploits for IP based virtual servers running Apache 2.x.</p>
<p><a href="http://wordpress.org/development/2008/11/wordpress-265/">Official release </a></p>
<p>From 2.6.3 version there are no 2.6.4 release and there never will be. Go update now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/wordpress-265-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress error- Is its parent directory writable by the server?</title>
		<link>http://blog.lopau.com/wordpress-error-is-its-parent-directory-writable-by-the-server/</link>
		<comments>http://blog.lopau.com/wordpress-error-is-its-parent-directory-writable-by-the-server/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 17:52:24 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=310</guid>
		<description><![CDATA[Been using WordPress now for about 4 months on my projects and I occasionally find problems with plugins and themes but not on WordPress itself. I seem to be getting good at troubleshooting some. Yesterday my host changed servers, then I upgraded to the latest version of WordPress and everything got whack on uploading images [...]]]></description>
			<content:encoded><![CDATA[<p>Been using WordPress now for about 4 months on my projects and I occasionally find problems with plugins and themes but not on WordPress itself. I seem to be getting good at troubleshooting some.</p>
<p>Yesterday my host changed servers, then I upgraded to the latest version of WordPress and everything got whack on uploading images in the admin with this error.<br />
<span id="more-310"></span></p>
<blockquote><p>Unable to create directory /home/username/public_html/wp-content/uploads/2008/05. Is its parent directory writable by the server?</p></blockquote>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
Most people encounter the error after upgrading WordPress or changing servers</p>
<p>Here are troubleshooting steps you can do.<br />
1. With the error above, it can be assumed it is a permission problem with the folder. Default is 755, With your FTP software or WebFTP, edit the uploads folder in the wp-content to 777. Then try again.</p>
<p>2. If that doesn&#8217;t work, it can be an ownership issue. Wherein the owner of the files is apache and not your user account.</p>
<p>If you have access to SSH, you can edit the file to change ownership to</p>
<p>chown -R username:apache_user /home/username/public_html/wp-content/</p>
<p>username:apache_user for me is the ftp account, others are different.</p>
<p>3. If this doesn&#8217;t work. Check the upload path in the admin &#8211; Settings &#8211; Miscellaneous and make sure it is wp-content/uploads sometimes the upgrade or  server move changes it to the absolute path.</p>
<p>The 3rd solution worked for me. Hope you find this useful</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/wordpress-error-is-its-parent-directory-writable-by-the-server/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Was codex.wordpress.org hacked?</title>
		<link>http://blog.lopau.com/was-codexwordpressorg-hacked/</link>
		<comments>http://blog.lopau.com/was-codexwordpressorg-hacked/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 04:06:02 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=282</guid>
		<description><![CDATA[I visited the codex for wordpress yesterday and saw the front page populated/injected with chinese characters linking to a particular website, I checked on Firefox, Chrome and IE to make sure it is not an issue with my PC or cookies. But today it seems all has returned back to normal. Check out the screenshot [...]]]></description>
			<content:encoded><![CDATA[<p>I visited the codex for wordpress yesterday and saw the front page populated/injected with chinese characters linking to a particular website, I checked on Firefox, Chrome and IE to make sure it is not an issue with my PC or cookies.</p>
<p>But today it seems all has returned back to normal. Check out the screenshot I took yesterday.</p>
<div id="attachment_284" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.lopau.com/wp-content/uploads/2008/10/hacked.jpg"><img class="size-medium wp-image-284" title="hacked" src="http://blog.lopau.com/wp-content/uploads/2008/10/hacked-300x233.jpg" alt="Wordpress Codex showing Cantonese links on front page" width="300" height="233" /></a><p class="wp-caption-text">Wordpress Codex showing Cantonese links on front page</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/was-codexwordpressorg-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Firefox add-ons for screen capture</title>
		<link>http://blog.lopau.com/wordpress-firefox-add-ons-for-screen-capture/</link>
		<comments>http://blog.lopau.com/wordpress-firefox-add-ons-for-screen-capture/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 16:53:08 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[firefox addons]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=278</guid>
		<description><![CDATA[Recently I needed a screen capture addon for Firefox for a WordPress project I was working on. What I needed was an easy way to capture a screen then save the screenshot easily without using Photoshop or Paint for the task. I then have to upload the capture to my wordpress post. I found out [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed a screen capture addon for Firefox for a WordPress project I was working on. What I needed was an easy way to capture a screen then save the screenshot easily without using Photoshop or Paint for the task. I then have to upload the capture to my wordpress post.</p>
<p><span id="more-278"></span></p>
<p>I found out <a href="http://screenshot-program.com/fireshot/" target="_blank">Fireshot Pro</a> to do what I needed, it offers more than the usual screen capture for it has an option to save, upload and edit the screenshot with the built in editing tools. So far so good but seems this takes several steps. Just when I was about to live on and use it for my project, I found another tool that simplifies the task further. This has got to be the best addon for WordPress, it is specifically created to work for wordpress. Currently it is experiemental but it works great. <a href="https://addons.mozilla.org/en-US/firefox/addon/8204" target="_blank">Screen Grab for WordPress.</a></p>
<p><img class="aligncenter size-medium wp-image-279" title="screen-grab" src="http://blog.lopau.com/wp-content/uploads/2008/10/screen-grab.jpg" alt="" width="200" height="100" /></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
With this addon I was able to capture a screenshot of the page I want and can do a selection. The best thing is that it allows posting to your WordPress using XML-RPC.</p>
<blockquote><p>What is XML-RPC?  From wiki pedia It is a <a title="Remote procedure call" href="http://en.wikipedia.org/wiki/Remote_procedure_call">remote procedure call</a> protocol which uses <a title="XML" href="http://en.wikipedia.org/wiki/XML">XML</a> to encode its calls and <a class="mw-redirect" title="HTTP" href="http://en.wikipedia.org/wiki/HTTP">HTTP</a> as a transport mechanism.</p></blockquote>
<p>4 things I needed to do to get setup.</p>
<p>1. Download the addon and restart Firefox</p>
<p>2. Go to Tools and choose Addons, select Screen Grab, then hit Options, Setup the blog details, fill in the blog URL, username and password. Cool thing is it allows adding multiple blogs.</p>
<p>3. Next signed in to your admin in WordPress. I went to settings then  Reading, checked the option Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols then save.</p>
<p>4. With that option enabled, when using Screen Grab for WordPress, simply right click on a page then choose Screen Grab! With Online Upload, then select either Save, Copy or Post. I used Post then Selection and select the image or text I wanted to capture and use in my blog post. After that select the blog where to post to. It automatically generates the post and uploaded the image to my upload folder plus generated a title for my post.</p>
<p>It made my wordpress project site a breeze to update. Hope you find it useful too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/wordpress-firefox-add-ons-for-screen-capture/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress parse error: syntax error on PHP 5.2.x</title>
		<link>http://blog.lopau.com/wordpress-parse-error-syntax-error-on-php-52x/</link>
		<comments>http://blog.lopau.com/wordpress-parse-error-syntax-error-on-php-52x/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 16:19:25 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=221</guid>
		<description><![CDATA[Here is a short WordPress troubleshooting tutorial for theme tweaking. A theme I&#8217;m working on runs fine and was tested on PHP 4.3.x locally in my machine, I tried testing on PHP 5.2.x and I immediately encountered syntax error on WordPress. Traced the problem to be inside the Loop in WordPress. Sharing it here for [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a short WordPress troubleshooting tutorial for theme tweaking.</p>
<p>A theme I&#8217;m working on runs fine and was tested on PHP 4.3.x locally in my machine, I tried testing on PHP 5.2.x and I immediately encountered syntax error on WordPress. Traced the problem to be inside the Loop in WordPress. Sharing it here for those having hard time making their themes work on their host.</p>
<p><span id="more-221"></span><br />

<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
<br />
If you are getting these PHP Token errors like the following:</p>
<blockquote><p><strong>Parse error</strong>:  syntax error, unexpected T_ENDWHILE</p></blockquote>
<blockquote><p><strong>Parse error</strong>:  syntax error, unexpected T_ELSE</p></blockquote>
<blockquote><p><strong>Parse error</strong>:  syntax error, unexpected T_ENDIF</p></blockquote>
<p>Solution: check your if/else or while scripts and modify them accordingly to confirm to WordPress or your initial PHP tags.</p>
<p>Example script courtesy of <a href="http://theundersigned.net/2006/03/wordpress-change-look-of-every-second-post/">undersigned.net</a>, This code changes every other post to their own css tags. This runs fine and tested on PHP 4.3.x only</p>
<blockquote><p>&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post();</p>
<p>$loopcounter++; ?&gt;</p>
<p>&lt;div class=“post”&gt;</p>
<p>&lt;?php if ($loopcounter % 2 == 0) { ?&gt;</p>
<p>&lt;h1 class=“even”&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;</p>
<p>&lt;?php } else { ?&gt;</p>
<p>&lt;h1 class=“odd”&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;</p>
<p>&lt;? } ?&gt;</p>
<p>&lt;?php the_content(); ?&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;?php endwhile; ?&gt;</p></blockquote>
<p>You used the if/else normal php codes inside the WordPress loop tag. Make a strict code by simply changing your if/else to WordPress tags to make it work on PHP 5.2.x.</p>
<blockquote><p>&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post();</p>
<p>$loopcounter++; ?&gt;</p>
<p>&lt;div class=“post”&gt;</p>
<p>&lt;?php if ($loopcounter % 2 == 0) : ?&gt;</p>
<p>&lt;h1 class=“even”&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;</p>
<p>&lt;?php else : ?&gt;</p>
<p>&lt;h1 class=“odd”&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;</p>
<p>&lt;? endif; ?&gt;</p>
<p>&lt;?php the_content(); ?&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;?php endwhile; ?&gt;</p></blockquote>
<p>That&#8217;s it, issue fixed! It should be similar to other scripts using similar coding style and not just to WordPress. Happy theme tweaking!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/wordpress-parse-error-syntax-error-on-php-52x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress post supplemental on googlebots</title>
		<link>http://blog.lopau.com/wordpress-post-supplemental-on-googlebots/</link>
		<comments>http://blog.lopau.com/wordpress-post-supplemental-on-googlebots/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 03:05:40 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=16</guid>
		<description><![CDATA[It appears straight out WordPress installation needs to be prepped up for Google&#8217;s policy on duplicate content. I notice that I showed up in Google search results on the top pages for particular keywords but suddenly all results for the same keywords just dropped out of Google&#8217;s search results. Reason behind is because of the [...]]]></description>
			<content:encoded><![CDATA[<p>It appears straight out WordPress installation needs to be prepped up for Google&#8217;s policy on duplicate content. I notice that I showed up in Google search results on the top pages for particular keywords but suddenly all results for the same keywords just dropped out of Google&#8217;s search results. Reason behind is because of the duplicate content in the WordPress post that is being picked up by the googlebots.</p>
<p><span id="more-16"></span></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
Nice post about this issue here <a href="http://www.vanseodesign.com/blog/seo/wordpress-supplemental-index/">Problems With WordPress Posts Going Supplemental In Google’s Index</a>. And found a solution by downloading this plugin here <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All In One SEO Pack</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/wordpress-post-supplemental-on-googlebots/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

