My blog shares my own experience from working and living in Thailand. Feel free to share and please kindly give me the credit. Enjoy!

10 Most Popular Types of Websites

category:  Web development

When building a website, you should identify what type of website you need. The most popular types of websites are: E-commerce Blog Business Media/Entertainment Portfolio Educational Crowdfunding Non-profit Vlog Community Forums # E-commerce website E-commerce, also known as online shopping, is a website where visitors can directly buy the products and services. Also, the product can be both physical and digital products. Digital products are music, movie, WordPress themes, and WordPress plugins. Examples of e-commerce websites are Oriental Decor and … Read More

What You Need to Build a Website – Checklist

category:  Web development, WordPress

To build a website, there are 4 things you need. Domain Name Business Email Address / Contact Email Address Platform Web Hosting # Domain Name What is a domain name A domain name is a digital address for your website. It is where people can find and access your website. For example, my domain name is applerinquest.com. When you type “applerinquest.com” into browsers such as Chrome, IE, Firefox or Safari and hit the enter key, you will see my website … Read More

How to fix WordPress not sending Emails issue

category:  WordPress

Issues with email sending are some of the most common questions that I have from my clients. Often, the clients are not seeing any of the expected WordPress notifications. This is usually due to problems with their server configuration or their contact form configuration. # Server configuration WordPress is built in PHP which is one of the most popular server script languages. WordPress uses the PHP mail function to send out the emails. Normally, web hosting that supports PHP and … Read More

Why you need LiveChat for your website

category:  Web development, WordPress

Have you ever used LiveChat to ask some questions before buying the products or services? Have you ever used LiveChat for getting your support? If the answer is no, let’s read on. LiveChat is not new. It is been around for over 10 years. LiveChat helps many businesses grow. You may be one of them. What is LiveChat? LiveChat is an online customer service software with live support, help desk software, and web analytics capabilities. Below it shows how LiveChat … Read More

How to Create a Custom WordPress Widget

category:  WordPress

In the previous post, I talked about how to create the custom sidebar. Today, I will talk about how to create custom widgets for the sidebar. You can add the PHP code below into your functions.php in your child theme or create the new widgets plugin which is the same concept as the previous post. In this post, I will add the PHP code into the functions.php in my child theme. That’s it. When you navigate to Appearance>Widgets, you will … Read More

How to create a custom WordPress sidebar

category:  WordPress

The sidebar is one of a popular feature on the website. Often, it uses for blog or news page. Some WordPress themes provide the ability to add the new custom sidebar for the theme. But some don’t. If your current theme doesn’t provide the ability to add a new sidebar on your site, you have two options to do. Option 1: Using the plugin. You can use the Custom Sidebars plugin which is free. Option 2: Add the new custom … Read More

How to install and enable Memcache in WAMPserver

category:  Web development

Lately, I work on the WordPress website that my client enables Memcache on their site. In order to develop the features and have the full test on my localhost. I need to install Memcache on WAMPserver. Today I am gonna share how to install and enable Memcache on Wamp. I assume you already have Wampserver installed on your computer. If you don’t install WAMPserver yet, you can download and install it from this link. Let’s do it download the Memcache … Read More

How to transfer data from an old PC to a new PC for Windows 10

category:  Computer

Recently I bought a new laptop and I want to transfer all the data from my old laptop to the new laptop. My new laptop is already had Windows 10. So what I need, I just need to transfer the important data from my old laptop to the new one. My old data is around 345 GB. Here the methods that you can transfer the data between computers Using a USB data link Since I live in Thailand, I can … Read More

Owl Carousel plugin – jQuery carousel slider with fully customizable and responsive

category:  Web development, WordPress

A carousel slider is another popular feature that you see often on the website. Often you will see the carousel feature on the travel agency website, e-commerce website, business website and portfolio website. There are so many slider plugins in the market but today we will talk about an Owl Carousel plugin which is one of the popular sliders in the market. The plugin can display the image and video. Why use the Owl Carousel plugin? Fully customizable Touch and … Read More

How to add Google font to mPDF

category:  Web development

A few days ago, I added the Open Sans font which is a Google font into the mPDF library. My client uses mPDF 6.1. It is super easy. Here the steps you can follow. Download the custom fonts you want. For example, we want to add the Open Sans font. You can download the font files from here. Once the downloading file is complete. You will extract that download zip file. Then you will see the OpenSans-Bold.ttf, OpenSans-BoldItalic.ttf and so … Read More

Export the data as Excel file in WordPress

category:  WordPress

Last month, I had a request from my client to create the export data as the excel file in WordPress. The client has their own server and they wanted to focus on memory usage. Plus, the client uses the PHP 5.5 which is pretty old. I found one PHP class that met the client’s requirement. The PHP class is PHP_XLSXWriter. Let’s say, we create an archive download template in which the download is a custom post type. On the template, … Read More

