Sometimes you may face a problem when you have to decode a string with Javascript which was originally url encoded with PHP. This can be an API response or cookie set by PHP setcookie function. A simple way to do this is through decodeURIComponent function in Javascript. But it leaves the "+" signs in the string….
How to change Post Type in WordPress
Use these simple methods to easily change post type of single or multiple posts while working with multiple post types in WordPress.
How to view and modify WordPress rewrite rules
Sometimes a page load issue in your WordPress website has more to do with some random error rather than a bug in your code. In this case, it was rewrite rules cache.
How to replace Paragraph Break with Line Break in LibreOffice Writer
Replace Paragraph Break with Line Break in LibreOffice Writer with these simple steps.
Whitelist all sub-sites for wp_safe_redirect in WordPress Multisite
This article shows how to add all the domains/sub-domains of a WordPress multisite network to allow safe redirects through wp_safe_redirect function.
Make Javascript sequential with “async” and “await”
Javascript code can be easily made sequential with the help of two simple, yet very powerful keywords “async” and “await”.
Javascript: Loop over querySelectorAll without error
In Javascript, there are a lot of instances when you want to find multiple elements on a page to apply a common operation to all of them. Suppose you want to hide elements of a particular class present on your web page. To do this, first get an array of all such elements using querySelectorAll…
Where to add custom code in WordPress
Writing custom code for WordPress may be easy, but you should carefully add your code at the correct place to keep it clean and easily maintainable.
How to create a WordPress plugin
Easily create a simple WordPress plugin without any complex setup or need of FTP/SSH to your hosting server.
How to use PHP built-in web server
You can use the PHP built-in webserver to test your PHP code, without the need to set up complex WAMP or LAMP software on your desktop.
Enable Gzip compression in WordPress with htaccess
Gzip compression speeds up your Wordpress website by compressing the resources at the server level using simple .htaccess configuration in Apache server.
Correct file permissions for WordPress on Apache
Let us set up correct file permissions (chmod) for your Wordpress website to ensure the flawless functioning of your website and security from attacks.
Customize your link preview on Facebook
Facebook & Twitter support Open Graph Protocol to transforms your blog post into a rich social object, allowing you to decide the appearance of your post's link preview on their respective platforms.
JSON-LD: Add Structured Data to improve SEO
Add structured data JSON-LD to your blog or website for better search engine optimization (SEO). It helps Google to understand your content better and helps your website to get a better search ranking.
Social Sharing Buttons without Javascript
Add social sharing buttons to your website without any Javascript with these simple code snippets.
Add url rewriting router to PHP built-in server
PHP built-in server provides an excellent option to rewrite URLs through router.php. It is very convenient when testing a small PHP application on your machine without the worries of setting up a full server stack.
Enable browser caching in WordPress using htaccess
Browser caching for all types of files can be easily done using Apache's .htaccess file. This simple configuration results in a faster website, less consumption of bandwidth and better user experience.
Should you quit your job for CAT Preparation?
Why people quit their jobs to prepare for CAT? Most of the time it is a bad manager, less salary or disillusionment with the current job. It makes sense to leave something for something much better. But you have to decide the right time to do it.
How to count words in Unicode string using PHP
How to count words in Unicode string using PHP? This sounds too easy. After all, PHP has so many string manipulation functions. To count words, we can simply use str_word_count and we are good to go. But there is a problem. While this function works fine for English strings, developers find this function unpredictable as sometimes…
I missed you too
It was the best she ever looked. She was determined to fix everything today. Her flowing hair shining like gold fluttered through the breeze. Once again she looked at her cellphone mirror. “Perfect. He would love to see me.” She said to herself. It was a bright day, full of sunshine. As she walked by…