Adding widget area to functions.php causes blank s

2019-08-17 07:22发布

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?

标签: wordpress
1条回答
The star\"
2楼-- · 2019-08-17 07:39

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

查看更多
登录 后发表回答