Create a custom table plugin in WordPress

category:  WordPress

For WordPress, most of the time you can create the custom post type, custom taxonomy or custom category that fits your need. But sometimes you may need your own table structure to store your data. For example, you sync the data from the external system into WordPress. Today I gonna share with you how to create a simple custom table via the plugin. In this tutorial, we will do three steps below write a PHP function that creates a database … Read More

How to pass Javascript value to PHP in WordPress

category:  WordPress

Working on customization in WordPress sometimes we need to pass the PHP value to Javascript or Javascript value to PHP. Today I will share how to pass Javascript value to PHP in WordPress. Let says we have a criteria form in which the users can fetch the data by the criteria. The data will query from the database by PHP and display on the screen as it shows below. We actually take the sample from one of my posts here. … Read More

How to transfer the domains with websites, emails and calendar data from GoDaddy to 1and1

category:  Domain

Recently I get a request to transfer a domain, website, email account and calendar data from GoDaddy to 1and1. The current situation is my client hosts the domain name, website and email accounts on GoDaddy. On 1and1, they host the web applications that associate with the subdomains. On 1and1, the client sets their domain as the external domain. Important note When you transfer your domain to a different provider, usually only the domain itself is transferred. The following are not … Read More

Export your email, messages and calendar data – Migration

category:  Email

Last week, I had a request from my client to transfer the domain as well as all email accounts from GoDaddy to the new host provider. The email accounts are set at the workspace email. In order to transfer the email accounts including the calendar data, I need to export the email accounts and calendar data manually. You need to export the emails and calendar data before transferring the domain. Export the emails and email messages For exporting the email … Read More

How to update NodeJS and NPM to the latest versions

category:  NPM

Lately, I am starting to work on the Vuejs project. I installed NodeJS and NPM before but now I want to update them to the latest version. Today I would like to share with you. Update NPM to the latest version First, open your terminal then run the command line below. Check NPM version My result of the command is 6.4.1 Then runs the command below for update the NPM to the latest version Check NPM version again My result … Read More

Search by Custom Fields without a plugin

category:  WordPress

Lately, my client requires me to add the ability to search by custom fields at the backend. Today I gonna share what I did. There are three filters we will use. posts_join posts_where posts_distinct Below what page will be implemented. You can add the code below into functions.php or your own plugin. $_GET[‘s’] is the search input on the edit page. The posts_distinct filter is needed to prevent duplicate data. Yeap! that’s it. If you are looking for adding the … Read More

How to add a new column with Yii2 migration on a specific table

category:  Yii2.0 framework

Today I want to add a new column into the existing table in Yii2. Instead of adding the new column via the model I prefer to add the new column via the Yii2 migration script. With a script, I can easily revert the scrip in the command line. In order to work with the migration script, we will use the command line via the terminal. I use the bash terminal via VScode. You can use any terminal as you prefer. … Read More

How to Add Additional Custom Fields into WooCommerce Checkout Page

category:  WordPress

Woocommerce plugin is one of the most popular e-commerce plugins for WordPress. The core fields on the checkout page are very common. Most of the time, my clients ask for adding new fields and remove the core fields out of the checkout page. Today I gonna share how to add new custom fields and remove the core fields from the checkout page. Below is what we gonna do create a new custom plugin remove some core fields from the checkout … Read More

Common Git Commands

category:  Web development

Today it was a raining day. I was cleaning my repositories on GitHub and bitbucket. So it is a good chance that I can share the common git commands here. Common Git Commands git config git init git clone git add git commit git diff git reset git status git log git branch git checkout git merge git remote git push git config It is a git configuration values on a global project level. Executing git config will modify a … Read More

Add Embedded Videos to WordPress and Make Them Responsive

category:  Web development, WordPress

Recently, I got a request from my client to add the video into WordPress. Plus the video must be responsive. Today, I gonna share with you how to implement it. IFRAME & HTML For the iframe responsive, we need a <div> or any HTML tag that is a block style (display:block) wraps the iframe. Below, we add the <div> with video-container class which we will add the style later. STYLESHEET (CSS) Adding the style to our video-container. We set position … Read More

Gitflow for a complex project

category:  Web development

Last month, I had to work on the complex WordPress website and I had to work with other developers. The source code stores in GitHub since it is easy to use and organize for me. In order to connect to GitHub, you have to use Git which is a modern version control system. With Git, you can push and pull all changes to the repositories on Github. For my development, I use Visual Studio Code editor which is my favorite … Read More

The essential skills every web developer should have

category:  Web development

Recently I was asked by some startup CEO how to recruit the right web developer for fulfilling the experienced web developer position. This person should be able to manage multiple projects and time. He or she should be able to communicate well both with the team and clients who have a non-technical background. Additional, he or she should be able to learn the new technologies that are coming into the market every year. Before going through the list, I would … Read More

