When you’re shipping your theme for sell, it’s often required to bundle the required plugins. Some people just keep these plugins like general vendor libraries inside their theme and load them using php’s
require_once. However, if you’re following this style, your themes will fail to pass the theme check because these plugin files will be considered as a part of your theme, and it will prompt you that CPT functions and shortcodes should be a part of the plugin. Moreover, if someone deactivate your theme, those shortcodes and CPTs will be unavailable immediately.
This is why, along with many other developers, we use TGM Plugin Activation library. This tiny little lib can force or suggest installing the plugins which are required (or good to have) for making your WordPress theme work flawlessly.
TGM can work with plugins which are hosted in WordPress plugin repository, or in a github public repository. It can also work with plugins which are shipped with the theme as a separate zip file. In this article we’ll see all these three cases of plugin installation and activation process using TGM library.
Download the TGM library from http://tgmpluginactivation.com/download/. After unzipping, keep the class-tgm-plugin-activation.php file inside
vendors/tgm/ inside your theme. Then add the following code in your
functions.php Continue reading “Packaging thirdparty plugins with your WordPress theme using TGM Plugin Activation library”
It’s a common problem for the theme developers who sell their themes in the marketplaces and ships a data file with it, that contains exported data from the demo WordPress site. The problem is, this content file contains links to the images used in the demo. And those images, which the author uses to decorate … Continue reading Generate Dummy Placeholder Images in the WordPress Export File Instantly
** I’ve added an update. Click here to read it ** JetBrains has sent me an email today, mentioning about the upcoming change in their licensing model. Right now all users can renew their license at $49 which is a 50% discount rate of the original rate. From this November 2nd, you will be able … Continue reading [update] PHPStorm's upcoming subscription based licensing model and why you're fucked up
A recent update of Chrome browser broke the WordPress admin panel. It happened because of a setting related to slimming paint. Of course you can fix it by going to chrome options and then by disabling it. However, your client may not be able to do it because it’s a pretty confusing setting. To stay … Continue reading Chrome broke WordPress Admin Panel – here's how to fix that
If you’re dealing with lots of custom posts in WordPress and if you’re a theme developer, it is probably a well known issue to you. Lots of people are discussing about this pagination thing in different forums. However, it’s really not that tough to paginate custom posts. Let’s find out how we can do it … Continue reading Custom post pagination in WordPress