How long have you been craving for a text size setting on the default Text widget, or a background color on the Calendar widget? Did you know you could implement these yourself? And without modifying the core files? And without jeopardizing the update-ability of your website? Yup! It can be done! Of course, some things are more easily done, and some things may be impossible to do at all. Let’s see however what is the general approach of actually doing it. Let’s start by creating a plugin that our code will live into. I will attempt to add a font size setting which will change the widget’s title size, so let’s name the plugin “Widgets Font Size”. Inside wp-admin/plugins/ create a new folder called widgets-font-size and in there create a new PHP file, widgets-font-size.php with the following contents: <?php /* Plugin Name: Widgets Font Size Plugin URI: https://www.cssigniter.com/extending-wordpress-core-or-other-3rd-party-widgets/ Description: Example on adding a custom setting on third-party widgets. Version: 1.0 Author: Anastis Sourgoutsidis Author URI: https://www.cssigniter.com/ License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html
Share This