Category: Web

  • Lets Encrypt commands for CentOS

    Lets Encrypt commands for CentOS

    This is just a quick cheatsheet to install and renew letsencrypt certificates. Let’s say, your domain name is and your email address is [email protected] and hosted on a CentOS server running Apache.

  • Grid background with CSS

    Grid background with CSS

    Need to create a grid-like background? I recently needed one for an image drop-zone. It’s pretty simple to generate a grid background using the linear-gradient feature of CSS. The CSS lines to notice here is this: Here we’ve added two gradient backgrounds. Each linea-gradient creates a .4rem white line. And when we set the background-size […]

  • Traffic Simulation with HTML/CSS

    Traffic Simulation with HTML/CSS

    Here is how to create a traffic simulation using HTML/CSS …and a pinch of JavaScript. I used CSS3 animations, vehicle images from freepik and jQuery. First, let’s create the road where the vehicles will run. We’ll add three lanes where one will be reserved for priority vehicles and public transports. On each lane, we’ll add […]

  • How to add a virtual page in WordPress?

    How to add a virtual page in WordPress?

    There are many use cases for a virtual page. Let’s say showing the invoice or payment status page for a payment plugin in the front-end, without compromising active theme. I needed one recently to show payment statuses. Here is how I implemented it. 1. Hook “init” to catch the specific slug First we need to […]

  • Translate WPML via WordPress REST API

    Translate WPML via WordPress REST API

    Although REST API is now included into the WordPress core, WPML – one of the most popular translation plugin – still didn’t catch up to that. Anyways, after extensive googling I decided it’s better to implement the feature myself. Here is how the translation worked. Step 1: Add a custom end-point I added an end-point /translate to do […]

  • Upload media via WordPress REST API

    Upload media via WordPress REST API

    WordPress REST API is quite interesting especially when you are trying to update the website from some third-party resources. Recently I had to implement a similar feature where most of the things like custom post type, taxonomy etc. worked as they should except images. So, here I’m going to show how I made the media […]

  • CSS Dropdown Menu

    CSS Dropdown Menu

    Let’s create a dropdown menu with CSS and HTML only. There are lots of fancy menus out there. This is just an experimental HTML-CSS based multi-level menu with room for improvements. Someone starting to learn CSS might find this helpful. To quickly explain how it’s done, menu is contained within ul and each menu item is […]

  • Showing countdown timer in email

    Showing countdown timer in email

    Last day I received an email newsletter which contained a countdown timer in it. It was quite interesting because most of the times emails are static and we are unable to show any dynamic data. Then again, there is the GIF image format which can show animated images. From investigating the source I figured that they […]

  • Email Obfuscation – WordPress Shortcode

    Recently I was working on a WordPress website and was into a situation where I wanted to protect the email address from spam bots but also didn’t want the legitimate users to go through the trouble of filling out captcha and click an extra link. WordPress do have a nice function called antispambot which does it […]