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?
- How display widget by id
- load/require specific php files for specific pages/templates/post types
- How to get the registered sidebar’s name by its id?
- ob_get_clean returns empty string, ob_get_flush outputs string
- How do I create a drop down menu in a widget?
- How to allow PHP In WordPress text widget
- display most popular tags in two columns
- Show Specific Footer Widget for Specific Pages
- WordPress menu deletes when trying to add a hook
- 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)
- Add before_content and after_content to register_sidebar
- 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?
- 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
- How to make my custom widget appear within WordPress widgets? Plugin development
- get widget number from array dynamically
- Adding widgets to my plugin page instead of WordPress dashboard
- Adding a widget function into the php theme file
- How to edit widget code to add unique class name to each div?
- If has $title in widgets
- Why does abstracting html from plugin code result in loss of access to wordpress functions?
- Show latest posts in a plain HTML website custom widget [closed]
- PHP include is only working in certain places in my custom WP theme
- How to determine if the sidebar is empty? Or not active?
- Is it bad to add html to a widget by closing and reopening the php tags?
- Widget back end radio button issue
- What is the proper way to include a PHP framework into my theme?
- Post’s ID pattern?
- Using WP functions such as the_title() in an included php file
- What’s the best way to include PHP code in pages?
- Widgets not showing on custom theme
- My website is not showing Footer section
- How to include custom PHP file both in header and footer files
- Correctly Using checked function of WordPress
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- How to use title attributes in sidebar widget?
- display specific widget to a page
- Dynamically display font icons in widget
- Correct code to use php in text widget
- Include a file that has a function in it
- Stuck with sidebar registering
- Don’t display a sidebar widget when on a specific page
- WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
- How do you create a custom category widget that you can style?
- How a HTML form can trigger a PHP function?
- How to use wp_get_attachment_image or wp_get_attachment_image_src instead of $instance[‘single_feature_image_uri’]
- Loading Widgets Via Child Theme
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Inserting a class on before_widget if checkbox is checked
- Current WordPress Page Title as Search Parameter into A Tag
- How to create a widget with a populated dropdown?
- dashboard widget form not submit mails
- Before & After Content – After Content directly below Before Content when using require_once
- How to make a “page-option” in WordPress
- Priority call methods – PHPMailer->addAddress(NULL)
- I need to edit a widget, with no dashboard access
- loading a php file to a specific page id
- missing admin bar and widget in a template
- My own theme’s custom widget areas are not working
- PHP get_category() function redeclared
- Beyond widget side menu editing, with the php page, custom template
- PHP: Why does my code work in index.php but not a widget?
- 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
- Update title of every instance of widget using text field
- Are widget arguments always set inside My_Widget::widget()?
- WordPress – registering sidebar and adding a button directly after .textwidget
- How can I include a file related to blog URL? Nothing seems to work
- Using existing widget code! [closed]
- 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
- Shortcode not passing variable to included file
- 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?
- 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?