Have a look at the the_widget()
function. The first argument is required. It is the PHP class name of the widget. For example:
<div class="sidebar">
<?php the_widget('WP_Widget_Search') ?>
</div>
You can also pass on extra arguments:
<div class="sidebar">
<?php the_widget('WP_Widget_Text', 'title=Hello&text=World') ?>
</div>
Related Posts:
- How can I use the built in WordPress “browse link” functionality?
- Code for Recent Posts Widget
- Prevent widgets removal
- Is there a way to add more tags to the tag cloud?
- Modify recent post sidebar to show post thumbs with out plugins
- Why Can’t wp_editor Be Used in a Custom Widget?
- How to listen to color changes on the color picker?
- Add New Footer Widget Area with Limited Options?
- Add div class to only one widget
- Updating to Version 4.5 bumped my “main sidebar” widget out of place
- How can I delete all inactive widgets?
- Call sidebar from a template
- Adding classes to dynamic sidebar
- Count widgets in position and set class
- iris color picker in widget – click event doesn’t fire when initially when widget is first created
- How do I add Widgets to my theme and activate them on my site?
- How to insert widget areas specific to certain pages (or posts, etc.)?
- Find if widget block is active
- Add Descriptive text to Widget text box so users can see what they contain
- Multiple users editting widgets
- How to rename wordpress Widget
- Trying to wrap around first word of multiple word strings with a widget_title() filter, only works on two word strings and not more than two
- Read file contents the WP way
- Recent Posts widget without Title
- Create a widget that allows text input
- Pre-install widgets in WP-Admin
- Subscribe2 widget with choosing categories?
- Showing a Thickbox (tb_show) does nothing
- jQuery UI inside widget on admin page
- Check if the current shortcode is being used in a widget
- How to activate or install the Gallery Widget?
- Custom User Field in Dashboard Widget
- Getting a div wrapped around two widgets
- How to Add TinyMCE to widget
- How can I get the first section of a page 100% width, while the rest will have a sidebar? [closed]
- Widgets not adding div on before and after title
- Modify ‘Sizes’ Attribute for Images with Specific Class
- Issue understanding and using WordPress filters and actions
- How can I inject html after the [x]th widget inside a Sidebar? [duplicate]
- RSS dashboard widget not showing visuals
- Simple widget causing whitescreen
- How to stop comments widget conflicting with theme comments
- How do I create a widget to embed the code for a sign up form, so that the sign up form appears on every page?
- Grabbing how Many Posts by Month for a Dashboard Widget
- How to change the default class for the widget title?
- How to add the same widget twice?
- How to hide widget if current category has no posts assigned to it?
- ‘is_author()’ logic in widget for author only
- wp_dropdown_pages in widget form
- Unable to load “wpColorPicker” on theme customize page
- Undefined Variable in my widget
- Update widget form after drag-and-drop “only specific plugin”
- Different sidebars not changing
- How do I create a template page with a specific widget as the content?
- Placing a widget with $wpdb query
- Loading the native WordPress image uploader in custom widget
- How Migrate a Legacy Widget to block?
- How to allow editing of text in sidebar?
- Shortcode into widget
- Creating a dynamic class name in my custom widget
- Want to add more option in “Sexy Login”
- WordPress Local to Live and The Missing Widgets!
- Extending the WordPress Recent Posts Widget
- delete widget upon uninstall
- How to paste widget to a specific page
- How do I find out which
- Unable to see Widget Submenu under Appearance with Class Based WP_Widget
- An archive widget, coming from nowhere on my posts and pages
- custom widget not saved to sidebar
- When editing in block editor, the post/article gets under the floating widgets
- Recently changed domain name. Home page widgets are now not in the customize menu yet still being on the page
- Make widget with media upload repeatable
- I accidentally added a widget area called sidebar 1
- wp_registered_widgets doesn’t contains my widgets
- How can I write this code snippet so that it echo’s the response when submitting empty fields?
- How Can I Replicate & Register a Widget from the Child Theme
- How to retrieve category ID’s from widget settings?
- My plugin works in home page, but doesn’t work in post page
- Widget text color change
- Can I use wp_widget_rss_output to show my site’s feed in the dashboard?
- How can I add widgets to the category page?
- How to create another widgets.php page
- Remove default WordPress widgets
- widget that will do shortcodes that user inputs
- Widget dynamically add new input field
- How to show widget in frontend?
- Widget Development – Displaying dropdown content
- WordPress function breaks widget’s markup?
- Registering multiple copies of a widget
- page url in shortcode
- iframe/embed vid in text widget loads outside container and moves around when scrolling the page?
- menu in different page in different style
- Add text to Text Widget using Javascript
- Widget logic not working
- Subpages menu on sidebar plus widgets
- Widgets in PHP files?
- Text Widget Not Working
- Sample widget code which get data(1-5 record) from Wp_Admin panel and display to Homepage(WordPress Custom Theme)
- Theme Widget Area Defaults
- How to add the “page” post type to Recent Activity widget displayed in admin?