This code snippet allows you to create an administrator then delete it after you’re done with your work on the website. It’s very useful when the client gives you only FTP or CPanel and you have many websites to work on.
How to Force Avada to Use WooCommerce Thumbnail Function
The problem with a lot of “multipurpose” themes is that when they override the default behaviors of WordPress or one of its plugins, they forget to re-introduce the filters that were there before they did their thing.
How to Optimize Your WooCommerce Store for Single Product/Item Checkout
The buying process on a WooCommerce store for most goes like this: The user spots a product He adds it to the cart He goes to the checkout page He pays for it What if we could get rid of the cart altogether and provide a more friendly user experience instead of this Walmart-ish approach?… Continue reading How to Optimize Your WooCommerce Store for Single Product/Item Checkout
How to generate WooCommerce products with the WP CLI
The WP CLI never ceases to impress me. You can do lots of things with just a few lines of code. In this code snippet, I let the WP CLI create 15 products with random images from Lorem Picsum, prices are also random within the 1-1000 range.
How to easily import multiple vCards into Google Contacts
Google Contacts (the old version) allows you to import VCards, but you will have to import them one by one, this is clearly not very practical if you have more than 3 contacts that you want to import (you lazy!). Fear nothing, there is an easy workaround, you’ll merge your vCards before importing them, here’s how you… Continue reading How to easily import multiple vCards into Google Contacts
Arabic translation files for WordPress
Wondering why some of the string in the theme or plugin you just translated aren’t found in the .po file or have weird plural form? This happens a lot because many translators don’t use the right configurations. So besides the search path in Poedit, make sure you have the right configuration for plural forms and… Continue reading Arabic translation files for WordPress
WordPress: Disqus Language
Update Code on this post has been made into a plugin, the plugin is more complete and handles a wider range of locales. Are you having problems to get the Disqus Comment System WordPress plugin to work with your site language (Arabic, French…). Here is the code you are looking for:
Refactoring code with the command line (files, folders and possibly variables)
These are a few commands I use in situations where I can’t use Eclipse for refactoring my code, you can use them by replacing from and to with the names you want. No need to remind you to take backups to prevent irreversible loss of data.
Git: How to revert changes in a single file or in all files
If you have modified or deleted a file by mistake on a git tracked project, you can still revert your action and reset the file like this: