Adding widget area to functions.php causes blank s

2019-08-17 07:09发布

问题:

I'm following multiple tutorials that all tell me to put this into my functions.php to add a widget area:

<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
    'before_widget' => '',
    'after_widget' => '',
    'before_title' => '<div class="title">',
    'after_title' => '</div>',
));
?>

Once I upload that file and try to change anything, like post or edit a post I get a white screen directly after hitting publish or any other action button.

Is there something wrong with that code? Or am I missing something when it comes to adding widget areas to my template?

回答1:

Wordpress doesn't like blank lines on the functions.php page..



标签: wordpress