Abhineet.in

unlearning the learnt

Menu
  • Home
  • About
  • CAT Preparation
Menu

Author: Abhineet Mittal

Abhineet is IIM Alumnus and Founder of popular Digital Publishing Platform, Sahityapedia. He is a technology enthusiast by hobby & an avid reader.

Reolved failed upload in WordPress post edit filter

Posted on April 13, 2022April 5, 2023 by Abhineet Mittal

When adding an upload form to the post edit screen in WordPress admin, I found the upload to fail. The $_FILES array was empty.The reason was that by default, WordPress post edit form does not send files data. To fix that, we need to add enctype attribute to the form.Here is the code to do…

Read more

How to customize PHP error message in WordPress

Posted on April 11, 2022April 5, 2023 by Abhineet Mittal

WordPress displays a default error message when it encounters a PHP error- There has been a critical error on this website. Learn more about troubleshooting WordPress. Now this message is subtle, but still reveals 2 things- Your website has some error Your website is built on WordPress Now second point is usually fine unless you…

Read more

How to change custom post permalink in WordPress

Posted on March 22, 2022April 5, 2023 by Abhineet Mittal

I have struggled with this issue for years. I tried different ways but they always felt like hacks and gave inconsistent results most of the time. I also tried a popular plugin which broke my site. Whenever you add a custom post type in WordPress through code, there is no way to select a permalink…

Read more

WordPress: Missing canonical tags on archive pages

Posted on March 21, 2022April 5, 2023 by Abhineet Mittal

WordPress keeps surprising me even after more than a decade since I started using it. Today I came to know that WordPress only generates canonical tags for singular pages (posts & pages). WordPress does not add canonical tags to archive pages including author page, post type archives, taxonomy archives etc. So, how to add canonical…

Read more

404 pages getting redirected to home

Posted on March 19, 2022April 5, 2023 by Abhineet Mittal

Today, I wasted major part of my day trying to figure out why my subfolder based WordPress multisite install is redirecting all 404 errors to the site’s home page. The problem turned out to be the constant “NOBLOGREDIRECT” which I defined in wp-config.php file. This constant ensures that in a multisite install, if anyone tries…

Read more

Resolved: TWA App not working fullscreen when downloaded from Play Store

Posted on November 11, 2021April 5, 2023 by Abhineet Mittal

To hide the address bar in a TWA app, you must have setup and asset links file on our server with valid SHA certificate fingerprint. Sometimes the app works fine when we test it by directly installing through apk, but address bar is shown when we download the app from play store. The reason for…

Read more

How to track if a web page is opened in TWA app

Posted on November 11, 2021April 5, 2023 by Abhineet Mittal

The Trusted Web Activity (TWA) in Chrome has made it so easy to package and publish any website as an app. But the problem arises when we want to track when your website was opened inside the TWA app. Usually we can easily do this in a webview app by appending a custom string to…

Read more

How to persist state through query string in url

Posted on November 10, 2021April 5, 2023 by Abhineet Mittal

In some cases when you do not have the option of cookies to manage state, query string can be a good option. In this article, I am going to use some Javascript to persist state through a query string in the url. The Javascript code is added to head section of html when the desired…

Read more

Experience vs Manager

Posted on October 22, 2021April 5, 2023 by Abhineet Mittal

Being a manager is a huge responsibility. Even if only one employee is reporting to you, you have the responsibility to mentor them, guide them, support them and be vigilant if they are facing any work-related issue. I have seen many brilliant employees whose talents simply got wasted just because they had an incompetent manager….

Read more

Rewrote Sahityapedia Android App in Flutter

Posted on October 9, 2021April 5, 2023 by Abhineet Mittal

Though I love coding, I am not a professional app developer. As an entrepreneur, I write code as means to an end. It saves cost which is essential for our bootstrapped startup. After delaying for quite some time, I finally rewrote the entire Sahityapedia app in Flutter (the latest app framework by Google). I wrote…

Read more

