This may not be the answer you asked for, but could you try Running it in PHP Code Widget and check if it works? If it does, there is probable something wrong with your widget generation code. If it does not, try adding that to sidebar.php and not index.php and check the results again.
Related Posts:
- Create onClick Event to Re-load a Widget
- How to make my custom widget appear within WordPress widgets? Plugin development
- Adding widgets to my plugin page instead of WordPress dashboard
- Hook called before text widget save
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- dashboard widget form not submit mails
- Add widget area from visual editor
- Priority call methods – PHPMailer->addAddress(NULL)
- widget: input the px value from user and use it as inline style in widget function
- how to check elementor is widget is active or loaded
- How to include checkbox in widget backend form?
- Should I use spl_autoload_register() in my plugin?
- How can I save a multiple select array with the settings API for a plug-in options page?
- Include WP_Query in my own PHP file?
- Using register_activation_hook in classes
- Is there a way for a plugin to add an attribute to the tag of a theme?
- How to use update and delete query in wordpress
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- Show content if parent page has children
- WordPress widget in custom theme
- Resize Image without cropping
- My shortcode is showing up twice
- Database “Migration” for Plugins?
- Anything I can add to functions.php to make text widgets accept PHP?
- WordPress menu deletes when trying to add a hook
- How can I add a specific, custom widget to my theme’s header.php?
- Get widget settings function?
- Widgets not showing in my custom theme
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- Making Quote Plugin more efficient
- Hiding WordPress Plugin Source Code
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Will simple function names in a class structure conflict with other plugins?
- Instantiate class to be available to all plugin functions
- How to test nonce with AJAX – Plugin development
- wp_loaded hook block script enquequing
- WP nonce invalid
- How can i upload images in an admin page?
- How to find error in my code when the error message is pointing to WP core file?
- Custom user login page by creating a plugin
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Reprinting tags with all attributes
- Update results, Before deleting the related category [closed]
- Adding function to Genesis genesis_header [closed]
- Adding a widget function into the php theme file
- How to edit widget code to add unique class name to each div?
- How do I Turn This Into An if statement?
- how to update and display an option without reloading the page
- Archives shortcode displaying above widget title
- Widgets in the loop if active
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Plugin Generate Unexpected output during activation
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Undefined method class::construct() when creating a plugin
- wpdb prepare insert table doesn’t work
- wordpress admin plugin menu custom css
- how to Update 15k products on plugin activation with meta_option
- Using admin-post.php for admin form but it directs me to admin-post.php white screen
- custom plugin with upload files does not work
- What is the difference between Null vs Empty (Zero Length) string?
- send popup after wp_redirect()
- no_rest_route error on custom routes
- Payment field disappears on custom Paypal plugin
- Create ACF Checkbox to get all ACF Values from Parent Page
- How a HTML form can trigger a PHP function?
- Retrieve the whole widget sidebar and pass it inside an html
- Creating plugin with front-end pages
- How to Send Pingbacks for all Posts in WordPress?
- File is executed twice if plugin is activating
- product_type_options get saved value [closed]
- How to stop hiding buttons forward / backward in pagination?
- Display a custom name when the user has no name settle in his account
- How to create a widget with a populated dropdown?
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Sum All the Post Meta of Published posts of Current Logged in user
- Child and Parent Pages list of sub pages
- Autoloading Classes in Plugins
- Comparing Dates within plugin using PHP If statement
- Singleton plugin activation; create database
- Highlight Single Page Ancestor
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- My function echos only “array”
- Non-static method error when trying to use class in widgets
- Send data from plugin to external database
- See output of a sql query while plugin installation in wordpress
- List sibling pages widget, exclude current page
- Why this plugin is not working?
- Permission error on plugin save
- Widget header unique classes
- Trouble using wordpress functions in a pop-up modal form
- Edit the Publish Widget Options
- How to use custom fields to replace top-level parent title with an image using wp_list_pages?
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- base64_encode conflict with convert_smilies in wordpress
- Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?
- Login user into magento using wordpress account
- Customize create table SQL statement in any WordPress plugin
- wp_register_script – illegal string offset