Your shortcode function will register widget, will not display on a page as a shortcode.
To show widget on a page/post you need to use the_widget( 'test_widget', $instance, $args ); function.
Codex documentation is here
For example, in your code
// Display the widget
function test_show_widget() {
the_widget( 'test_widget' );
}
add_shortcode('test_widget', 'test_show_widget');
Related Posts:
- How can I make add_image_size() crop from the top?
- Delete WordPress plugin Repository
- What is right way to go about adding functionality to a published WordPress plugin?
- Better to fire specific hooks or generic hooks with parameters?
- How to remove WPML Generator Meta Tag by theme’s functions.php (override plugin function)? [closed]
- Load plugin selectively for pages or posts, etc
- How do I sanitize a javascript text?
- Plugin for automatic database backup? [closed]
- How can a Firebase user registration and login be integrated into a WordPress site?
- Plugin for changing a post’s category based on it’s post date?
- check for the current screen
- I’m trying to create security question field for my login page
- How to show custom static content at top of each category page?
- How to show category images (from plugin) on a regular page (page-example.php)?
- use function inside another function in WP Plugin
- Override the filter from plugin in child theme
- Sage WordPress – Plugin Namespace: Not Found
- Dont’ charge customer until product ships – woocommerce [closed]
- register_activation_hook with include file [closed]
- Add htmlentities and/or shortcode into data-attributes
- Absolute Image URL in srcset is appended to the upload dir
- How can I capture Memberpress user info after signup [closed]
- how to open page, defined in plugin, from dashboad widget
- WordPress independent plugin upgrade notification system [duplicate]
- Change upload folder for a CPT
- Is there an npm library that uses best practices to scaffold a wordpress plugin that is build with React?
- Using meta_query to get date type values from post_meta table WordPress
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Using plugin functions/methods within templates
- How to retain table data in wordpress phpunit tests
- Load plugins’.mo and .po files from a directory
- (Big issue) Blog is Getting Down Each day.. what should i do.?
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- Import sql data from a large file when installing plugin
- Jquery NoConflict Problem
- WooCommerce : Direct Checkout Page [closed]
- Is there a rule for wordpress plugins developers to not do any database changes upon update?
- Can i add custom code in Source, Header from function.php?
- Can my hooked uninstall class function access a global var declared in main plugin file?
- Flag Comment as inappropriate button plugin
- How can I add IP address to my post?
- serverSideRender does not render “preview” html inside Gutenberg block
- add seperate suffix for low price and high price in woocommerce
- Get products list by url key in WordPress Woocommerce [closed]
- How to add/change (woocommerce) product tab icon
- WordPress plugin database. How to create table for checkbox
- Equivalent of admin.php for public pages
- Detect plugin/theme installation (via upload)
- Hook functions for Wp e-commerce? [closed]
- Engadget Like Featured Breaking Plugin
- sliding/fading header plugin or approach suggestion
- Google Analytics event tracking code being stripped out of links in Author box – WordPress site
- Elementor Sidebar not loading when PRO elements plugin is active
- how can we migrate wordpress 5.9 website from aws ec2 to new installed wp 5.9 oci compute
- Import Recent Posts Only and Ignore old ones if exist
- Security of a WordPress Plugin
- @wordpress/scripts advanced usage
- wp_post not working, keeps redirecting to posts page
- How to display ACF coustom field from category on author.php
- How to add Mobile field in Registration form using Theme my login Plugin
- What is the right way to populate a dropdown from MySql?
- prevent anonymous access to WordPress site (non-admin site)
- make p tag collapsed after 3 rows
- WPBakery Page Builder Shortcode Showing On Front Page For Post
- Student access credentials
- How to direct wordpress traffic to specific page
- Scroll to ID broken in main menu
- Comment restrictions Wodpress
- Generate and send ICS file through WordPress
- Gutenberg editor in WordPress 5.0.3 /wp-json/wp/v2/pages/4713/autosaves?_locale=user 500 (Internal Server Error)
- Multi Language Code Snippet in WordPress
- WP Plugin permissions – create new files
- How to capture customer’s credit card details via PayPal on my checkout page?
- Add code to page template on page built with Visual Composer
- How to store multiple instances of the plugin’s options for various shortcodes
- .htaccess file doesn’t work, with hundred tries
- Installed plugins page do not show in wordpress dashboard
- plugin translation is not working
- A more elegant way to handle notices/warnings
- To set a post is new/old in vertical scrolling
- How can i see/log all requests coming from a registration form (not from the UI)?
- First argument is expected to be a valid callback for cp_admin_init and _canonical_charset
- Get the url of attachments from the post?
- WordPress User Frontend Editing Custom Fields
- How can I modify the colors of my theme for a single section of my site? [closed]
- What are the downsides of using bootstrap in plugin development?
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- Function mb_strlen Fail [closed]
- Images get uploaded itself from the computer
- getPost() method and Pagination
- How to Allow Users to Select Recipients In a WordPress Comment section?
- WooCommerce REST API aborts connection [closed]
- How to write a plugin that “listens” every time, an edit occurs?
- Product customizing quiz – quiz adding products to the cart
- show_admin_bar filter not called inside plugin class
- WordPress 6.3 headers already sent error
- Create a custom taxonomy’s term form
- How to prevent WP All Export from wrapping XML nodes in CDATA? [closed]
- How to Display News in a Timeline with Headline, Category, and Time?
- How can I access uploaded file submitted via Forminator? [closed]