Its the exact same process for writing a widget for a single site. Exactly.
Thread Starter
b-rad
(@b-rad)
Hmmm, I wonder why I can’t get any examples to show up in my available widgets list. One tutorial said to use:
class My_Widget extends WP_Widget {
function My_Widget() {
// widget actual processes
}
function form($instance) {
// outputs the options form on admin
}
function update($new_instance, $old_instance) {
// processes widget options to be saved
}
function widget($args, $instance) {
// outputs the content of the widget
}
}
register_widget('My_Widget');
and save the php file in my wp-content/plugins folder which I did but it doesn’t show up anywhere (yes I know the plugin doesn’t do anything but I’m setting my sights low and trying to just get it to show up first).
and save the php file in my wp-content/plugins folder which I did but it doesn’t show up
does it show up in the plugins listing and did you activate it?
Did you include a plugin header in your file?
Stupid question – Did you activate the plugin on the site?
Thread Starter
b-rad
(@b-rad)
Not a stupid question. Yes and no actually. A few of the tuts I had found neglected to create the proper header which prevented it from showing up anywhere. Once I had a good header in there it showed up under plugins so then I could activate it and head over to the widgets list where it showed up. Thanks!