Archive

Archive for May, 2009

Strategically inserting Google ads into Wordpress blog

May 21st, 2009

Have been working hard to promote blog.52my.info, but have realized that there isn’t an easy way to add google ads more naturally in between posts.  Some research landed me on Problogger.net (an excellent blog that teaches/motivates people how to make money blogging — I am a believer in Darren).

To more naturally add google ads, what you simply need to do is modify your “Main Index Template” usually the index.php file.  In there you should find a while loop that looks something like:

if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;

just change it to something like this:

// Set Counter to 1, First Post
$counter = 1;
if (have_posts()) :
   while (have_posts()) :
      $counter = $counter + 1;
      the_post();
      the_content();
      if(2 == $counter)
      {
         echo 'Adsense code';
      }
   endwhile;
endif;

the things to look for and add are in bold.  The “2″ indicates that google ads will be inserted in every 2 posts. This information was obtained here

blog posting, technical notes, wordpress , ,

Magento Notes — Default sorting is not logical

May 19th, 2009

Now that I have my e-commerce site, tickon.com, running for a while (3-months), I am back at it adding more products to link to my affiliate partners (this is a new experiment on this web site).

As I started to add new products, I noticed that newest items are added to the last page of the category that it was assigned to…not a very smart implementatio in my opinon. Did some googling and found a fix here:

http://www.magentocommerce.com/boards/viewthread/1176/

Essentially what needs to be done is to fix the file: app/code/core/Mage/Catalog/Block/Product/List/toolbar.php

near line 47, I changed the original code to the following:

$this->_availableOrder = array(
‘entity_id’ => $this->__(’Newest’),
‘name’      => $this->__(’Name’),
‘price’     => $this->__(’Price’)
);

The first item listed will be the default sort filter, the default was “best value”…which didn’t make a lot of sense to me.

Second item to fix up is in the same file, but you go to line 108 (approx.) and modify the highlighted part as below:

public function getCurrentDirection()
{
if ($dir = (string) $this->getRequest()->getParam($this->getDirectionVarName())) {
$dir = strtolower($dir);
if (in_array($dir, array(’asc’, ‘desc’))) {
return $dir;
}
}
return ‘desc‘;

default is asc, but you need to change it to descending so that it sorts from newest id first.

blog posting, e-commerce, magento, technical notes , ,

Relaunch of OCCACC.ORG

May 5th, 2009

I would also like to take this time to announce the relaunch of Orange County Chinese-American Chamber of Commerce (OCCACC.ORG) web site.  It is a web site dedicated to  developing Chinese-American commerce by providing assistance in business management business operation, trade materials, and business experience.

Please send any questions and feedback related to the web site to me. Thanks.

blog posting, news, wordpress , ,

Upgrading Wordpress from 2.6.x to 2.7.x

May 5th, 2009

I have recently being doing a lot of moving. Moving web sites that is, from Godaddy to Simplehelix, as i am trying to clear my godaddy vps to be dedicated for 52my.info web site. The hits on 52my.info has been growing steadily. But we are hoping for a POP soon!!

Anyways, as I start moving my sites from one host to another, i figured, why not take the time to also upgrade my older blog sites to the newer WP versions, so I did a quick search and I came across a great post by Siddharth, but I will do a quick summary of what worked for me:

1. Backup the following files and folders :
* Folder: wp-content (backup the whole directory)
* Config File: wp-config.php (file)
* Database: Database (using phpmyadmin, backup the whole database, safe.)
2. Downloaded the latest Wordpress here.
3. Delete all the old Wordpress files .
4. Extract and upload (or upload and extract) the new Wordpress files.
5. Copy the wp-config.php to the Wordpress root directory.
6. Run wp-admin/update.php (http://yourwordpresssite/wp-admin/update.php). It will ask for a database upgrade, continue. If all goes well it will redirect to a blank page.
7. Delete the new wp-content directory and upload your old wp-content directory in place of it.
8. Visit your site! All your posts and plugins will be active and it will look the same! (All incompatible plugins will be disabled automatially, but most of the plugins that work with 2.6.* also work with 2.7
9. Admin URL is the same: http://yourwordpresssite/wp-admin/

Thanks Siddharth!! for for this wonderful guideline!!

blog posting, wordpress , ,