Add new font into yii2-mpdf extension

category:  Yii2.0 framework

In the Yii2 framework, you want to print or export the data as a PDF file. One of popular extension is yii2-mpdf. The extension uses an mPdf library. The extension is easy to use and the document is provided. However, if you want to add a new custom font in order to use in the Pdf file, no document in yii2-mpdf extension is provided. You have to look at the document of the mPdf library instead. For an experienced web … Read More

HTML1506: Unexpected token in IE

category:  Javascript, jQuery, Web development, WordPress

Yesterday, I received a support task from one of my clients. It was urgent because the users could not buy the product online. The issue occurred only in the IE browser(IE11 and IE edge). I checked the error message at the console and I found “HTML1506: Unexpected token“. I saw the same error back in 2015 when I worked with another client in the USA. This error is very common in IE. The cause The sample of JS code that … Read More

Filter Posts by Custom Taxonomy in Admin area in WordPress

category:  WordPress

Let’s say we have a custom post type called “hotels“. We create the custom field named “country” and “rating” and add both fields into the “hotels” post type. In the Hotels page at the admin area, it shows hotel title, country, rating, author and date columns as the screenshot below. There are two hooks that involve in this solution. One is ” restrict_manage_posts” and another one is “parse_query “. The restrict_manage_posts hook will add the dropdown filter at the admin … Read More

Localhost is not is the list of supported domains – reCaptcha issue

category:  Web development, WordPress

Google reCaptcha is a greate feature. It is easy to set and use on any website. If you are a web developer and you migrate the existing site to your localhost. When you are developing the website on localhost, on the form that you integrate the reCaptcha(V2 or V3) shows you, the error says “Localhost is not is the list of supported domains“. Well, there is a reason why and a solution to it.   According to the reCaptcha Developer’s … Read More

How to increase the maximum upload filesize in WordPress

category:  WordPress

Last year, I wrote, “How to increase the maximum file upload size in Multisite WordPress Network with WHM“. Today I gonna share how to increase the maximum file upload size in WordPress(Not Network site). The screenshot below shows where we will set today. What we are looking for three settings below memory_limit post_max_size upload_max_filesize From the frontend, you can add this PHP code into your PHP file. This file will print out all PHP settings for your site. Beware this information … Read More

Google SiteKit for WordPress

category:  WordPress

If you are working on online marketing or SEO, you should know the traffic tracking tools. One of the popular online tools is Google services such as Search Console, Analytics, AdSense and PageSpeed Insights. For WordPress, there are some good plugins to help you integrate Google product into your WordPress site. But those plugins don’t include all Google services. They offer only Google Analytics. But now you can add all Google services related to the website with SiteKit by Google. … Read More

Introduce affordable hosting with Awesome support

category:  Hosting

Last month, I switched from old hosting to InterServer hosting. I found out the InterServer hosting is the best choice for the freelancer, individual or small business(business website, e-commerce website, a non-profit website, student website). Why do I say that? Here are my reasons. Affordable hosting & Price Lock Guarantee I did some research and compare the shared hosting plan from the popular shared hosting plans such as Bluehost, HostGator, Hostinger, and GoDaddy. All the popular shared hosting plans of … Read More

How to add another new domain to your host

category:  Domain

Let’s say, you have a shared host that allows you to add more than one domain. You already have one domain set up with your host plan and you want to add one more domain. Today I gonna share with you how.     What you need to have before continuing Your new domain login. Once you bought a new domain, you will have your domain login. For example, if you register at NameCheap.com, you will have a NameCheap login … Read More

How to create the REST API with Slim framework

category:  Web development

What is API? API, you may hear about it often nowadays. API stands for an application programming interface. It lets your product or service communicate with other platforms. For example, you have your own custom application or custom website and you want to exchange your data with the Facebook app or mobile application or other applications, you can create your own API and allow those platforms to access your data that you want them to access. For the business standpoint, … Read More

Your connection on this site is not fully secure

category:  WordPress

