WordPress.org

Ready to get started?Download WordPress

Forums

Error When Changing functions.php (2 posts)

  1. jquintana83
    Member
    Posted 5 years ago #

    Let me try this again...

  2. jquintana83
    Member
    Posted 5 years ago #

    I am trying to register a sidebar in my functions.php file. All I have done is copy/paste a new line of code after the last sidebar was registered. For example:

    My original code:

    // Setting up our widgetized sidebars
    if ( function_exists('register_sidebar') ) {
    register_sidebar(array('name'=>'Homepage Bottom Left','before_widget' => '<div id="boxleft">','after_widget' => '</div>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Homepage Bottom Middle','before_widget' => '<div id="boxmiddle">','after_widget' => '</div>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Homepage Bottom Right','before_widget' => '<div id="boxright">','after_widget' => '</div>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Post Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Page Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Tabber Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));
    }

    My modified code:

    // Setting up our widgetized sidebars
    if ( function_exists('register_sidebar') ) {
    register_sidebar(array('name'=>'Homepage Bottom Left','before_widget' => '<div id="boxleft">','after_widget' => '</div>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Homepage Bottom Middle','before_widget' => '<div id="boxmiddle">','after_widget' => '</div>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Homepage Bottom Right','before_widget' => '<div id="boxright">','after_widget' => '</div>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Post Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Page Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Tabber Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));
    register_sidebar(array('name'=>'Services Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));
    }

    That is the ONLY change I have made to my functions.php file. After uploading to the serverr I get the following error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/jquintan/public_html/mydoman.com/wp-content/themes/iRealEstate/functions.php:1) in /home/jquintan/public_html/mydomain.com/wp-includes/functions.php on line 698

    Warning: Cannot modify header information - headers already sent by (output started at /home/jquintan/public_html/mydomain.com/wp-content/themes/iRealEstate/functions.php:1) in /home/jquintan/public_html/mydomain.com/wp-includes/functions.php on line 699

    If anyone could help out I would greatly appreciate it!

    The ultimate goal is to have diffeent pages use different sidebars.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic