<?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>DavidTiong.com</title>
	<atom:link href="http://www.davidtiong.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidtiong.com</link>
	<description>Business and Pleasure</description>
	<lastBuildDate>Fri, 24 May 2013 14:52:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Add Gravatar image to Accounts page in Opencart</title>
		<link>http://www.davidtiong.com/add-gravatar-image-to-accounts-page-in-opencart/</link>
		<comments>http://www.davidtiong.com/add-gravatar-image-to-accounts-page-in-opencart/#comments</comments>
		<pubDate>Fri, 24 May 2013 14:23:24 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Opencart]]></category>
		<category><![CDATA[free VQMOD file]]></category>
		<category><![CDATA[gravatar]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1486</guid>
		<description><![CDATA[&#160; Recently I had an enquiry on how to add a customer&#8217;s Gravatar image to their Account page in Opencart. With a little bit of research I found out that...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting"><img class="aligncenter size-full wp-image-1499 image-shadow-style" alt="add gravatar to opencart account page" src="http://www.davidtiong.com/wp-content/uploads/2013/05/gravatar-opencart-account-page.jpg" width="519" height="425" /></p>
<p>&nbsp;<br />
Recently I had an enquiry on how to add a customer&#8217;s Gravatar image to their Account page in Opencart. With a little bit of research I found out that you can &#8220;get&#8221; the following customer details:</p>
<pre class="brush: php; title: ; notranslate">
    $this-&gt;customer-&gt;isLogged()
    $this-&gt;customer-&gt;getId()
    $this-&gt;customer-&gt;getFirstName()
    $this-&gt;customer-&gt;getLastName()
    $this-&gt;customer-&gt;getEmail()
    $this-&gt;customer-&gt;getTelephone()
    $this-&gt;customer-&gt;getFax()
    $this-&gt;customer-&gt;getNewsletter()
    $this-&gt;customer-&gt;getCustomerGroupId()
    $this-&gt;customer-&gt;getAddressId()
    $this-&gt;customer-&gt;getBalance()
    $this-&gt;customer-&gt;getRewardsPoints()
</pre>
<p>So we can use &#8220;getEmail&#8221; to extract the email address, and we then simply add the code into the account.tpl file to complete the Gravatar url as shown below, which will then display the Gravatar image.</p>
<pre class="brush: php; title: ; notranslate">
&lt;img src=&quot;http://www.gravatar.com/avatar/&lt;?php echo md5(strtolower(trim($this-&gt;customer-&gt;getEmail()))); ?&gt;&quot; /&gt;
</pre>
<p>So if your client is using their Gravatar email address as their account email address, then their accompanying image will be displayed, otherwise a default Gravatar image will be shown.</p>
<p>For those who prefer to use VQMOD, I&#8217;ve put together a VQMOD XML file that is available as a download below. Simply unzip the file and upload the dtwdshowgravataraccountpage.xml file to your vqmod &gt; vqcache folder. </p>
<div class="dtwd_related-posts">
<h4>more ideas for Opencart websites</h4>
<ul>
<li><a href="http://www.davidtiong.com/information-pages-in-opencart-footer-hide-or-show-option/">Information pages showing in Opencart Footer &#8211; how to manage which ones are listed</a></li>
<li><a href="http://www.davidtiong.com/change-default-gravatar-image-in-opencart-with-vqmod/">Change default gravatar image in Opencart with VQMOD</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts -->
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/add-gravatar-image-to-accounts-page-in-opencart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compress websites files using PHP to download</title>
		<link>http://www.davidtiong.com/compress-websites-files-using-php-to-download/</link>
		<comments>http://www.davidtiong.com/compress-websites-files-using-php-to-download/#comments</comments>
		<pubDate>Mon, 20 May 2013 14:08:04 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1471</guid>
		<description><![CDATA[A quick way to download a website&#8217;s files using FTP, is to compress them at the server, and then download. You can do this by adding a quick and easy...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting">A quick way to download a website&#8217;s files using FTP, is to compress them at the server, and then download. You can do this by adding a quick and easy PHP compression script to your website, if you have access with FTP.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
exec('tar zcf compressedbackupwebsite.tar.gz *');
?&gt;
</pre>
<p>Create a PHP file called &#8220;compress-files-for-ftp.php&#8221; and add the above code into it; then upload to the public_html directory of your website, or whichever directory that you wish to compress.</p>
<p>Simply then run the script by loading YOUR-DOMAIN-NAME.com/compress-files-for-ftp.php in a browser URL address bar. This will trigger the script and create a new file called compressedbackupwebsite.tar.gz.</p>
<p>Refresh your FTP client and then download compressedbackupwebsite.tar.gz, then you can use a Zip tool like 7-Zip to extract the tar file, then extract further to extract the individual website files.</p>
<p>Now you will have a backup of all the files from the website. </p>
<p>Note that this won&#8217;t backup files that are dot files such as .htaccess files, which you will have to download manually. It also won&#8217;t backup the database files- if you have a WordPress website for example.</p>
<p>Be sure to delete both compressedbackupwebsite.tar.gz and also compress-files-for-ftp.php, off your website when you are finished.</p>
<p>Important Note: *this procedure will not work if exec has been disabled in PHP for your server. </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/compress-websites-files-using-php-to-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirect old website pages to new website pages</title>
		<link>http://www.davidtiong.com/redirect-old-website-pages-to-new-website-pages/</link>
		<comments>http://www.davidtiong.com/redirect-old-website-pages-to-new-website-pages/#comments</comments>
		<pubDate>Tue, 14 May 2013 04:59:00 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[301 redirection]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1455</guid>
		<description><![CDATA[When you create a new website for a client, or yourself, it&#8217;s important to consider the current pages that are indexed by Google and other search engines. Why? Because you...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting">When you create a new website for a client, or yourself, it&#8217;s important to consider the current pages that are indexed by Google and other search engines.</p>
<p>Why? Because you currently have certain pages that are important, that people are finding when they search online for you. They may even have certain pages bookmarked off your website in their browsers. You don&#8217;t want to lose the ranking for those pages.</p>
<p>So what you need to do is simply identify the key pages that are currently being indexed on Google, either by looking at your sitemap in Google webmaster tools, or by doing a search for your website on Google.</p>
<h3>Then you implement a 301 redirection in your .htaccess file, and advise where to go when they no longer can find your old pages.</h3>
<p>So for example if your old URL for a contact page on your website was &#8220;domainName.com/details/contact-me.html&#8221; and your new website&#8217;s URL for the contact page is &#8220;domainName.com/how-to-contact-me&#8221;, then you would add the following:</p>
<pre class="brush: plain; title: ; notranslate">
Redirect 301 /details/contact-me.html http://domainName.com/how-to-contact-me
</pre>
<p>Now if someone clicks on the old link in SERP or in their browser bookmarks, then your new page will load up, instead of ending up on a 404 not found page.</p>
<p>You can do this for as many important pages that are indexed as you want. However don&#8217;t do it for the home page or the index page as it will cause a redirection error.</p>
<p>Instead you can use the following to redirect index.html to your website home page:</p>
<pre class="brush: plain; title: ; notranslate">
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://domainName.com/$1 [R=301,L]
</pre>
<p>An important note in the case of WordPress websites, is to add these rules before the WordPress rules.</p>
<div class="dtwd_related-posts">
<h4>More useful tips</h4>
<ul>
<li><a href="http://www.davidtiong.com/how-to-secure-wordpress-tips/">How to secure Wordpress tips</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts -->
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/redirect-old-website-pages-to-new-website-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing the list of information pages shown in module and sitemap on Opencart</title>
		<link>http://www.davidtiong.com/managing-the-list-of-information-pages-shown-in-module-and-sitemap-on-opencart/</link>
		<comments>http://www.davidtiong.com/managing-the-list-of-information-pages-shown-in-module-and-sitemap-on-opencart/#comments</comments>
		<pubDate>Sun, 05 May 2013 11:56:52 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Opencart]]></category>
		<category><![CDATA[VQMOD]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1387</guid>
		<description><![CDATA[Following on from my earlier article Information pages showing in Opencart Footer – how to manage which ones are listed, I thought that you might like to know how to...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting">Following on from my earlier article <a href="http://www.davidtiong.com/information-pages-in-opencart-footer-hide-or-show-option/" title="Information pages showing in Opencart Footer – how to manage which ones are listed">Information pages showing in Opencart Footer – how to manage which ones are listed</a>, I thought that you might like to know how to also modify the list of information pages shown in the Modules (such as the sidebar) and the Sitemap.</p>
<p>The procedure is basically the same, except this time you create a VQMOD file to change the other files. For the &#8220;information pages&#8221; listing in the module you are targeting &#8220;catalog/controller/module/information.php&#8221; file. For the &#8220;information pages&#8221; listing in the sitemap, you want to be adding changes to &#8220;catalog/controller/information/sitemap.php&#8221; file.</p>
<p>Then you simply add the following operation to your VQMOD file:</p>
<pre class="brush: php; title: ; notranslate">
&lt;operation&gt;
     &lt;search position=&quot;replace&quot; offset=&quot;4&quot;&gt;&lt;![CDATA[foreach ($this-&gt;model_catalog_information-&gt;getInformations() as $result) {]]&gt;&lt;/search&gt;
     &lt;add&gt;&lt;![CDATA[foreach ($this-&gt;model_catalog_information-&gt;getInformations() as $result) {
     if ( $result['sort_order'] != -1) {
        $this-&gt;data['informations'][] = array(
        'title' =&gt; $result['title'],
        'href'  =&gt; $this-&gt;url-&gt;link('information/information', 'information_id=' . $result['information_id'])
     );}]]&gt;&lt;/add&gt;
&lt;/operation&gt;
</pre>
<p>Remember to save your VQMOD file with a name that helps you to identify the file, then upload to the XML folder of your VQMOD folder.</p>
<p>For more information, be sure to review the article on <a href="http://www.davidtiong.com/information-pages-in-opencart-footer-hide-or-show-option/" >how to manage which Information pages are shown in the Opencart footer</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/managing-the-list-of-information-pages-shown-in-module-and-sitemap-on-opencart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Google Authorship on your WordPress website</title>
		<link>http://www.davidtiong.com/setting-up-google-authorship-on-your-wordpress-website/</link>
		<comments>http://www.davidtiong.com/setting-up-google-authorship-on-your-wordpress-website/#comments</comments>
		<pubDate>Tue, 30 Apr 2013 03:26:39 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[google authorship]]></category>
		<category><![CDATA[google plus]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1369</guid>
		<description><![CDATA[This post will show you how you can easily add Google Authorship to your WordPress website. Why should you do this? Well Google is probably the biggest search engine in...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting"><img src="http://www.davidtiong.com/wp-content/uploads/2013/04/add-google-authorship-to-wordpress.jpg" alt="add google authorship to wordpress" width="793" height="499" class="aligncenter size-full wp-image-1373" /></p>
<h2>This post will show you how you can easily add Google Authorship to your WordPress website.</h2>
<p>Why should you do this? Well Google is probably the biggest search engine in the world, by far, so why wouldn&#8217;t you want to tell Google which articles you have written. Plus you get to see a nice picture of yourself in the Google SERP.</p>
<p>But seriously, Google has started to integrate social indicators in its search engine results, so adding authorship markup to your blog or website is a &#8220;must do&#8221;.</p>
<p>Depending on your theme, this may be somewhat different, however the basic principles are the same. You need to setup your WordPress author page so that it contains the link to your Google+ profile, and then because your posts actually link to your author page, Google sees that you are the author and grants you &#8220;Google Authorship&#8221; for your posts.</p>
<p>There are 3 main steps to successfully adding Google Authorship to your WordPress site. <strong>The first step is to create a Google+ personal profile</strong>, if you haven&#8217;t already done so, and <strong>add a link in the &#8220;contributor to&#8221; </strong>section to the website(s) you author articles on.</p>
<p><img src="http://www.davidtiong.com/wp-content/uploads/2013/04/googleplus-contributor-to.jpg" alt="googleplus contributor to" width="509" height="138" class="aligncenter size-full wp-image-1374" /></p>
<p><strong>Secondly you need to take note of your profile ID</strong> &#8211; see image snapshot below. At this point, you could use one of many plugins to add Google+ to your page, though I think it&#8217;s an easy addition to do it yourself. </p>
<p><img src="http://www.davidtiong.com/wp-content/uploads/2013/04/googleplus-profile-id.jpg" alt="google plus profile id" width="500" height="75" class="aligncenter size-full wp-image-1375" /></p>
<p>You need to add your Google+ profile URL, onto the author page. To do this we will modify 3 areas, namely your author profile page found inside your WordPress admin section via &#8220;User > Your Profile&#8221; page, your childtheme&#8217;s functions.php file and also the author.php template file.</p>
<p>Inside WordPress admin, on your profile page, under Contact Info, there is email, website, AIM, Jabber and others. Ideally there should really be Google+, Facebook and Twitter fields, so we&#8217;ll clean this up a little. We can add these extra fields onto the page with a function. Add the code below to your childtheme&#8217;s functions.php file. It will remove the AIM, Jabber and Yahoo IM fields, and replace with Google+, Twitter and Facebook.</p>
<pre class="brush: php; title: ; notranslate">
function modify_user_contact_methods( $user_contact ){

	/* Add user contact methods */
	$user_contact['googleplusprofile'] = __('Google+ Profile ID only'); 
	$user_contact['twitter'] = __('Twitter Username only'); 
	$user_contact['facebookpage'] = __('Facebook Page ID only'); 

	/* Remove user contact methods */
	unset($user_contact['aim']);
	unset($user_contact['jabber']);
	unset($user_contact['yim']);

	return $user_contact;
}

add_filter('user_contactmethods', 'modify_user_contact_methods');

?&gt;
</pre>
<p>Now when you go into the user profile page, you can add your Google+ profile ID, as well as Facebook and Twitter. </p>
<p>Next up we need to use that new profile information on the author page. We will use $curauth to extract this data from your Profile Page, and then add it to your author page.</p>
<p>You need to edit the author.php file on your website, or if your theme doesn&#8217;t have one, then make a copy of the archive.php file and name it author.php.</p>
<p>What we want to do is to insert the following code onto your author page, automatically extracting your Google+ profile ID:</p>
<pre class="brush: php; title: ; notranslate">&lt;a href=&quot;https://plus.google.com/GOOGLE-PLUS-PROFILE;?&gt;&quot; title=&quot;Google+ Author&quot; rel=&quot;author&quot; target=&quot;_blank&quot;&gt;</pre>
<p>To do this you add the following code just before the Loop in the author.php template file:</p>
<pre class="brush: php; title: ; notranslate">
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));?&gt;
&lt;h2&gt;Author: &lt;a href=&quot;https://plus.google.com/&lt;?php echo $curauth-&gt;googleplusprofile;?&gt;&quot; title=&quot;Google+ Author&quot; rel=&quot;author&quot; target=&quot;_blank&quot;&gt;&lt;?php echo $curauth-&gt;nickname;?&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;?php if ( !empty( $curauth-&gt;twitter ) ) { ?&gt;
  &lt;br/&gt;&lt;p&gt;Find me on Twitter at: &lt;a href=&quot;https://twitter.com/&lt;?php echo $curauth-&gt;twitter; ?&gt;&quot; target=&quot;_blank&quot;&gt;www.twitter.com/&lt;?php echo $curauth-&gt;twitter;?&gt;&lt;/a&gt;&lt;/p&gt;&lt;?php
} ?&gt;
&lt;?php if ( !empty( $curauth-&gt;facebookpage ) ) { ?&gt;
  &lt;br/&gt;&lt;p&gt;Find me on Facebook at: &lt;a href=&quot;http://facebook.com/&lt;?php echo $curauth-&gt;facebookpage; ?&gt;&quot; target=&quot;_blank&quot;&gt;www.facebook.com/&lt;?php echo $curauth-&gt;facebookpage;?&gt;&lt;/a&gt;&lt;/p&gt;&lt;?php
} ?&gt;
&lt;br/&gt;&lt;h3&gt;A little bit about me:&lt;/h3&gt;&lt;?php echo $curauth-&gt;user_description; ?&gt;&lt;/p&gt;

&lt;br/&gt;&lt;h2&gt;Articles by &lt;?php echo $curauth-&gt;nickname; ?&gt;:&lt;/h2&gt;&lt;?php
</pre>
<p>You can of course style this snippet of information how you like, but the important part is that it adds the link to your Google+ profile page onto your WordPress author page and states that you are rel=&#8221;author&#8221;.</p>
<p>Now you can test that you have done everything correctly by using the Google Rich Snippets Tool <a href="http://www.google.com/webmasters/tools/richsnippets" target="_blank">here</a></p>
<div class="dtwd_related-posts">
<h4>Looking for more ideas on how to improve your WordPress website:</h4>
<ul>
<li><a href="http://www.davidtiong.com/block-spam-registrations-on-wordpress/">Block spam registrations on Wordpress</a></li>
<li><a href="http://www.davidtiong.com/using-the-title-and-alt-attributes-tags-seo/">Using the TITLE and ALT attributes for tags in SEO</a></li>
<li><a href="http://www.davidtiong.com/adding-meta-description-to-wordpress-pages-without-a-plugin/">Adding Meta Description to Wordpress pages without a plugin</a></li>
<li><a href="http://www.davidtiong.com/how-to-add-noindex-follow-to-pages-in-wordpress-stop-duplicate-content/">How to add noindex, follow to pages in Wordpress to stop duplicate content for SEO</a></li>
<li><a href="http://www.davidtiong.com/create-wordpress-blog-sell-house/">Create a Wordpress blog and sell your house</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts --></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/setting-up-google-authorship-on-your-wordpress-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Information pages showing in Opencart Footer &#8211; how to manage which ones are listed</title>
		<link>http://www.davidtiong.com/information-pages-in-opencart-footer-hide-or-show-option/</link>
		<comments>http://www.davidtiong.com/information-pages-in-opencart-footer-hide-or-show-option/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 00:56:42 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Opencart]]></category>
		<category><![CDATA[free VQMOD file]]></category>
		<category><![CDATA[opencart footer]]></category>
		<category><![CDATA[VQMOD]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1350</guid>
		<description><![CDATA[How do I remove, hide, control information pages showing up in the Opencart footer? In earlier versions of Opencart the way to stop the listing of certain information pages in...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting"><img class="aligncenter size-full wp-image-1363 image-shadow-style" alt="opencart footer hide information pages" src="http://www.davidtiong.com/wp-content/uploads/2013/04/opencart-footer-hide-information-pages.jpg" width="568" height="216" /></p>
<h2>How do I remove, hide, control information pages showing up in the Opencart footer?</h2>
<p>In earlier versions of Opencart the way to stop the listing of certain information pages in the footer, was to give the page a &#8220;sort-order&#8221; of &#8220;-1&#8243;.</p>
<p>However it seems that this functionality has been removed from later versions. This VQMOD file will give you back control of this option. In addition to this you will also get the benefit of being able to customise the file further to suit your needs.</p>
<p>Of course firstly you must have VQMOD installed on your Opencart website. Then you need to download the file below and unzip the folder, then FTP the XML file to your vqmod &gt; xml folder on your website. </p>
<p>The XML files looks for the catalog/controller/common/footer.php file, searches out the line for adding information page list to the footer:</p>
<pre class="brush: php; title: ; notranslate">
foreach ($this-&gt;model_catalog_information-&gt;getInformations() as $result) {
</pre>
<p>and then inserts an if statement that looks for whether &#8220;-1&#8243; has been entered in the &#8220;sort-order&#8221; field in the information page editing screen:</p>
<pre class="brush: php; title: ; notranslate">
if ( $result['sort_order'] != -1 ) {
</pre>
<p>To customise further, perhaps you don&#8217;t have to just use &#8220;-1&#8243;. Maybe you would prefer to still use sort order properly, then you could just start all the information pages, that you don&#8217;t want listed on your Opencart footer&#8217;s information pages list, with numbers greater than 50.<br />
So you would change the line in the VQMOD XML file that says :</p>
<pre class="brush: php; title: ; notranslate">
if ( $result['sort_order'] != -1 ) {
</pre>
<p>to:</p>
<pre class="brush: php; title: ; notranslate">
if ( $result['sort_order'] &gt;= 50 ) {
</pre>
<p>Then it&#8217;s just a matter of adding sort-order of 50,51,52,etc to the Opencart information pages that you don&#8217;t want shown in the footer.</p>
<p>Be sure to check that file has worked with your Opencart theme and version of Opencart. If you are familiar with using the VQMOD cache, you can FTP the catalog_controller_common_footer.php file down to your computer, open it up and check that the required line is in the correct location. Also of course you would view your website to ensure the changes are reflected.</p>
<div class="dtwd_related-posts">
<h4>For other Opencart tips:</h4>
<ul>
<li><a href="http://www.davidtiong.com/add-gravatar-image-to-accounts-page-in-opencart/">Add Gravatar image to Accounts page in Opencart</a></li>
<li><a href="http://www.davidtiong.com/managing-the-list-of-information-pages-shown-in-module-and-sitemap-on-opencart/">Managing the list of information pages shown in module and sitemap on Opencart</a></li>
<li><a href="http://www.davidtiong.com/change-default-gravatar-image-in-opencart-with-vqmod/">Change default gravatar image in Opencart with VQMOD</a></li>
<li><a href="http://www.davidtiong.com/what-is-vqmod-and-how-to-install/">What is VQMOD and how to install</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts -->
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/information-pages-in-opencart-footer-hide-or-show-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Box styling &#8211; how to</title>
		<link>http://www.davidtiong.com/css-box-styling-how-to/</link>
		<comments>http://www.davidtiong.com/css-box-styling-how-to/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 10:14:22 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[box styling]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1336</guid>
		<description><![CDATA[Now with CSS3 we can style boxes easier and quicker using CSS rather than background gradient images. There are quite a few possible combinations of styles to use, depending on...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting"><img class=" wp-image-1343 alignleft" alt="box shadow css style" src="http://www.davidtiong.com/wp-content/uploads/2013/04/box-shadow.jpg" width="315" height="241" /></p>
<p>Now with CSS3 we can style boxes easier and quicker using CSS rather than background gradient images. There are quite a few possible combinations of styles to use, depending on what you are looking to achieve, though you need to be aware that some don&#8217;t work in certain browsers, or certain browser versions.</p>
<p>Let&#8217;s get started with box-shadow. This one works across newer versions of Firefox, Chrome, Safari and IE9. Simply add to your CSS stylesheet the following:</p>
<pre class="brush: css; title: ; notranslate">
     -webkit-box-shadow: 3px 4px 5px 5px  #333;
     box-shadow: 3px 4px 5px 5px  #333;
</pre>
<p>The first part is for horizontal offset, followed by vertical offset, followed by blur distance, then spread and lastly the colour.</p>
<p>Using negative numbers for horizontal and vertical offset will produce shadows to the left and above, whereas positive numbers will make your shadow appear to the right and below.</p>
<p>Another variation you can use is box-shadow: inset. This makes an inner shadow. The example CSS below will show an inner shadow with no offset, blur distance of 5px and a spread distance of 5px:</p>
<pre class="brush: css; title: ; notranslate">
     -webkit-box-shadow: inset 0 0 5px 5px #888;
     box-shadow: inset 0 0 5px 5px #888;
</pre>
<p>Taking the idea of box-shadow even further, you can create multiple layered shadows. The CSS code below produces a white blurred outline with slight red shadow to the right and a faint blue shadow to the left:</p>
<pre class="brush: css; title: ; notranslate">
     -webkit-box-shadow: 0 0 15px 5px #FFFFFF, 15px 10px 25px 0px red, -15px -10px 25px 0px blue;
     box-shadow: 0 0 15px 5px #FFFFFF, 15px 10px 25px 0px red, -15px -10px 25px 0px blue;
</pre>
<p>Depending on your web page design, you may even want to try using some transparency in your shadow, which can be achieved using RGBa colour:</p>
<pre class="brush: css; title: ; notranslate">
     -webkit-box-shadow: 5px 5px rgba(0,0,0,0.5);
     box-shadow: 5px 5px rgba(0,0,0,0.5);
</pre>
<p>Next up is the border of your box, which is styled using border-style, border-width, border-color and border-radius. You can also style top, bottom, left and right borders individually, by replacing &#8220;border&#8221; with &#8220;border-left&#8221; for example.</p>
<ul>
<li>Border-style can be dotted, dashed, solid, double, groove, ridge, inset or outset</li>
<li>Border-width can be styled using thin, medium, thick or by px size, such as 1px, 2px, etc</li>
<li>Border-color can be specified as a color name, like &#8220;red&#8221;; RGB &#8211; specify a RGB value, like &#8220;rgb(255,0,0)&#8221;; or Hex &#8211; specify a hex value, like &#8220;#ff0000&#8243;. You can also set the border color to &#8220;transparent&#8221;, or use RGBa such as &#8220;rgba(255,0,0,0.5)&#8221;</li>
<li>Border-radius controls whether the border has rounded corners or straight edges. The css example below creates rounded corners. The higher the px number you choose, the more rounded the corners will become.
<pre class="brush: css; title: ; notranslate">
     -webkit-border-radius: 5px;
     border-radius: 5px;
</pre>
<p>You can do so much more with CSS3 box styling, though just be aware that different browser versions will handle the rules differently. For more great ideas and to see examples of CSS3 box styling, check out this website: <a title="css3please.com" href="http://css3please.com/">css3please.com</a></p>
<div class="dtwd_related-posts">
<h4>For more ideas:</h4>
<ul>
<li><a href="http://www.davidtiong.com/special-characters-html-entities-symbols-on-websites/">Special characters, html entities and symbols on websites and social media</a></li>
<li><a href="http://www.davidtiong.com/create-text-logos/">Create simple and quick text based graphics logos</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts -->
		</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/css-box-styling-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add Twitter cards code to your WordPress website</title>
		<link>http://www.davidtiong.com/how-to-add-twitter-cards-code-to-your-wordpress-website/</link>
		<comments>http://www.davidtiong.com/how-to-add-twitter-cards-code-to-your-wordpress-website/#comments</comments>
		<pubDate>Fri, 12 Apr 2013 13:01:53 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Twitter Cards]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1319</guid>
		<description><![CDATA[How would you like to be able to add Twitter cards markup code to your WordPress website? Twitter cards is a brand new way to add extra content to your...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting"><strong>How would you like to be able to add Twitter cards markup code to your WordPress website?<br />
</strong><br />
Twitter cards is a brand new way to add extra content to your Tweets, simply by adding Twitter Card html code to your webpages. So that when someone links to your content in Twitter, a &#8220;card&#8221; with more information will be attached to the Tweet.</p>
<p>&nbsp;</p>
<h2>So firstly here are the basic steps involved to add Twitter Card markup to your website:</h2>
<p><span class="highlight_yellow">Step 1.</span><br />
Review the Twitter Card documentation- in this post I&#8217;ll show you how to add Summary Card to your Tweets. This is the Default card which contains title, description, thumbnail image, and Twitter account attribution.<br />
You can read the documentation <a href="https://dev.twitter.com/docs/cards" target="_blank">here</a>.</p>
<p><span class="highlight_yellow">Step 2.</span><br />
Add the required Twitter Meta markup to your page header</p>
<pre class="brush: php; title: ; notranslate">
&lt;meta name=&quot;twitter:card&quot; content=&quot;summary&quot; /&gt;
&lt;meta name=&quot;twitter:site&quot; content=&quot;@ insert-twitter-Account&quot; /&gt;
&lt;meta name=&quot;twitter:creator&quot; content=&quot;@ insert-twitter-account-for-page-Author&quot; /&gt;
&lt;meta name=&quot;twitter:url&quot; content=&quot;the page url goes here&quot; /&gt;
&lt;meta name=&quot;twitter:title&quot; content=&quot;the page title goes here&quot; /&gt;
&lt;meta name=&quot;twitter:description&quot; content=&quot;the page excerpt or short description goes here&quot; /&gt;
&lt;meta name=&quot;twitter:image&quot; content=&quot;add an image to your card here&quot; /&gt;
</pre>
<p><span class="highlight_yellow">Step 3.</span><br />
Twitter have provided a great tool so that you can check your markup to make sure you&#8217;ve got it right. Add your URL that you wish to validate <a href="https://dev.twitter.com/docs/cards/validation/validator" target="_blank" rel="external nofollow">here</a></p>
<p><span class="highlight_yellow">Step 4.</span><br />
Request approval for your website from Twitter Cards- simply click on the &#8220;Request Approval&#8221; button as shown in the image below and fill your details in the form to register your domain. Please note that Twitter must approve the integration- which according to their site takes a couple of weeks.<br />
<img class="aligncenter size-full wp-image-1320" alt="Add Twitter Cards to WordPress website" src="http://www.davidtiong.com/wp-content/uploads/2013/04/twitter-cards-add-markup-to-your-website.jpg" width="987" height="522" /></p>
<h2></h2>
<h2>The &#8220;automatic&#8221; way to have your WordPress website pages setup for Twitter Cards -Summary Card</h2>
<p>What&#8217;s the easiest way to add this code to your webpages so that you maximise the potential of Twitter Cards?</p>
<p>As each page on your website has its own unique content, you want your Twitter Cards to show different content for each page. But adding this manually each time can be quite time consuming, and also easy to forget to do.</p>
<p>The following code will add the required Twitter card markup to your home page, your posts, pages and category. It uses permalinks, excerpts, bloginfo and other WordPress code to tailor the Twitter cards for the different pages.</p>
<p><a href="https://twitter.com/intent/tweet?screen_name=dtiongwebdesign&#038;text=shows how to optimise your WordPress website for Twitter Cards with code snippets - this is great" class="bobb" data-size="large" data-related="dtiongwebdesign">Keep this to yourself or share with your friends on Twitter</a></p>
<p>Add the following code to your header.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( is_category() ) {  $cat = get_query_var('cat'); $metacat= strip_tags(category_description($cat)); $current_page_URL = $_SERVER[&quot;SERVER_NAME&quot;] . $_SERVER[&quot;REQUEST_URI&quot;]; ?&gt;
&lt;meta name=&quot;twitter:card&quot; content=&quot;summary&quot; /&gt;
&lt;meta name=&quot;twitter:site&quot; content=&quot;@ CHANGE-ME&quot; /&gt;
&lt;meta name=&quot;twitter:creator&quot; content=&quot;@ CHANGE-ME&quot; /&gt;
&lt;meta name=&quot;twitter:url&quot; content=&quot;&lt;?php echo esc_url($current_page_URL);?&gt;&quot; /&gt;
&lt;meta name=&quot;twitter:title&quot; content=&quot;&lt;?php single_cat_title();?&gt;&quot; /&gt;
&lt;meta name=&quot;twitter:description&quot; content=&quot;&lt;?php echo $metacat;?&gt;&quot; /&gt;
&lt;?php } ?&gt;&lt;?php if (is_single() || is_page() ) : if (have_posts() ) : while (have_posts() ) : the_post(); ?&gt;
&lt;meta name=&quot;twitter:description&quot; content=&quot;&lt;?php echo get_the_excerpt();?&gt;&quot; /&gt;
&lt;meta name=&quot;twitter:card&quot; content=&quot;summary&quot; /&gt;
&lt;meta name=&quot;twitter:site&quot; content=&quot;@ CHANGE-ME&quot; /&gt;
&lt;meta name=&quot;twitter:creator&quot; content=&quot;@ CHANGE-ME&quot; /&gt;
&lt;meta name=&quot;twitter:url&quot; content=&quot;&lt;?php the_permalink();?&gt;&quot; /&gt;
&lt;meta name=&quot;twitter:title&quot; content=&quot;&lt;?php the_title();?&gt;&quot; /&gt;
&lt;?php endwhile; endif; elseif (is_home() ): ?&gt;
&lt;meta name=&quot;twitter:card&quot; content=&quot;summary&quot; /&gt;
&lt;meta name=&quot;twitter:site&quot; content=&quot;@ CHANGE-ME&quot; /&gt;
&lt;meta name=&quot;twitter:creator&quot; content=&quot;@ CHANGE-ME&quot; /&gt;
&lt;meta name=&quot;twitter:url&quot; content=&quot;&lt;?php echo home_url();?&gt;&quot; /&gt;
&lt;meta name=&quot;twitter:title&quot; content=&quot;&lt;?php echo esc_attr(get_bloginfo('name'));?&gt;&quot; /&gt;
&lt;meta name=&quot;twitter:description&quot; content=&quot;&lt;?php bloginfo('description'); ?&gt;&quot; /&gt;
&lt;meta name=&quot;twitter:image:src&quot; content=&quot;INSERT-IMAGE-URL&quot; /&gt;&lt;?php endif; ?&gt;
</pre>
<p>Don&#8217;t forget to add your Twitter handle/ username where it says CHANGE-ME and add an image URL for your Home page Twitter Card where it says INSERT-IMAGE-URL.</p>
<p>You might have noticed that I haven&#8217;t added the markup for the &#8220;twitter:image:src&#8221; for the posts and pages. I thought that it might be nice to be able to customise this individually for each post using the built in WordPress custom meta data that you find in the post editing screen.</p>
<p>Firstly add this to the your childtheme&#8217;s functions.php file:</p>
<pre class="brush: php; title: ; notranslate">
add_action('wp_head','twitcard_img');
function twitcard_img(){
    global $post;
    if (is_single()||is_page()){
        if(get_post_meta($post-&gt;ID,'twitcard_picture_url',true) != '')
            echo '&lt;meta name=&quot;twitter:image:src&quot; content=&quot;'.get_post_meta($post-&gt;ID,'twitcard_picture_url',true).'&quot; /&gt;';
    }
}
</pre>
<p>This defines a new function called &#8220;twitcard_img&#8221; that extracts the data that you insert into the custom field &#8220;twitcard_picture_url&#8221; and adds that into the header of your posts and pages inside the content of &#8220;twitter:image:src&#8221;.</p>
<p>Now you need to create that custom field. Go into a post or page editing screen. Click on the &#8220;Screen Options&#8221; and ensure &#8220;Custom Fields&#8221; is ticked.</p>
<p><img class="aligncenter size-full wp-image-1323" alt="custom fields in screen options" src="http://www.davidtiong.com/wp-content/uploads/2013/04/screen-options.jpg" width="1036" height="416" /></p>
<p>&nbsp;</p>
<p>Next scroll down to &#8220;Custom Fields&#8221; and add your new custom field &#8220;twitcard_picture_url&#8221;</p>
<p><img class="aligncenter size-full wp-image-1324" alt="add new custom field" src="http://www.davidtiong.com/wp-content/uploads/2013/04/new-custom-field.jpg" width="967" height="556" /></p>
<p>&nbsp;</p>
<p>Now when you create posts and pages, add the image URL that you want in your Twitter card into this custom field, and the &#8220;twitcard_img&#8221; function will auto add it your pages header, so that your Twitter card will display that image.</p>
<p><img class="aligncenter size-full wp-image-1325" alt="using custom field" src="http://www.davidtiong.com/wp-content/uploads/2013/04/using-custom-field.jpg" width="1038" height="548" /></p>
<p>&nbsp;</p>
<p>Then load the URL into the validator and check it out.</p>
<p><img class="aligncenter size-full wp-image-1329" alt="how to Twitter Card setup" src="http://www.davidtiong.com/wp-content/uploads/2013/04/twitter-card.jpg" width="520" height="272" /></p>
<p>&nbsp;</p>
<p>So there you have it. Have you started using Twitter Cards already? Be one of the first and get started today.</p>
<div class="dtwd_related-posts">
<h4>Other tips for you</h4>
<ul>
<li><a href="http://www.davidtiong.com/create-shortcode-to-add-custom-twitter-support-button-to-your-website/">Create shortcode to add custom Twitter support button to your website</a></li>
<li><a href="http://www.davidtiong.com/add-retweet-button-shortcode-to-wordpress/">Add Retweet button shortcode to Wordpress</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts -->
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/how-to-add-twitter-cards-code-to-your-wordpress-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Memory Issue &#8211; Fatal Error Memory Size Exhausted</title>
		<link>http://www.davidtiong.com/wordpress-memory-issue-fatal-error-memory-size-exhausted/</link>
		<comments>http://www.davidtiong.com/wordpress-memory-issue-fatal-error-memory-size-exhausted/#comments</comments>
		<pubDate>Mon, 08 Apr 2013 22:55:08 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[wordpress errors]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1306</guid>
		<description><![CDATA[With all the functionality that goes into our WordPress websites, it&#8217;s important to keep an eye out for errors. One error that you cannot miss, is a white screen with...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting"><img class="aligncenter size-full wp-image-1311" alt="Wordpress Pain - Fatal Error Memory Exhausted" src="http://www.davidtiong.com/wp-content/uploads/2013/04/wordpress-fatal-error-memory.jpg" width="500" height="333" /></p>
<p>With all the functionality that goes into our WordPress websites, it&#8217;s important to keep an eye out for errors. One error that you cannot miss, is a white screen with text at the top saying <strong>&#8220;Fatal Error : Memory Size Exhausted&#8221;</strong>.</p>
<p>This is because the default for PHP memory for your website is probably only 32M. This doesn&#8217;t go far anymore. So here&#8217;s the steps to check how much memory you have and increase it.</p>
<p><span class="highlight_yellow">Step 1.</span><br />
First we need to analyse the site, using a PHP info code. Simply open up a blank file, insert into it:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php phpinfo(); ?&gt;
</pre>
<p>and then save the file as phpinfo.php. FTP that file into the public_html section of your website. Navigate on your web browser to yourDomainName.com/phpinfo.php<br />
Then do a search for &#8220;memory_limit&#8221;. You will probably see it set as 32M</p>
<p><span class="highlight_yellow">Step 2.</span><br />
Now try to increase the memory size. Depending on your server configuration and access levels, you should try to up the quota by trying the following in the order shown. After each attempt, be sure to check if the memory limit has increased by reloading the phpinfo.php page. When that technique has worked you don&#8217;t need to try the next one.</p>
<p>A) Add to wp-config file:</p>
<pre class="brush: php; title: ; notranslate">define('WP_MEMORY_LIMIT', '64M');</pre>
<p>B) Add to .htaccess file:</p>
<pre class="brush: php; title: ; notranslate">php_value memory_limit 64M</pre>
<p>C) Add to php.ini:<br />
Create a blank file and call it php.ini. Insert into it:</p>
<pre class="brush: php; title: ; notranslate">memory_limit = 64M</pre>
<p>Upload/FTP this file into the public_html directory of your website where WordPress is installed. You may also need to add this file to the wp-admin directory if still having memory issues.</p>
<p><span class="highlight_yellow">Step 3.</span><br />
The previous step talks about where to add the code to increase memory for WordPress. You can change the memory sizes to suit your needs, for eg: 32,64,128,256 or 512mB</p>
<p><span class="highlight_yellow">Step 4.</span><br />
Check that the WordPress memory errors have resolved and that you can access your pages thoroughly. Then don&#8217;t forget to delete the phpinfo.php file off your website.</p>
<div class="dtwd_related-posts">
<h4>More related reading</h4>
<ul>
<li><a href="http://www.davidtiong.com/redirect-old-website-pages-to-new-website-pages/">Redirect old website pages to new website pages</a></li>
<li><a href="http://www.davidtiong.com/setting-up-google-authorship-on-your-wordpress-website/">Setting up Google Authorship on your WordPress website</a></li>
<li><a href="http://www.davidtiong.com/how-to-add-twitter-cards-code-to-your-wordpress-website/">How to add Twitter cards code to your Wordpress website</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts -->
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/wordpress-memory-issue-fatal-error-memory-size-exhausted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Block spam registrations on WordPress</title>
		<link>http://www.davidtiong.com/block-spam-registrations-on-wordpress/</link>
		<comments>http://www.davidtiong.com/block-spam-registrations-on-wordpress/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 03:32:32 +0000</pubDate>
		<dc:creator>David Tiong</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[anti spam]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.davidtiong.com/?p=1288</guid>
		<description><![CDATA[An annoying aspect of allowing free registration on your blog or WordPress website, is the number of &#8220;fake&#8221; or &#8220;spam&#8221; registrations. There are various ways to try to reduce the...]]></description>
				<content:encoded><![CDATA[<div class="tf-flash-messages"></div>
<div itemscope itemtype="http://schema.org/BlogPosting"><img class="wp-image-1298 aligncenter" title="block spam registrations" alt="stop spam registration in wordpress" src="http://www.davidtiong.com/wp-content/uploads/2013/03/anti-spam-registrations.jpg" width="600" height="365" />An annoying aspect of allowing free registration on your blog or WordPress website, is the number of &#8220;fake&#8221; or &#8220;spam&#8221; registrations.</p>
<p>There are various ways to try to reduce the number of these unwanted registered users, and there are different security plugins that can be used to combat this. Sometimes, depending on the severity of your situation, you may need to apply a combination of more than one tactic.</p>
<p>For other posts that talk about security techniques for WordPress, be sure to view the related links at the end of this post.</p>
<h2>Here are 4 top ways to block spam registrations on WordPress:</h2>
<p><a href="https://twitter.com/intent/tweet?screen_name=dtiongwebdesign&#038;text=article on how to Block Spam Registrations on WordPress" class="bobb" data-size="large" data-related="dtiongwebdesign">Tweet this</a></p>
<p>1. Block spam registrations by email address<br />
2. Block spam registrations by IP<br />
3. Block spam registrations by using a User Registrations plugin<br />
4. Block spam registrations by using Cloudflare</p>
<p><span class="highlight_yellow">1. Block spam registrations by email address</span></p>
<p><strong>Technique 1.</strong><br />
The quickest way and simplest way without having to delve into the code in WordPress is to use a combination of a plugin and your Discussion Settings Comment Blacklist.</p>
<p>Install <a href="http://wordpress.org/extend/plugins/ban-hammer/" target="_blank" rel="external nofollow">Ban Hammer Plugin</a> and activate. Now go to your Settings &gt; Discussion and scroll down to you Comment Blacklist. Now simply add all email domains that you want to block.</p>
<p>For example if you are getting a lot of spam registrations such as go5yq88@12345.com, uyu797@12345.com and bob@fakemail.com, then simply add 12345.com on one line, then fakemail.com on the next line.</p>
<p>Now the next time someone goes to sign up to your website and tries to use those email domains, they get an error message saying &#8220;ERROR: Your email has been banned from registration.&#8221;</p>
<p><strong>Technique 2.</strong><br />
If you would prefer to keep your comment blacklist separate from your registration blocklist, then you can add an email check to your childtheme&#8217;s functions.php file, and add an extra email validation check to your wp-login.php file.</p>
<p>The below code snippets are an adaptation of the idea of blocking disposable email addresses, based on an article by Mohammad at <a href="http://www.articlevoid.com/computers-and-technology/coding/how-to-block-disposable-email-addresses/" target="_blank">ArticleVoid</a>.</p>
<p>Add the following function to your functions.php file to list the blocked emails and to detect when one is used in the Registration page.</p>
<pre class="brush: php; title: ; notranslate">
function dtwd_blocked_emails($user_email) {
	$dtwd_blocked_list = array(
	&quot;0815.ru0clickemail.com&quot;, &quot;0wnd.net&quot;, &quot;0wnd.org&quot;, &quot;10minutemail.com&quot;, &quot;20minutemail.com&quot;, &quot;2prong.com&quot;, &quot;3d-painting.com&quot;, &quot;4warding.com&quot;, &quot;4warding.net&quot;, &quot;4warding.org&quot;, &quot;9ox.net&quot;, &quot;a-bc.net&quot;, &quot;amilegit.com&quot;, &quot;anonbox.net&quot;, &quot;anonymbox.com&quot;, &quot;antichef.com&quot;, &quot;antichef.net&quot;, &quot;antispam.de&quot;, &quot;baxomale.ht.cx&quot;, &quot;beefmilk.com&quot;, &quot;binkmail.com&quot;, &quot;bio-muesli.net&quot;, &quot;bobmail.info&quot;, &quot;bodhi.lawlita.com&quot;, &quot;bofthew.com&quot;, &quot;brefmail.com&quot;, &quot;bsnow.net&quot;, &quot;bugmenot.com&quot;, &quot;bumpymail.com&quot;, &quot;casualdx.com&quot;, &quot;chogmail.com&quot;, &quot;cool.fr.nf&quot;, &quot;correo.blogos.net&quot;, &quot;cosmorph.com&quot;, &quot;courriel.fr.nf&quot;, &quot;courrieltemporaire.com&quot;, &quot;curryworld.de&quot;, &quot;cust.in&quot;, &quot;dacoolest.com&quot;, &quot;dandikmail.com&quot;, &quot;deadaddress.com&quot;, &quot;despam.it&quot;, &quot;devnullmail.com&quot;, &quot;dfgh.net&quot;, &quot;digitalsanctuary.com&quot;, &quot;discardmail.com&quot;, &quot;discardmail.de&quot;, &quot;disposableaddress.com&quot;, &quot;disposemail.com&quot;, &quot;dispostable.com&quot;, &quot;dm.w3internet.co.uk example.com&quot;, &quot;dodgeit.com&quot;, &quot;dodgit.com&quot;, &quot;dodgit.org&quot;, &quot;dontreg.com&quot;, &quot;dontsendmespam.de&quot;, &quot;dump-email.info&quot;, &quot;dumpyemail.com&quot;, &quot;e4ward.com&quot;, &quot;email60.com&quot;, &quot;emailias.com&quot;, &quot;emailinfive.com&quot;, &quot;emailmiser.com&quot;, &quot;emailtemporario.com.br&quot;, &quot;emailwarden.com&quot;, &quot;ephemail.net&quot;, &quot;example.com&quot;, &quot;explodemail.com&quot;, &quot;fakeinbox.com&quot;, &quot;fakeinformation.com&quot;, &quot;fastacura.com&quot;, &quot;filzmail.com&quot;, &quot;fizmail.com&quot;, &quot;frapmail.com&quot;, &quot;garliclife.com&quot;, &quot;get1mail.com&quot;, &quot;getonemail.com&quot;, &quot;getonemail.net&quot;, &quot;girlsundertheinfluence.com&quot;, &quot;gishpuppy.com&quot;, &quot;great-host.in&quot;, &quot;gsrv.co.uk&quot;, &quot;guerillamail.biz&quot;, &quot;guerillamail.com&quot;, &quot;guerillamail.net&quot;, &quot;guerillamail.org&quot;, &quot;guerrillamail.com&quot;, &quot;guerrillamailblock.com&quot;, &quot;haltospam.com&quot;, &quot;hotpop.com&quot;, &quot;ieatspam.eu&quot;, &quot;ieatspam.info&quot;, &quot;ihateyoualot.info&quot;, &quot;imails.info&quot;, &quot;inboxclean.com&quot;, &quot;inboxclean.org&quot;, &quot;incognitomail.com&quot;, &quot;incognitomail.net&quot;, &quot;ipoo.org&quot;, &quot;irish2me.com&quot;, &quot;jetable.com&quot;, &quot;jetable.fr.nf&quot;, &quot;jetable.net&quot;, &quot;jetable.org&quot;, &quot;junk1e.com&quot;, &quot;kaspop.com&quot;, &quot;kulturbetrieb.info&quot;, &quot;kurzepost.de&quot;, &quot;lifebyfood.com&quot;, &quot;link2mail.net&quot;, &quot;litedrop.com&quot;, &quot;lookugly.com&quot;, &quot;lopl.co.cc&quot;, &quot;lr78.com&quot;, &quot;maboard.com&quot;, &quot;mail.by&quot;, &quot;mail.mezimages.net&quot;, &quot;mail4trash.com&quot;, &quot;mailbidon.com&quot;, &quot;mailcatch.com&quot;, &quot;maileater.com&quot;, &quot;mailexpire.com&quot;, &quot;mailin8r.com&quot;, &quot;mailinator.com&quot;, &quot;mailinator.net&quot;, &quot;mailinator2.com&quot;, &quot;mailincubator.com&quot;, &quot;mailme.lv&quot;, &quot;mailnator.com&quot;, &quot;mailnull.com&quot;, &quot;mailzilla.org&quot;, &quot;mbx.cc&quot;, &quot;mega.zik.dj&quot;, &quot;meltmail.com&quot;, &quot;mierdamail.com&quot;, &quot;mintemail.com&quot;, &quot;moncourrier.fr.nf&quot;, &quot;monemail.fr.nf&quot;, &quot;monmail.fr.nf&quot;, &quot;mt2009.com&quot;, &quot;mx0.wwwnew.eu&quot;, &quot;mycleaninbox.net&quot;, &quot;mytrashmail.com&quot;, &quot;neverbox.com&quot;, &quot;nobulk.com&quot;, &quot;noclickemail.com&quot;, &quot;nogmailspam.info&quot;, &quot;nomail.xl.cx&quot;, &quot;nomail2me.com&quot;, &quot;no-spam.ws&quot;, &quot;nospam.ze.tc&quot;, &quot;nospam4.us&quot;, &quot;nospamfor.us&quot;, &quot;nowmymail.com&quot;, &quot;objectmail.com&quot;, &quot;obobbo.com&quot;, &quot;onewaymail.com&quot;, &quot;ordinaryamerican.net&quot;, &quot;owlpic.com&quot;, &quot;pookmail.com&quot;, &quot;proxymail.eu&quot;, &quot;punkass.com&quot;, &quot;putthisinyourspamdatabase.com&quot;, &quot;quickinbox.com&quot;, &quot;rcpt.at&quot;, &quot;recode.me&quot;, &quot;recursor.net&quot;, &quot;regbypass.comsafe-mail.net&quot;, &quot;safetymail.info&quot;, &quot;sandelf.de&quot;, &quot;saynotospams.com&quot;, &quot;selfdestructingmail.com&quot;, &quot;sendspamhere.com&quot;, &quot;shiftmail.com&quot;, &quot;****mail.me&quot;, &quot;skeefmail.com&quot;, &quot;slopsbox.com&quot;, &quot;smellfear.com&quot;, &quot;snakemail.com&quot;, &quot;sneakemail.com&quot;, &quot;sofort-mail.de&quot;, &quot;sogetthis.com&quot;, &quot;soodonims.com&quot;, &quot;spam.la&quot;, &quot;spamavert.com&quot;, &quot;spambob.net&quot;, &quot;spambob.org&quot;, &quot;spambog.com&quot;, &quot;spambog.de&quot;, &quot;spambog.ru&quot;, &quot;spambox.info&quot;, &quot;spambox.us&quot;, &quot;spamcannon.com&quot;, &quot;spamcannon.net&quot;, &quot;spamcero.com&quot;, &quot;spamcorptastic.com&quot;, &quot;spamcowboy.com&quot;, &quot;spamcowboy.net&quot;, &quot;spamcowboy.org&quot;, &quot;spamday.com&quot;, &quot;spamex.com&quot;, &quot;spamfree24.com&quot;, &quot;spamfree24.de&quot;, &quot;spamfree24.eu&quot;, &quot;spamfree24.info&quot;, &quot;spamfree24.net&quot;, &quot;spamfree24.org&quot;, &quot;spamgourmet.com&quot;, &quot;spamgourmet.net&quot;, &quot;spamgourmet.org&quot;, &quot;spamherelots.com&quot;, &quot;spamhereplease.com&quot;, &quot;spamhole.com&quot;, &quot;spamify.com&quot;, &quot;spaminator.de&quot;, &quot;spamkill.info&quot;, &quot;spaml.com&quot;, &quot;spaml.de&quot;, &quot;spammotel.com&quot;, &quot;spamobox.com&quot;, &quot;spamspot.com&quot;, &quot;spamthis.co.uk&quot;, &quot;spamthisplease.com&quot;, &quot;speed.1s.fr&quot;, &quot;suremail.info&quot;, &quot;tempalias.com&quot;, &quot;tempemail.biz&quot;, &quot;tempemail.com&quot;, &quot;tempe-mail.com&quot;, &quot;tempemail.net&quot;, &quot;tempinbox.co.uk&quot;, &quot;tempinbox.com&quot;, &quot;tempomail.fr&quot;, &quot;temporaryemail.net&quot;, &quot;temporaryinbox.com&quot;, &quot;thankyou2010.com&quot;, &quot;thisisnotmyrealemail.com&quot;, &quot;throwawayemailaddress.com&quot;, &quot;tilien.com&quot;, &quot;tmailinator.com&quot;, &quot;tradermail.info&quot;, &quot;trash2009.com&quot;, &quot;trash-amil.com&quot;, &quot;trashmail.at&quot;, &quot;trash-mail.at&quot;, &quot;trashmail.com&quot;, &quot;trash-mail.com&quot;, &quot;trash-mail.de&quot;, &quot;trashmail.me&quot;, &quot;trashmail.net&quot;, &quot;trashymail.com&quot;, &quot;trashymail.net&quot;, &quot;tyldd.com&quot;, &quot;uggsrock.com&quot;, &quot;wegwerfmail.de&quot;, &quot;wegwerfmail.net&quot;, &quot;wegwerfmail.org&quot;, &quot;wh4f.org&quot;, &quot;whyspam.me&quot;, &quot;willselfdestruct.com&quot;, &quot;winemaven.info&quot;, &quot;wronghead.com&quot;, &quot;wuzupmail.net&quot;, &quot;xoxy.net&quot;, &quot;yogamaven.com&quot;, &quot;yopmail.com&quot;, &quot;yopmail.fr&quot;, &quot;yopmail.net&quot;, &quot;yuurok.com&quot;, &quot;zippymail.info&quot;, &quot;jnxjn.com&quot;, &quot;trashmailer.com&quot;, &quot;klzlk.com&quot;, );
	$user_email_split = explode('@', $user_email); $user_email_domain = $user_email_split[1];
	if (in_array($user_email_domain, $dtwd_blocked_list)) {
	//Return 1, for detection
	 return 1; } else {
	 //Return 0 for no detection
	 return 0; } }
</pre>
<p>Note that if the email address that is causing you grief, doesn&#8217;t appear here, then simply include it in.</p>
<p>After this you need to modify your wp-login.php file. First locate the following, look around line 321, for where it says:</p>
<pre class="brush: php; title: ; notranslate">
// Check the e-mail address
	if ( $user_email == '' ) {
		$errors-&gt;add( 'empty_email', __( '&lt;strong&gt;ERROR&lt;/strong&gt;: Please type your e-mail address.' ) );
	} elseif ( ! is_email( $user_email ) ) {
		$errors-&gt;add( 'invalid_email', __( '&lt;strong&gt;ERROR&lt;/strong&gt;: The email address isn’t correct.' ) );
		$user_email = '';
	} elseif ( email_exists( $user_email ) ) {
		$errors-&gt;add( 'email_exists', __( '&lt;strong&gt;ERROR&lt;/strong&gt;: This email is already registered, please choose another one.' ) );
	}
</pre>
<p>and add exactly after this code, the following:</p>
<pre class="brush: php; title: ; notranslate">
elseif ( dtwd_blocked_emails( $user_email ) == 1) {
		$errors-&gt;add( 'blocked_email', __( '&lt;strong&gt;ERROR&lt;/strong&gt;: This email is not allowed.' ) );
    }
</pre>
<p>Now WordPress will check your user registration emails against your blocked emails.</p>
<p><span class="highlight_yellow">2. Block spam registrations by IP</span></p>
<p>If you know that all your spam registrations are coming from a particular IP, then you can simply add some quick and easy code to your htaccess file:</p>
<pre class="brush: php; title: ; notranslate">
Order allow,deny
Deny from 123.123.123.123
Deny from 156.156.156.*
Deny from 111.111.*.*
Allow from all
</pre>
<p>This blocks actions on your website such as commenting and registering, for anyone with an IP 123.123.123.123; any IP that starts with 156.156.156. and any IP that starts with 111.111.</p>
<p>Just be aware that this can also end up blocking out innocent users, so use with caution.</p>
<p><span class="highlight_yellow">3. Block spam registrations by using a User Registrations plugin</span></p>
<p>There are a few user registration plugins available, I&#8217;ve tried <a href="http://wordpress.org/support/plugin/sabre" target="_blank" rel="external nofollow">SABRE </a>before, and have mixed success with it, as I have found that it can quite quickly block new registrations that are genuine. Also the developer doesn&#8217;t seem to be responding at the moment to support questions.</p>
<p>Another plugin that appears to be effective is <a href="http://wordpress.org/extend/plugins/stop-spammer-registrations-plugin/" target="_blank" rel="external nofollow">Stop Spammer Registrations</a>, as it is rated well. Be sure to read this article by <a href="http://www.wpbeginner.com/plugins/how-to-stop-spam-registrations-on-your-wordpress-membership-site/" target="_blank" rel="external nofollow">WPBeginner</a> which details this plugin and has some cautionary advice.</p>
<p>Recently I also came across this one: <a href="http://wordpress.org/extend/plugins/wangguard/" target="_blank" rel="external nofollow">WangGuard</a>, which also seems highly rated.</p>
<p>I haven&#8217;t had the chance to test the last 2 plugins at all, so cannot advise either way as to their ease of use or effectiveness in reducing spam registrations. I prefer to use less plugins when I can, however you may find that you need to try one of these options.</p>
<p>If you have used these or any other registration plugins with great success, please share in the comments for our readers.</p>
<p><span class="highlight_yellow">4. Block spam registrations by using Cloudflare</span></p>
<p>I am a fan of Cloudflare, both for speed boosts in website performance, and also for added security. It&#8217;s a service that works like a CDN and it stands between your website viewers, including good visitors, crawlers, bots and malicious attackers, and your actual server files.</p>
<p>According to Cloudflare they use &#8220;threat data from a variety of sources to build a reputation for every visitor online. You set the desired security setting for your site and then CloudFlare’s network stops the threats before it reaches your website. Reputation-based security provides a first line of defense for your website.&#8221;</p>
<p>For more detailed information about the Cloudflare service see their <a href="http://www.cloudflare.com/features-security" target="_blank" rel="external nofollow">security page</a>.</p>
<p>Like any online service, however they are not without their <a href="http://blog.cloudflare.com/todays-outage-post-mortem-82515" target="_blank" rel="external nofollow">faults</a>, so be sure to research your options well before deciding on using Cloudflare or any other CDNs.</p>
<p>If you have used these ideas, or have other ideas, please comment below. And here is some more related reading:</p>
<div class="dtwd_related-posts">
<h4>Learn more</h4>
<ul>
<li><a href="http://www.davidtiong.com/setting-up-google-authorship-on-your-wordpress-website/">Setting up Google Authorship on your WordPress website</a></li>
<li><a href="http://www.davidtiong.com/using-the-title-and-alt-attributes-tags-seo/">Using the TITLE and ALT attributes for tags in SEO</a></li>
<li><a href="http://www.davidtiong.com/adding-meta-description-to-wordpress-pages-without-a-plugin/">Adding Meta Description to Wordpress pages without a plugin</a></li>
<li><a href="http://www.davidtiong.com/how-to-add-noindex-follow-to-pages-in-wordpress-stop-duplicate-content/">How to add noindex, follow to pages in Wordpress to stop duplicate content for SEO</a></li>
<li><a href="http://www.davidtiong.com/how-to-secure-wordpress-tips/">How to secure Wordpress tips</a></li>
<li><a href="http://www.davidtiong.com/create-wordpress-blog-sell-house/">Create a Wordpress blog and sell your house</a></li>
</ul></div>
<p> <!-- .dtwd_related-posts -->
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidtiong.com/block-spam-registrations-on-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: www.davidtiong.com @ 2013-05-26 19:00:32 by W3 Total Cache -->