Modify page title tag in WordPress

Posted on October 4, 2021April 5, 2023 by Abhineet Mittal

To change page title tag in WordPress, use the pre_get_document_title filter. Most of the answers on web have mentioned the filter wp_title, but do not use it as wp_title function will be deprecated in future and wp_title hook will not work. At present, wp_title filter does not work when modifying the title tag.

Read more

Prevent Form Resubmission on Page Refresh

Posted on June 28, 2021April 5, 2023 by Abhineet Mittal

We face a common issue on many websites that whenever a form submits to the same page, and then we refresh the page, the form data is submitted again. Sometimes the browser asks for confirmation, sometimes it does not. It becomes really frustrating if it causes an operation to happen twice. To prevent this on…

Read more

Prevent Memory Leak in WordPress

Posted on May 10, 2021April 5, 2023 by Abhineet Mittal

Recently I faced an issue of memory leak in one of my WordPress projects. I was running a function that was reading post meta and user metadata of thousands of objects. I thought reading data from MySQL is cheap in terms of processing power and memory, but it turned out it was causing my function…

Read more

Fix Indentation Issue in Visual Studio Code

Posted on May 7, 2021April 5, 2023 by Abhineet Mittal

Easily fix the tab size issue in Visual Studio Code by making this simple tweak in settings.

Read more

Correct Way to Manage Title Tags in WordPress

Posted on May 6, 2021April 5, 2023 by Abhineet Mittal

Correct way to add or modify title tags in WordPress using the latest theme support feature and the filter hook to dynamically modify it on the fly.

Read more

Resolved: Graphics Processor Not Detected in Photoshop

Posted on April 14, 2021April 5, 2023 by Abhineet Mittal

I installed a new version of Photoshop and, suddenly, it was chaos all around. Photoshop started getting crashed even if there was a small graphic-intensive operation and closed automatically without even giving me a chance to save my work. On restarting the application, it was throwing an error message that it disabled enhancements which use…

Read more

Why some recipients are not getting your emails?

Posted on March 24, 2021April 5, 2023 by Abhineet Mittal

If you are using email on your custom domain using some email service like Google Workplace or Zoho Mail, you have to do certain configurations to ensure that your emails reach the inboxes of their recipients. Missing emails can be disastrous for a business. The most important configurations are SPF and DKIM in your DNS,…

Read more

Decode a PHP encoded string url in Javascript

Posted on January 17, 2021April 5, 2023 by Abhineet Mittal

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….

Read more

How to change Post Type in WordPress

Posted on January 17, 2021April 5, 2023 by Abhineet Mittal

Use these simple methods to easily change post type of single or multiple posts while working with multiple post types in WordPress.

Read more

How to view and modify WordPress rewrite rules

Posted on June 1, 2020April 5, 2023 by Abhineet Mittal

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.

Read more
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next

Categories

  • Business
  • CAT Preparation
  • Coding
  • Fiction
  • Finance
  • How-To-Life
  • Javascript
  • Life
  • Life at Infosys
  • Photoshop
  • Productivity
  • Publishing
  • Social Awareness
  • Startup
  • Technology
  • Uncategorized
  • Utilities
  • Visual Studio Code
  • Web Development
  • WordPress
  • Work Culture

Recent Posts

  • The Ultimate Guide to CAT Preparation: Tips and Tricks
  • Self-Publishing vs. Traditional Publishing: Which Is Right for You?
  • 7 Effective Strategies to Overcome Procrastination and Achieve Your Goals
  • How to detect English/ASCII string in PHP
  • The state of automobile dealerships in India

Recent Comments

  • Rohan George on Intermediate, Stream & Location: Luck by Chance
  • Ashika on Intermediate, Stream & Location: Luck by Chance
  • Steve on My first job, Infosys
  • SAKTHI on Finally, its Mysore…
  • Akash dhyani Akash on Training Begins…
© 2023 Abhineet.in | Powered by Minimalist Blog WordPress Theme