the_widget [ WordPress Function ]
the_widget ( $widget, $instance = array(), $args = array() )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Output an arbitrary widget as a template tag
Source
<?php
function the_widget($widget, $instance = array(), $args = array()) {
global $wp_widget_factory;
$widget_obj = $wp_widget_factory->widgets[$widget];
if ( !is_a($widget_obj, 'WP_Widget') )
return;
$before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] );
$default_args = array( 'before_widget' => $before_widget, 'after_widget' => "</div>", 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>' );
$args = wp_parse_args($args, $default_args);
$instance = wp_parse_args($instance);
do_action( 'the_widget', $widget, $instance, $args );
$widget_obj->_set(-1);
$widget_obj->widget($args, $instance);
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/the widget « WordPress Codex
This template tag the_widget() displays an arbitrary widget as a template tag. It can be used ... before_widget: (string) the text or HTML befor the widget. Default: ...
codex.wordpress.org - the_widget : the way to use a widget whereever you like - Wordpress ...
Since 2.8, Wordpress allows us to use widgets in our templates. This made creating websites easier as well as creating professional themes. Now we can use ...
shailan.com - WP First Aid | the_widget
Jan 8, 2010 ... In January 2010 I wrote a post about making a template tag for standard plugins using the built-in WordPress function the_widget(). This post ...
wpfirstaid.com - The Widget: Games, Tech, Whatever
Great time to build a new gaming PC, or greatest time to build a new gaming PC? The GeForce 670 is amazing, Ivy Bridge is living up to the hype, and hard drive ...
www.thewidgetshow.com
Gebruikersdiscussies [ wordpress.org ]
- HarleyB on "Edit pre-built widget from theme..?"
- michalien on "use the_widget to call up multiple instances of a widget"
- michalien on "Using the_widget to call up a specific WP_Widget_Text instance"
- -JFK- on "calling a widget from anywhere in a theme"
- -JFK- on "calling a widget from anywhere in a theme"
- Rev. Voodoo on "calling a widget from anywhere in a theme"
- -JFK- on "calling a widget from anywhere in a theme"
- yenerich on "calling a widget from anywhere in a theme"
- dvanliere@gmail.com on "How to use the_widget() to ignore a widget?"
- digitalnature on "Request: get_the_widget() function"