There's an error with my functions.php file
-
Any time I click on any link or page on my home page it brings out a blank page with only the logo and a letter H.
I changed wp_ debug to true and this is what it says
”Warning: Trying to access array offset on value of type null in /home/mordecai/public_html/wp-content/themes/caretheme/functions.php on line 16
Warning: Undefined array key “subtitle” in /home/mordecai/public_html/wp-content/themes/caretheme/functions.php on line 20
Fatal error: Uncaught Error: Call to undefined function get_field() in /home/mordecai/public_html/wp-content/themes/caretheme/functions.php:21 Stack trace: #0 /home/mordecai/public_html/wp-content/themes/caretheme/single.php(5): pageBanner() #1 /home/mordecai/public_html/wp-includes/template-loader.php(106): include(‘/home/mordecai/…’) #2 /home/mordecai/public_html/wp-blog-header.php(19): require_once(‘/home/mordecai/…’) #3 /home/mordecai/public_html/index.php(17): require(‘/home/mordecai/…’) #4 {main} thrown in /home/mordecai/public_html/wp-content/themes/caretheme/functions.php on line 21
Please help!
Below is my functions.php file
text/x-generic functions.php ( PHP script, ASCII text )
function() {return get_the_author(); }
));
}add_action(‘rest_api_init’, ‘mordecai_custom_rest’);
function pageBanner($args = NULL) {
if (!$args[‘title’]) {
$args[‘title’] = get_the_title();
}if (!$args[‘subtitle’]) {
$args[‘subtitle’] = get_field(‘page_banner_subtitle’);
}if (!$args [‘photo’]) {
if (get_field(‘page_banner_background_image’)) {
$args[‘photo’] = get_field(‘page_banner_background_image’) [‘sizes’] [‘pageBanner’];
} else{
$args[‘photo’] = get_theme_file_uri(‘/images/couple.jpg’);
}
}?>
The blog I need help with is: (visible only to logged in users)
-
Hi there!
We are unable to help because we don’t host your site directly on our WordPress.com managed hosting. Instead, your site is hosted with a different provider on a separate host, and we’re unable to access your site’s backend to take a closer look. But I can get you pointed in the right direction.
It looks like the error is coming from a file in the
carethemethat your site is using. Since it appears to be a custom-built theme for your site, you would need to contact the developer that made the theme for you to see why the theme is throwing this error on your WordPress install.If you still have trouble or you’re unable to get the theme developer to help, please reach out to the WordPress community for guidance:
https://wordpress.org/support/forum/how-to-and-troubleshooting
I hope this points you in the right direction.
- The topic ‘There's an error with my functions.php file’ is closed to new replies.