Archives

Transfer Files Server to Server Using Simple PHP

server-to-server-php-zip

Sometimes you need to move/migrate files to another server/hosting, and you/your client only have FTP access to the server. And to download these files and re-upload to another server can take a lot of time using FTP client such as Filezilla. FTP do not have zip – unzip functionality, so you need to upload it one by one. And server to server transfer is a lot faster than downloading and uploading the files.

You can use this simple PHP script to move files from one server to another server. Read More Transfer Files Server to Server Using Simple PHP

Simple Mobile Browser Detection using Javascript

In earlier post about wp_is_mobile() I explain that we can use wp_is_mobile() WordPress function to design theme by adding wp-is-mobile body class and use it in CSS and Javascript/jQuery.

But @samikeijonen mention that similar method was removed from twenty fourteen theme because if we use page cache/html cache the result will also be cached.

 

 

responsive

So I think the best way to use wp_is_mobile() is to also detect mobile browser via javascript/jQuery using this simple code: Read More Simple Mobile Browser Detection using Javascript

WordPress Editor (TinyMCE) how to create line break <br> and not paragraph <p>.

wp-editor-br-vs-p

This is a very simple tips/snippet. One of the biggest annoyance for first time WordPress user is that WordPress Editor/TinyMCE will produce paragraph tag instead of just simply add a line break. This makes it really hard for newbie switching from other blogging platform/social media to write a new content.

This mostly happen to my client (and my self) when first switching from blogger (google) to WordPress or use social media like facebook, twitter, or forum (vBulletin, etc) which do not do this/have this behavior.

What is <br /> and what is <p>?

In WordPress when we write content and hit “Enter”, we will add new paragraph, and there will be a margin in between text, some people try to hit “backspace” to remove the extra margin, but instead it will go to the previous line. It’s probably easier to explain using picture:

why-like-this-wp-editor-br-p

The first (with no margin in every line) is using line break / <br/> tag, and the second one with margin at the bottom is using paragraph / <p> tag.

There’s nothing wrong with WordPress, this is actually a feature in WordPress called auto-p (auto paragraph)

I’ll explain that it’s easy to enable line break on “Enter” in WordPress editor. Read More WordPress Editor (TinyMCE) how to create line break <br> and not paragraph <p>.

How to Host WordPress in Digital Ocean VPS (Step by Step Tutorial)

A simple walk-through in how we can host our WordPress site(s) in Digital Ocean (un-manage VPS) Cloud Server. Using Ubuntu and LAMP.

Introduction

digital-ocean

There’s a lot of WordPress hosting out there, and the price is affordable. But recently several developer friend at Theme Hybrid community shared that they move to Digital Ocean because of several reasons:

  • Better server (response time, ssd storage, bandwidth) than shared hosting
  • Dedicated IP for each droplet
  • Simple interface/easy to use (for a unmanaged vps)
  • Simple backup and we can create snapshot of our server
  • Easier to scale when we need
  • Amazing price, start at $5/month
  • Charged per hour usage, so we can easily create a test site (for clients) and destroy it when we no longer need it.
Read More How to Host WordPress in Digital Ocean VPS (Step by Step Tutorial)

Stop and Start Windows DNS Cache, when “ipconfig /flushdns” not working

When changing domain name server, I often get 404 not found page or still viewing the site content from previous server. Sometimes it will resolve after few hour, but sometimes need several days. All tutorial I found just mention to flushdns using windows command prompt. But It’s not Working.

This is how I solve the issue.

Follow this step to fix DNS cache problem in Windows Read More Stop and Start Windows DNS Cache, when “ipconfig /flushdns” not working

How to add “Next Page”/ “Page Break” button in WordPress Editor

In WordPress we can separate post/pages using <!--nextpage-->. It’s hard to remember the tag, and you need to add it using “Text” editor, not visual editor. This is  how you can add “Next Page” or “Page Break” button in Visual Editor, Just like this:

wordpress-next-page-visual-editor

It’s very simple, you can add this code in your theme/child theme functions.php or add it in a functionality plugin. Read More How to add “Next Page”/ “Page Break” button in WordPress Editor

Better Responsive Design with `wp_is_mobile`, Why Responsive Design is Not Enough

What is wp_is_mobile ?

wp_is_mobile is a WordPress function to detect user/visitor browser using user agent string. Some might think that this method is like prehistoric era. An era before we have responsive design. Web developer use user agent string to serve different website content to mobile user or redirect to mobile site, something like m.website.com.

So why WordPress, a CMS of the future have this function? Why WordPress still need this and use this function all across admin pages?

What Responsive Design Cannot Do

Responsive design is awesome, we can style based on browser width so the design can be useful and better for user using any device.

But there’s one problem…

Read More Better Responsive Design with `wp_is_mobile`, Why Responsive Design is Not Enough

Having fun while designing WordPress theme with dual monitor and live.js

EEEPC 1025CE Dual Monitor
EEEPC 1025CE Dual Monitor

I never thought that dual monitor will be very productive and fun. I don’t even open several windows in my monitor because it’s too distracting. I always open each window in full screen.  But not anymore with live.js and dual monitor.  It’s really fun ! Read More Having fun while designing WordPress theme with dual monitor and live.js