I would like to keep my custom widget in their own folder, separate from my functions.php file and available to all my themes, similar to the way plugins has its own folder under “wp-content/plugins”. Since it appears that wordpress only supports reading sidebar widgets from the functions.php file (I could be wrong here) does anyone see a problem with just using an includes in my functions.php file like so:
include (content_url() . '/widgets/widget-seo/widget-name.php'); include (content_url() . '/widgets/widget-rss/widget-name1.php'); include (content_url() . '/widgets/widget-rss/widget-name2.php');
to pull individual widgets while still keeping the separate widget file in a newly created folder under “wp-content” like so(“wp-content/widgets/widget-type/widget-name.php”).
Any help or better suggestions(I am fairly new to wordpress) would be greatly appreciated.
- The topic ‘keeping custom sidebar widget code separate’ is closed to new replies.