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. Simulated on CodePen The CSS lines to notice here is this: background-image: linear-gradient($white .4rem, transparent .4rem), linear-gradient(90deg, $white .4rem, transparent .4rem); background-size: 10rem 10rem; Here we've [...]

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?

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

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 [...]

এই শহরে বসন্ত এসেছে

কংক্রিটের ফাঁকে ফাঁকে অযত্নে বেড়ে ওঠা বেয়াড়া সবুজ ধুলায় ধূসর, নতুন মুকুলে ভরে আছে আমের শাখারা - তবু ঘ্রাণ ছড়ায় না, বিদ্যুতের তার জুড়ে সারি বাঁধা কাকের দৃষ্টিতে আস্তাকুঁড়। শহরটা মৃত্যু যন্ত্রণায় একই রকম গোমরায় - ব্যস্ততার ভেঁপু, অসহিষ্ণু পথিকের আস্ফালন, বস্তির গলি থেকে ভেসে আসা খিস্তিতে। এই শহরে আজ বসন্ত এসেছে। ফুলের আড়তদার বেলির [...]

WPML URL override on archive page

Last week I ran into an issue with WPML URLs on post type archive page. When the permalink is set to %post_name%, we can access the archive page following //site_url/post_type_slug. And the posts can be filtered by taxonomy using //site_url/post_type_slug?taxonomy_name=taxonomy parameter in the URL. With WPML language switcher things become a bit tricky. The issue When I [...]