81 Billion

Websites in Singapore that are highly effective and visually appealing

SQL: Add one month to a date

Posted on | February 16, 2013 | Comments Off on SQL: Add one month to a date

SELECT DATE_ADD('2008-12-15', INTERVAL 1 MONTH)

Eg.

UPDATE jobs_listed
Set end_date = Date_Add(datecreated, interval 2 month)
Where jobpostingtype = 3

UPDATE jobs_listed
Set end_date = Date_Add(datecreated, interval 1 month)
Where jobpostingtype = 2

UPDATE jobs_listed
Set end_date = Date_Add(datecreated, interval 3 month)
Where jobpostingtype = 1

SQL : Copying one column to another in the same table

Posted on | February 16, 2013 | Comments Off on SQL : Copying one column to another in the same table

UPDATE <tablename> SET <destination column name> = <source column name>

Adding .html to permalinks and making it looks like a static pages

Posted on | February 3, 2013 | Comments Off on Adding .html to permalinks and making it looks like a static pages

  • For Post:   Set permalink to Custom Structure with   /%category%/%postname%.html
  • For Pages:   Use “.html on PAGES” plugin
  • For Category:   Use “Permalink Trailing Slash Fixer” plugin
    • To avoid trailing slash at pages, change the code in the plugin
      from:
      function ppm_fixe_trailingslash($url, $type)
      {
      if (‘single’ === $type)
      return $url;return trailingslashit($url);
      }To:
      function ppm_fixe_trailingslash($url, $type)
      {
      if (‘single’ === $type)
      return $url;
      if (‘page’ === $type)
      return $url;
      return trailingslashit($url);
      }

    4.  Change image folder in the “Miscellaneous Settings”.

Moving OpenCart to another server

Posted on | January 20, 2013 | Comments Off on Moving OpenCart to another server

  1. Copy all files to the new server.
  2. Export the OpenCart database and import it to the new server
  3. Edit config.php and admin/config.php

How to set expiry date for WordPress Post

Posted on | January 16, 2013 | Comments Off on How to set expiry date for WordPress Post

Add following code to the index.php file:

$currentdate ) {
// Enter your post display code after that.
the_title();
the_excerpt();
// Post display code ends here.
}
endwhile;
endif;
?>

Then create a custom field and name it as expiration. Enter date in the format of : yyyy/mm/dd

Layout problem on iPad

Posted on | January 11, 2013 | Comments Off on Layout problem on iPad

When your graphic doesn’t span the entire width of the page:

1. Check the max width used in that page.
2. When width is set to 100%, problem may arise with viewport of iPad as viewport may define your header width to be 100% and zoom in or out accordingly.
3. This will cause some sizing problem on div set to 100%
4. Solution is to set the min-width on the body tag to be the same as the max width of the page

iPad Emulator

Posted on | January 11, 2013 | Comments Off on iPad Emulator

You can use the emulator at www.ipadpeek.com on your window browser to check how your website will look like in iPad.

Also check out the article on “Check how your website look in iPad Browser without iPad” when it use the iPad user agent.

Check how your website look in ipad browser without ipad

Posted on | January 6, 2013 | Comments Off on Check how your website look in ipad browser without ipad

Enter about:config at Firefox,

Right click and select new string value

Enter: general.useragent.override and click OK

Enter: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10

Click OK

Passing URL variables on Perma links

Posted on | January 2, 2013 | Comments Off on Passing URL variables on Perma links

  1. Add following to the functions.php

    add_filter('query_vars', 'parameter_queryvars' );

    function parameter_queryvars( $qvars )
    {
    $qvars[] = 'refid';
    return $qvars;
    }

  2. Call variables:

    <?php if ($refid=='NEW CARS') {echo 'JACKPOT';} ?>

Turn off comments on wordpress

Posted on | December 31, 2012 | Comments Off on Turn off comments on wordpress

  1. To turn off comments on new posting/pages:
    Settings >> Discussion >> uncheck “Allow people to post comments on new articles”
  2. To turn off comments on already publish posts:
    Posts >> select them all and “Edit” under bulk actions and hit apply >> choose “do not allow” next to comments and hit update posts.
  3. If you do not want any comments at your wordpress:
    Disable the comment tag in single.php
    <?php// comments_template( '', true ); ?>
« go backkeep looking »

    About

    This is an area on your website where you can add text. This will serve as an informative location on your website, where you can talk about your site.

    Subscribe to our feed

    Search

    Admin