you can register a new widget with your custom loop like this
<?php
add_action( 'widgets_init', 'Miy_widget_box' );?>
<?php function Miy_widget_box() {
register_widget( 'Miy_Widget' );
}?>
<?php class Miy_Widget extends WP_Widget {
public function __construct() {
// widget actual processes
parent::WP_Widget(false,'Title Widget','description=Description Widget');
}
public function form( $instance ) {
// outputs the options form on admin
echo 'include html coding in here';
}
public function update( $new_instance, $old_instance ) {
// processes widget options to be saved
}
public function widget( $args, $instance ) {
}
}?>
Related Posts:
- Check if add_menu_page exists or not
- Woocommerce hook after creating order? [closed]
- Removing the “Your backup folder MIGHT be visible to the public” Message Generated by the WP-DBManager Plugin
- Gutenberg: Error loading block: Invalid parameter(s): attributes but it can be used in the code
- Reordering themes in admin panel
- Best way to diagnose which plug-ins/theme uses the most memory?
- How can I attach images to a post from the media library?
- Override Widget class in plugins with custom plugin
- How to prevent a function execution with another function?
- Visual Composer vs. Advanced Custom Fields [closed]
- Activating a single plugin via php
- Themes VS Plugins [duplicate]
- How to load plugin before the wordpress jquery?
- Does Quantity of files in a plugin affect performance?
- Why is my ajax call refreshing the page?
- Add CSS class to add-to-cart button, Woocommerce [closed]
- How to count number of records found in a database table?
- Advanced Custom Fields query
- plugin to search entire posts, blogs, forum, users [closed]
- What is the way to ship read-me strings like plugin-strings for internationalization?
- What function can I use consistently to escape possible HTML for editing and display?
- How can I make uploaded images in the editor load with HTTPS?
- Ultimate Member: Redirecting after registration
- Best method to upgrade multisite plugin’s numerous database table
- Activated plugin is stored as an object, rather than as a path
- how to create site exit messages with destination url displayed
- Magazine subscription sales through WP?
- Overriding functions in wordpress plugins
- Color java code the way it is colored in eclipse [closed]
- What is generating my meta og:description?
- Certain actions failing when run through cron
- Changing “elapsed time” to “time remaining” on MP3-jPlayer audio player with CSS or PHP changes
- Send Custom welcome email to specific user group
- Ctrl+V images from clipboard into wordpress editor
- Add content to footer – above wp_footer
- Adding (image) caching to my Tumblr widget
- Cart66 localization hardcode strings [closed]
- Why is one phpunit test throwing an error on one class when all other classes are similar without error?
- XML parser plugin
- Is it safe to use admin-ajax.php in the frontend?
- How to get all posts belongs to a user between a certain date
- wp-load.php redeclares classes
- plugins not working in custom theme
- Add item to the woocommerce dashboard menu from a plugin
- Sucuri SiteCheck failing on domain with iThemes Security Pro plugin
- foreach loop displaying below content summary
- WP e-Commerce Gold Cart with Plugin Built Into Theme
- Regenerate Thumbnails Plugin successfully updated my thumbnails but image src won’t change to new image size?
- Make get_permalink() work outside the Loop using filters
- update_option creates an option, which empties on a blog reload
- Can you echo PHP code from a variable?
- Does WordPress do any internal caching if no plugin installed?
- WordPress Plugin- How to Insert Html&JS code in specific Page and specific Div
- woocommerce – adding wrapper around custom made woocommerce form fields
- Memcaching recurring SQL Queries
- add products to WordPress site automatically
- How can i solve php upgrade problem
- How to Upload images to a custom folder in upload folder using media uploader
- Making a list that can be filtered by category/tags
- Bash script to check available updates
- Submitting form to PHP
- deactivate WPBakery Page Builder license [closed]
- Hide button after form submit and save state to localstorage
- How use get_plugin_updates() function?
- how override a define
- Updates Hidden on Dashboard
- Modifying server’s response to API endpoint
- How post add available User Reviews?
- PageNavi redirects to 404 when used as archive page
- Cron job emails blank
- Get content and send to 3rd party
- How to make wp multisite subdomain exist search
- Molpay recurring payment in WordPress
- Rewrite in plugin
- How To Edit User Profile In Front End?
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Theme Load Error
- Lazy Load sometimes don’t work
- How to copy data from user profile page (profile.php) to theme customizer
- Custom shortcode with dynamic rewrite
- Problem with wp_editor
- WordPress plugin ajax post parameter
- Add plugin by SVN. Current version problem
- Converting a themes featured image to WordPress featured image
- Can’t upgrade themes or plugins after upgrading WordPress to 4.4
- WooCommerce & WooCommerce Shopee Intergration
- How to wrap image logo in Homepage with H1 tag
- Elfsight Google Maps Plugin Version 2.1.0 : Location image input not found [closed]
- Eliminate Render blocking CSS?
- WordPress Smart Iframe Browser [closed]
- Publish post facebook page & twitter automatically [closed]
- How to know if your code is executed on wordpress.com and wordpress.org?
- I want to include My theme file (testing.php) to inside my plugin folder (myplugin/mypugin.php)
- How do I set register_meta for a specific CPT?
- WordPress issue – data is not showing in wp-admin, but when searching through database, all the data is there
- WordPress menu dissapear when I add a parameter to custom post archive
- Private WordPress Content
- Customize WP Filter Hook
- Changing slug when post is copied
- Show the author only own types of publications. (JetEngine, Elementor)