Your script is at /wp-content/themes/responsive-child-theme/nowplaying-example.php
but you are including /nowplaying-example.php
. That is not going to work. You need to provide the complete path for that include:
include(get_stylesheet_directory().'/nowplaying-example.php');
Assuming I have read that right, and assuming that the files are actually there.
Your other code– the widget code– contains curly quotes. Don’t use those. Use ordinary, boring straight up and down quotes like in the first code you posted. That could be causing errors. But that other code also has a bad include. Those bad includes will trigger warnings, which could cause other issues.
Related Posts:
- How to include checkbox in widget backend form?
- Limit the number of inactive widgets
- Include WP_Query in my own PHP file?
- Include a external PHP file into a WordPress Custom Template
- Include files in functions.php
- How display widget by id
- load/require specific php files for specific pages/templates/post types
- Create Image Uploader for Widget
- How to get the registered sidebar’s name by its id?
- Displaying a variable stored in functions.php inside widget
- ob_get_clean returns empty string, ob_get_flush outputs string
- Check if widget has content
- Transform php code into a widget?
- How do I create a drop down menu in a widget?
- WordPress widget in custom theme
- How to allow PHP In WordPress text widget
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- display most popular tags in two columns
- List authors with posts in a category
- where to include a php file
- How to add Shortcode (font awesome) in widget title?
- Anything I can add to functions.php to make text widgets accept PHP?
- Show Specific Footer Widget for Specific Pages
- WordPress menu deletes when trying to add a hook
- dynamic sidebar not showing anything
- PHP contact form returns warning in text widget [closed]
- 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
- Class ‘WP_Widget’ not found
- Include Class File in WordPress
- integrating external php library into wordpress- the right way
- Change title and meta description in included page (not template)
- Can I change a variable in a content part while calling it?
- javaScript in section of WP API
- the_author() not working outside the loop
- Style every second widget?
- How to group 2 radio buttons in a widget?
- Add before_content and after_content to register_sidebar
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- I can’t get my custom widget area to show on my WordPress site
- How to run PHP code in Text Widget with no plugin in WP 4.4
- WordPress widget/sidebar dividers?
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Put CSS inside a PHP file and include it the right way
- custom widget on the footer
- Missing sidebar parameter “fix” – before_content
- How to add just one specific page to widget without plugin?
- Create onClick Event to Re-load a Widget
- functions.php is being included twice, creating PHP fatal errors
- How to put a variable in a instance in the widget
- How to output widget
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- Extending the WP_Widget_Text class
- PHP help get_template_directory + PHP include
- Dynamic Sidebars & Echo
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Beyond widget side menu editing, with the php page, custom template
- How to list categories by page id in wordpress
- PHP: Why does my code work in index.php but not a widget?
- Non-static method error when trying to use class in widgets
- Are WordPress widgets cached?
- Widget edit and add in any page
- widget: input the px value from user and use it as inline style in widget function
- Slider from different widgets
- Even with PHP plugin get_posts not working in widget area
- Update title of every instance of widget using text field
- how to run a php code in widget?
- Are widget arguments always set inside My_Widget::widget()?
- WP_Widget dynamic field array with external AJAX
- WordPress – registering sidebar and adding a button directly after .textwidget
- How do I / Is it possible to execute an external PHP file / function inside WordPress?
- List sibling pages widget, exclude current page
- Include a php file that is above WP installation hierarchically?
- How can I include a file related to blog URL? Nothing seems to work
- Name Input from widget displays Sidebar name instead of saved data
- WordPress – show number of comments for each post in widget
- Using existing widget code! [closed]
- Widget header unique classes
- Banner editable from backend
- My custom widget won’t stay in the widget area after I refresh the widget page
- key( $GLOBALS[‘wp_registered_sidebars’] ) is always showing the same value
- How to change links in the 3 main categories, on widget category, to a javascript function call
- Using a loop to build and update widgets
- WordPress blog set up
- PHP Widget and do_shortcode
- Edit the Publish Widget Options
- How to define template directory in this widget code
- Shortcode not passing variable to included file
- php “use” not working in template [closed]
- WP Debug enabled Undefined index error in a widget
- How to include a php file in every post and page [duplicate]
- Shortcode to include PHP file, pass various parameters to include?
- wordpress.org disallowing my plugin becuase of loading core files in cron cpanel file
- Should I use include(_once) or require(_once) for loading php-file with customizer settings?
- how to check elementor is widget is active or loaded
- How to edit a widget code?
- WordPress PHP8.2 Critical Error in class-wp-widget.php
- wordpress-plugin (widget) that performs a Neaby-search on the openstreetmap-endpoint: around x find y
- Trying to insert widget code into theme function