Codex tools: Log in / create account
Languages: English • 日本語 • (Add your language)
Contents |
This template tag the_widget() displays an arbitrary widget as a template tag. It can be used anywhere in templates.
<?php the_widget($widget, $instance, $args); ?>
Display a monthly archive list.
<?php the_widget('WP_Widget_Archives', $instance, $args); ?>
widget_archive
__('Archives')
Default usage:
<?php the_widget('WP_Widget_Archives'); ?>
Display drop-down list:
<?php the_widget('WP_Widget_Archives', 'dropdown=1'); ?>
Displays an Calendar.
<?php the_widget('WP_Widget_Calendar', $instance, $args); ?>
widget_calendar
Default usage:
<?php the_widget('WP_Widget_Calendar'); ?>
Displays a list of categories.
<?php the_widget('WP_Widget_Categories', $instance, $args); ?>
widget_categories
__( 'Categories' )
Default usage:
<?php the_widget('WP_Widget_Categories'); ?>
Display an dropdown list with number of posts.
<?php the_widget('WP_Widget_Categories', 'dropdown=1&count=1'); ?>
Displays an list of links (blogroll) in categories.
<?php the_widget('WP_Widget_Links', $instance, $args); ?>
alt attribute. The show_name parameter. Default: false
Default usage:
<?php the_widget('WP_Widget_Links'); ?>
Display lists in category IDs 2 or 3:
<?php the_widget('WP_Widget_Links', 'category=2,3'); ?>
Display site meta. (Log in/out, admin, feed and WordPress links )
<?php the_widget('WP_Widget_Meta', $instance, $args); ?>
widget_meta
__('Meta')
Default usage:
<?php the_widget('WP_Widget_Meta'); ?>
Display a list of Pages.
<?php the_widget('WP_Widget_Pages', $instance, $args); ?>
widget_pages
__( 'Pages' )
menu_order
Defaut udsage:
<?php the_widget('WP_Widget_Pages'); ?>
"<h3>Contents</h3> as the heading, sort by last modified date:
<?php the_widget('WP_Widget_Pages', 'title=Contents&sortby=post_modified', 'before_title=<h3>&after_title=</h3>'); ?>
Display to a list of recent comments.
<?php the_widget('WP_Widget_Recent_Comments', $instance, $args); ?>
widget_recent_comments
__('Recent Comments')
Default usage:
<?php the_widget('WP_Widget_Recent_Comments'); ?>
Display to a list of recent posts.
<?php the_widget('WP_Widget_Recent_Posts', $instance, $args); ?>
widget_recent_entries
__('Recent Posts')
Default usage:
<?php the_widget('WP_Widget_Recent_Posts'); ?>
Display a list of entries from any RSS or Atom feed.
<?php the_widget('WP_Widget_RSS', $instance, $args); ?>
Default usage:
<?php the_widget('WP_Widget_RSS'); ?>
<?php the_widget('WP_Widget_Search', $instance, $args); ?>
widget_search
Default usage:
<?php the_widget('WP_Widget_Search'); ?>
<?php the_widget( 'WP_Widget_Tag_Cloud', $instance, $args); ?>
__('Tags')
Default usage:
<?php the_widget( 'WP_Widget_Tag_Cloud'); ?>
<?php the_widget('WP_Widget_Text', $instance, $args); ?>
widget_text
Default usage:
<?php the_widget('WP_Widget_Text'); ?>
wp-includes/widgets.php -- the_widget function
wp-includes/default-widgets.php -- each widget