Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How use bp widgets in a non-widget theme or other cases


Burt Adsit
Participant

@burtadsit

Well, a good place to start would be the widget code itself.

Let’s take the ‘archives’ widget as an example. I look at the widget code in: /wp-includes/widgets.php for the archive widget function: function wp_widget_archives($args), I see that it extracts the stored widget options and then eventually calls the template function: wp_get_archives(‘param=xxx&param=yyy’). The widget is just a wrapper for the template function that allows blog admins to set the behavior of the template function that does all the work.

We need to pull the guts out of the members widget and create a template tag that does the work by parameters only. Looking at the archive widget again I see some code that sets up defaults, parses the passed args and then turns the args array into vars with extract().

We could also just modify the widget to parse and actually pay attention to passed args.

In any case did I mention that ‘We don’t need no stinking help’. (that was my best Mexican bandito accent). I forgot you are Italian. That was a reference to a Western movie. Never mind. I gotta go play with something else right now but I’ll return to this.

Skip to toolbar