Recently, I wrote the post of how to move a WordPress site to a new host with no downtime. At that time, I moved my site from non-secure site(http://) to secure site(https://). I notice at the address bar at the Chrome browser, I don’t see the lock icon which represents the secure site. Instead, I see the info icon. When I click on the info icon, I see “Your connection on this site is not fully secure” message. Today I … Read More

How to Move your WordPress site to a New Host (with No Downtime)

category:  WordPress

Four months ago, I wrote a blog about how to move WordPress to a new host without any plugin. This method is useful if your site is big and complex and you don’t offer the RSS feeds. But if your site is small then you can use the Duplicator plugin. It provides both Free and Paid version. Plus using this plugin for moving the site, you get zero downtime.     How to use? It is really simple. Just follow … Read More

How to download the data as csv file in WordPress – deal with the PHP old version

category:  WordPress

Yesterday, I had a request to implement the download data as an excel file from WordPress. The client’s business sells wholesale and retail products. They want their partners to be able to download the product detail as PDF and Excel files. The PDF file is already implemented using the Mpdf library (I will write the mpdf tutorial sometime in the future). Today I will share with you how to implement the download as an excel file. Deal with PHP old … Read More

How to install multiple PHP and MySQL versions on WAMPserver

category:  Web development

Recently I am working on the WordPress site from a new customer. The client’s server is using PHP5.5.38 which is an old version. The newest version is 7.x.x. However, the client doesn’t want to upgrade the PHP version yet. In order to develop and support smoothly, I need to install the PHP 5.5.38 in my localhost. So when I develop, I will be sure nothing will break when I deploy to the client’s server. For my development environment, I use … Read More

WordPress Security Guide

category:  WordPress

A couple of days ago, I saw a post from the Facebook WordPress group asking for help. The issue was that his WordPress site got hacked. The hacker somehow put a hidden script into the server and set the schedule to run the script every 24 hours. The unexpected code that the hacker script generated showed in the index.php at the beginning of the file. That code added a ton of external files into the WordPress media library and if … Read More

How to Point a Domain Name to Your Site

category:  Domain

“How to Point a Domain Name to Your Site” is a normal question that my clients ask me often. Most of them don’t have any knowledge of web technology. They don’t know that domain name and web hosting can host in a different place but they can work together. Let me explain in plain English. A domain name is an address URL that allows people can visit your website from the browsers(Chrome, IE, Firefox are browsers). The same idea that … Read More

Dev domain name with an SSL certificate

category:  Domain

If I remember right, since 2017, the .DEV is intended to be a secure namespace, so all potential .DEV domain owners must secure their website with an SSL certificate. Even you create the virtual host on your own localhost or server. The modern browsers will automatic add https for your dev domain. More information can be found here. I write the post to remind myself or others who create the dev domain name and find out the https is added … Read More

D.I.Y Air Purifier in 10 sec

category:  Life in Chiang Mai

This year, the air pollution in the North of Thailand is the worst in the history. Chiang Mai air quality hit the first ranking of World AQI chart last month. That how the air pollution was bad here. This is the first time for me to hear PM2.5 from the news and social network every single day until now. Below is the AQI virtual map on 16 Apr 2019 at night time. A few weeks earlier, there were so many … Read More

Living in Thailand with Termite

category:  Life in Chiang Mai

Living in Thailand, you may see or hear people has a termite problem. In Thailand, we build the house with the concrete(mixing between cement and sand) and steel. A few of houses built by half concrete and wood which are the old house that are probably more than 30 years old. Termite nest can be found under the house ground and under the big tree. 90% of house damage comes from the nest under the ground. They eat anything with … Read More

How To Automatically Delete Forwarded Emails in CPanel

category:  cPanel

Lately, I set up a new host as well as the email accounts for my client. The host I use it is the Siteground. The host is really great. I have been using it for another e-commerce website(the site includes more than 5000 products) for a year without any issues. However, the plan that I bought the email storage is limited around 4 GB for each email account which is quite small for the small business. The solution that I … Read More

How to set the application timezone and MySQL for Yii2

category:  Yii2.0 framework

I built my own application in 2017 when I lived in the USA and all my clients were American. The timezone that I set at that time is Pacific timezone. In 2018, I moved back to Thailand and I need to set a new timezone. I will share how to set the timezone in MySQL and PHP in the Yii2 application. My host is a shared host so if you have the dedicated host it will work as well. Set … Read More

How to Move WordPress to a New Host

category:  WordPress

There are two ways that you can move the WordPress website to the new host. One is using the plugins and another is using PhpMyAdmin or other MySQL interface application. I gonna talk about moving the site without the plugins. I assume that you already have the new domain name or using the current domain name. Also, you already have the new host login (cPanel).   Here are the steps we will do. Export the database from the phpmyadmin at the … Read More

How to clear the assets cache in Yii2

category:  Yii2.0 framework

With Yii2, it comes with the asset management calls asset bundle. An asset bundle is simply a collection of assets located in a directory. When you register an asset bundle in a view, it will include the CSS and JavaScript files in the bundle in the rendered Web page. Below is my asset bundle setting in my application. I use the advanced template from Yii2 and I use the frontend for my application(backend, console, and frontend folders are generated from the advanced … Read More

How to save the multi-records in one model in single transaction in Yii2

category:  Yii2.0 framework

Recently I just add the new feature on my application. What new feature does, it generates the new invoice from the time-sheet. This way, my clients can see my log time and note on each task. So they know in detail what I did for their project. The steps are; get the time-sheet data filtered by the specific client, date range and unbilled status In the time-sheet loop, insert the new invoice and invoice detail If something goes wrong while … Read More

How to export database from Yii2 application

category:  Yii2.0 framework

The export database feature is nice to have for backup and restore the database from either website or web application. I added the export database in my application using the PHP based MySQL dump library. I did the search and found more two ways to achieve my goal but they have the issue with the null value and text data type. One of the two ways is to generate the insert script with PHP which can not generate the insert script … Read More

How to create the bulk action in Yii2

category:  Yii2.0 framework

Howdy, working in the back-end in the web application, often you will find the bulk actions is very useful when you want to do the action with more than one record at once. Today I will share with you how to create bulk actions and work with grid view widget. Plus I use the pjax widget to make the changes from the action without reloading the whole page. The screenshot below shows the bulk action in Yii2 Here is what … Read More

How to create the module in Yii2

category:  Yii2.0 framework

Recently I have been adding the new features to my own application. I add new features using the module so I can disable and enable each module easily in the application configuration. The module is a self-contained software unit that contains models, controllers and views and components. I prefer to use Gii module to create the new module. I set up my application with the advanced template and I build my application in the frontend root. Gii module URL(with enabling … Read More

How to remove the extension or package with composer

category:  Yii2.0 framework

Often when I work with the PHP framework and I want to install the extensions or packages in general term, in order to use in the framework, for PHP, we use composer. In js framework, you will use npm or yarn. To install the extensions, the third party(extension owner) page will let you know the installation composer command. But often they don’t provide you how to remove or uninstall the extensions. I will share this with you today. When the … Read More

(TM47) 90 days reporting for Thai Retirement Visa – Online

category:  Life in Chiang Mai

(last update on 9 Jan 2019) For Thai Retirement Visa, you must report every 90 days. It is time consuming if you have to report in person. Luckily, you have a choice that let you do online.   Follow the link below. You must use Internet Explorer to access this website. Chrome and Firefox do NOT work. 90 days reporting online   It will take around 24 hours for me and you should get the ACCEPTED email from the website. … Read More

How to add the pagination dropdown list in GridView in Yii2

category:  Yii2.0 framework

Earlier, I wrote how to add the summary footer in the gridview widget. The grand total column will sum all the total columns on each page and the default page size of gridview is 20 items per page. I want to be able to change the page size as I want in order to see the new grand total if I choose the search filter. Below is the screenshot that I did. We will add the extra code in two … Read More

How to add the summary in the Gridview footer in Yii2

category:  Yii2.0 framework

Currently, I am building the invoice feature in my own application with Yii2. I use the gridview widget for displaying all invoices data. I want to add the grand total for all invoices. Just like the screenshot below. To do that, I have to add the extra code in two places. Note that, I generate the CRUD from Gii. So I will show only the code that I add for displaying the grand total at the gridview footer. First place, … Read More

Building WordPress Plugins with Object Oriented Concept

category:  WordPress

When I develop the custom plugin, I prefer to build the custom plugin with Object-Oriented Programming(OOP) to avoid the conflict from other plugins or the themes. Plus my code is cleaner and more organized. Today I will share how to create the report plugin with OOP. Here what the plugin does: The plugin will display the data regarding the criteria. I use the datatable plugin for the data table with search, pagination and column sort features. The datatable plugin has … Read More

How to validate a form with jQuery validation plugin

category:  jQuery, Web development

When you want to do the form validation you can do from the client-side and server-side. I like to do on the client-side so users can get the notification message right away after leaving the input field. The form validation on the client site is very useful when your form contains a lot of fields. On jquery plugin that I often use, it is jquery validation. It is easy to use and I can add my custom method, custom message, … Read More

How to avoid jquery conflicts in WordPress

category:  jQuery, WordPress

WordPress developers know that the jQuery in WordPress runs in noConflict mode. This means when you enqueue the script that is dependent on jQuery in WordPress, you cannot use the common $ alias. To solve this issue, you can place your code using the $ shortcut inside a noConflict wrapper. Here is an example. in PHP file in JS file If you need to load the script in the header after the document is ready, you will use the code … Read More

How to pass PHP value to JavaScript in WordPress

category:  WordPress

Often when I work on the custom plugins or custom themes, I will call the PHP functions within JavaScript. I do that because I want the data that normally can access via PHP to be available on my script. In WordPress, you can call the PHP functions within JavaScript easily by using the wp_localize_script function. What it does, it allows you to get the data from the server-side to the client site. Usage: Here is an example in the main plugin … Read More

How to create the shortcode in the WordPress plugin

category:  WordPress

Create the shortcode is very simple. Only one thing you have to remember is to print out the content from the callback function. You can add the content to the variable and return this variable in the callback function. However, there may be some cases that you don’t want to store everything in one variable and return it. In this case, you can use ob_start() and ob_get_clean(). I will give you these two examples. In my tutorial, I use the class … Read More

How to make a WordPress Admin Options page without using the Setting API

category:  WordPress

Last week, I did one small task which is adding the floating survey button on the front page. At the backend, the client is able to add the link and enable or disable the survey button for the front page. I create the plugin for this feature. Below is the screenshot for the frontend and backend. Front End Back End Here is what we are going to do in this post. Create a new plugin Add the survey setting form at … Read More

Translating WordPress Plugins

category:  WordPress

A few days ago, I wrote how to add the translation files to your child theme. If you use the theme which doesn’t come with the translation files for your language, you should check this post. Today I gonna talk about how to add the translation files to your plugin. There is one different thing from the theme translation files which is the translation file name. Okay, let do this. Where the translation files will be stored We will create … Read More

Adding Translation Files To Your Child Theme

category:  WordPress

Last week, I received the urgent project from my client. The site needed to be online within one day. The client requested only two pages which were the front page and contact page. Also, I needed to add all content and design the template as well as the color theme for them. Finally, the site has only one language which is Thai.  Note that the method in this post can apply to any languages. I decide to use the Virtue Free … Read More

Checklist for Thai Retirement Extension

category:  Life in Chiang Mai

For a Thai retirement visa, a person who holds this kind of visa must report at the immigration every 3 months. You can report 15 days before the due date or 7 days after the due date. If you miss your report, the fine is 2,000 baht. Also, you should go to the immigration before opening in order to get your queue. There is a limit of queues each day. Regarding the information that I get from the immigration officer, here … Read More

How to send an email using SMTP in localhost with WAMP

category:  Web development

When I develop the email function on my localhost, I like to set the Gmail account for sending an email from my localhost. It is convenient and easy to set up. Today, I will share how to set up the Gmail account to send an email from your WAMP server.  Note, this method works for Windows only.  Okay, let’s do it… Download sendmail.zip Sendmail.exe is a simple windows console application that emulates sendmail’s “-t” option to deliver emails piped via stdin. It … Read More

How to make your WAMP runs faster in Windows10

category:  Performance

I have been using WAMP for years. Sometimes I notice the web page loads slower than the same web page on the internet. So I did research on the internet and found out for my case, I just need to set the Power Options in Control panel to high performance. You can try this solution for both Windows.   Just small fix but makes things different.

My Favorite Visual Studio Code Extensions

category:  VSCode

I have been using the visual studio code since 2016. The cool features that I like the most is the outline code and Emmet. It is very useful when I develop the complex application or large website. Other extensions that I often use, are below. @ update on 3 May 2019 Mainly I work on PHP, SASS, LESS, javascript, CSS and HTML. Reactjs and Vuejs are fun to work with as well. What is your favorite extensions?

How to change the default drop-down box on iPhone

category:  Web Designer

When you are working on the responsive design. You want your design works well across all devices. Today I will share how to change the default dropdown box on the iPhone.   HTML <select> <option value=”Apple”>Apple</option> <option value=”Samsung”>Samsung</option> <option value=”Huawei”>Huawei</option> <option value=”Oppo”>Oppo</option> </select> CSS select{ background: url(data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0Ljk1IDEwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6IzQ0NDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmFycm93czwvdGl0bGU+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNC45NSIgaGVpZ2h0PSIxMCIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxLjQxIDQuNjcgMi40OCAzLjE4IDMuNTQgNC42NyAxLjQxIDQuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMy41NCA1LjMzIDIuNDggNi44MiAxLjQxIDUuMzMgMy41NCA1LjMzIi8+PC9zdmc+) no-repeat 95% 50%; -moz-appearance: none; -webkit-appearance: none; appearance: none; /* below you can add your style */ height: 30px; width: 100px; padding: 5px; } And that’s it.   tip: My sample above, the … Read More

Redirect the old URL to new URL in WordPress

category:  WordPress

It is common that your clients want to change the slugs for the different reasons. When the slug of the page changes, the old URL will return 404 error. Normally, we will redirect the old URL to the new URL for the SEO reason. There are a few ways that you can do the redirect, for example, add the redirect command in .htaccess, using the wp_redirect function from Wordpress or the simple way which is using the new page redirect template. In this … Read More

Remote Debugging On Android Devices From Windows

category:  Debug, Web development

Sometimes, you have a style issue that occurs on the real mobile device only. If you were developing the site on the PC, it is easy to use the inspection tool that comes with the browsers. But for the real phone, the easy way to do the inspection is using the remote device feature from Chrome. I will share what I do here.   What you will need. Phone with Android operation – Android version 4.0 (Ice Cream Sandwich) or … Read More

Add a MailChimp Signup Form to Your Website

category:  WordPress

A few days ago, I got a request to add the signup form from MailChimp to the WordPress site. There are four fields in the form which are first name, last name, phone number, and email. All fields are required. Phone number and email must validate. After submitting the form, we will show the success message on the same page. The submit form will process by Ajax. let’s do this.   MailChimp register and login Register and Login First, we … Read More

How to add the links inside the select box

category:  Javascript

We all know that we can not add the links inside the <option> in the select box. Today I gonna share one simple trick with pure javascript.   Let’s say you want to add the links inside the <option> like this. <select class=”menus”> <option value=”Home”><a href=”home.php”>Home</a></option> <option value=”About”><a href=”about.php”>About</a></option> <option value=”Contact”><a href=”contact.php”>Contact</a></option> </select> Of cause, it is not working.   Here is the correct one with the javascript. <select class=”menus” onchange=”location = this.value;”> <option value=”Home.php”>Home</option> <option value=”About.php”>About</option> <option value=”Contact.php”>Contact</option> </select> … Read More

How to increase the maximum file upload size in Multisite WordPress Network with WHM

category:  WordPress

Today I have a request from the client to increase the maximum upload file size for WordPress Network. The server is WHM(WebHost Manager). I gonna share with you how to increase step by step. Let’s start.   Media Library in WordPress single site The screenshot shows where we will set in this post.   WHM What is WHM? WHM stands for WebHost Manager. WHM provides administrative control over your dedicated server or VPS. You can manage the server and host your … Read More

How to trigger a click on a link using jQuery

category:  jQuery

Today I am working on some small tasks. It should not take long. But I stuck on one issue for a while. Here is what I am trying to do.   I have the page link list that is generated by the pagination_link from WordPress. The code looks like this. $big = 999999999; $url = str_replace($big, ‘%#%’, html_entity_decode(get_pagenum_link($big))); $pagination_dropdown_args = array( ‘base’ => $url, ‘format’ => ‘?paged=%#%’, ‘total’ => $total_pages, ‘current’ => $paged, ‘show_all’ => true, ‘end_size’ => 1, ‘mid_size’ => … Read More

Thai Retirement Visa

category:  Life in Chiang Mai

Today my husband went to apply for the Thai retirement visa at Chiang Mai immigration office at Promenada. The office opened at 8.30 am but we saw many people get in the line when we arrived. We got the latest queue of today. The officer told us to come back again at 3 pm. We came back to the immigration office at 2 pm and waited there until they called our number. The process is simple. The officer checked all documents, … Read More

I can not access to WP dashboard after migration

category:  WordPress

Today I am working on one WordPress project. The site is very simple. No extreme plugins are on the site. What I did, I just migrate the database (using WP Migrate DB plugin) and transfer all WP files to my computer. Then I just edit the database login in wp-config.php. After that, go to site URL. Yeap, everything is working perfectly. Then I go to login URL (yourdomain.com/wp-login/) and enter the WP login. I expect to see the WP dashboard … Read More

Multiple grids on one page in Yii2

category:  Yii2.0 framework

Recently I upgrade my application and I add two Gridview widgets on one page. Everything seems working fine until I notice the pagination of all Gridview widgets won’t work properly. There are two issues that I found.   Issue #1 One issue is every time I click on one of pagination of any Gridview widget, all paginations changed. For example, I click on page number 5 of one of the paginations and other paginations change to 5 as well. To fix … Read More

TM30 – report to immigration within 24 hours

category:  Life in Chiang Mai

Lately, if you are the house or condo owner and you have the foreigners stay in your properties, you must report the immigration within 24 hours. If not, you will be fine 1,600 baht. Here is the document you need. a copy of the foreigner passport a copy of arrival card a copy of a visa a copy of your ID card a copy of your house register book a TM30 form (You can download from the immigration website or … Read More

How to get Thai motorcycle driver’s license in Chiang Mai

category:  Life in Chiang Mai

In Chiang Mai, the best way to get around in the city is using the motorcycle. If you have NON-O visa (NON-Immigrate visa), you can apply for the driver license.   Here is the document you need for apply Passport Copy of your passport Copy of your arrival card Copy of your NON-O via Resident certificate or work permit 2 photos (4 x 6 cm size) with white background Medical Certificate (You can get from any polyclinic. You must tell the … Read More

WordPress VS Modx

category:  Web development

Before you read this post, I want to say the post is my opinion. Some people may think differently from me.   I started to use Modx in 2009. It was fast learning and developing. You can transfer the HTML template into Modx easily. You should know PHP for writing the snippet. You should know HTML and CSS for writing chuck. To make the multilingual website, simply to install the add-on and do some configuration. And it is done.   … Read More

How to get a residence certificate in Chiang Mai

category:  Life in Chiang Mai

My husband is a foreigner and he wants to get a motorcycle driver license in Chiang Mai. Before he applies for a driver’s license he needs to get a residence certificate first. Since we rent a condo, the landlord must inform the immigration if there are any foreigners staying in their properties. The landlord must fill in the TM30 form (download form available on the immigration website) and go to the immigration at Promenada shopping mall on the second floor. The office … Read More

SASS, CSS framework and Task runners

category:  Web Designer

Many years ago, I worked with a web designer. What she did, she designed and created the templates for the web applications and gave to the developers to integrate into the web application. At that time, I never used CSS frameworks or any pre-processor compiler before. I just used the templates and stylesheet that she created.   But there were many times that I needed to adjust the color, padding and so on in the templates in order to fit … Read More

Upload file won’t send to backend with Ajax

category:  jQuery, Web development

Sometimes you create a form by containing the file input field(such as upload image file) and other text input fields. And you want to send all form data to the backend using Ajax. But you find out the only the file input data won’t send to the backend. Why? You may send the form data using serialize(). This is the cause that your backend won’t get the file input data via Ajax. Here is the code snippet using serialize(). $(“body”).on(“beforeSubmit”, … Read More

Global search box in grid view widget in Yii2

category:  Yii2.0 framework

One feature that the users like, is the global search. With CRUD from gii module, the index.php comes with filters for each column in grid view. The attribute calls filterModel. It is good and it is working perfectly. But it would be better if users can search for anything from one search box. In this post, we will implement the global search box for Currency index page. What we will do CurrencySearch.php (in models folder) Add new $globalSearch variable Set … Read More

Ajax validation in Yii2

category:  Yii2.0 framework

Yii version 2.0.13.1  When you are working on a form validation, sometimes it is better for the users if you do the Ajax validation on a form. This way, users will get the warning message after they fill in each field. Here is an example. We have a branch table. We want a branch name to be unique. What we will do: Model – In a branch model, we set the branch name in a unique rule. View – In … Read More

VScode and XDebug

category:  Debug, VSCode

Visual Studio Code version 1.19.3 Recently I change my developing tool from NetBeans to VScode(Visual Studio Code). The main reason is, VScode is faster. Plus I can integrate the XDebug extension to VScode easily. Here I will share with you how easy to set XDebug in VScode.   Create a test.php in your web root and add phpinfo(); to the test.php Go to your browser (Chrome, Firefox, IE, Safari, etc) then visits http://localhost/test.php. After that, copies all text on a screen and pastes into … Read More

Override delete confirm dialog in Yii2

category:  Yii2.0 framework

Yii version 2.0.13.1 In the grid view widget, the delete button uses the window confirm dialog which is simple. But it would be better if it can be changed to use the confirm dialog with bootstrap style. Since Yii2 is already integrated with the bootstrap widget. In this tutorial, I will share how I implement the new confirm dialog with a translated message by Yii::t().   Here what we will do Download the bootboxjs which is a small javascript library. It allows you … Read More

Language switcher in Yii2

category:  Yii2.0 framework

Yii version 2.0.13.1 Currently, I am building the custom application with Yii2. I want to add the language switcher in the application. I found some posts that help but these posts won’t explain well. So I try to explain what I did here. Here what we will do: create the static value in config/params.php create a language dropdown list in layout/main.php create a actionLanguage() in the controller create a LanguageSelector component create a JS file for calling the actionLanguage() via … Read More

All javascript won’t work after Pjax reloads in Yii2

category:  Yii2.0 framework

Yii version 2.0.13.1 When you work with Pjax either Pjax jquery or Pjax module, you may face the same issue as me. I am working on the Pjax widget in Yii2.0. The widget uses Pjax jquery. ProblemEvery time the Pjax reloads, all js that attached to DOM in Pjax container won’t work. CauseAfter Pjax finishes reloading, the js that set to DOM in Pjax container will not pick up on these changes. SolutionYou must reinitialize the js to DOM after … Read More

Select2 plugin does not function properly in bootstrap modal

category:  Web development

Yii version 2.0.13.1 Select2 plugin is very useful plugin when you are building the custom application or website. ProblemWhen I use the select2 inside a bootstrap modal. I can not type anything in the input field that attaches to the plugin. CauseThis issue occurs because the Bootstrap modal tends to steal focus from other elements outside of the modal. Since by default, Select2 attaches the dropdown menu to the <body> element, it is considered “outside of the modal”. SolutionAttach the dropdown to … Read More

Pjax is not working, reloads the whole page

category:  Yii2.0 framework

Yii version 2.0.13.1 Recently I am working on building the custom application with Yii2.0. I have one issue with Pjax widget. It turns out to be a common issue when you are working on Pjax. ProblemI want to render the creating form in the modal on an index page. After users submit the form, the modal will be closed and the grid view will be refreshed. This way, users won’t leave the index page. The problem is Pjax reloads the whole page … Read More