0

Hi, I just installed wordpress custom themes to my wordpress page then this error appears when open the admin page. On top of the admin page. Why is it ?

Warning: Cannot modify header information - headers already sent by (output started at /home/ocklaw5/public_html/new/wp-content/themes/ocklaw/functions.php:2) in /home/ocklaw5/public_html/new/wp-includes/functions.php on line 861

Warning: Cannot modify header information - headers already sent by (output started at /home/ocklaw5/public_html/new/wp-content/themes/ocklaw/functions.php:2) in /home/ocklaw5/public_html/new/wp-includes/functions.php on line 862

How to fix it?

Themes functions:

functions.php

<?php

add_filter('get_comments_number', 'comment_count', 0);
	function comment_count($count) {
		if (! is_admin()){
		global $id;
		$comments_by_type = &seperate_comments(get_comments('status=approve&post_id=' .$id));
		} else {
		return $count;
		}
	}

	remove_action('wp_head', 'rsd_link');
	remove_action('wp_head', 'wlwmanifest_link');
	remove_action('wp_head', 'feed_links_extra', 3);

	function remove_generator() {
		return '';
	}

	add_filter('the_generator', 'remove_generator');

	function login_error_mess(){
	return 'ERROR: Invalid username or password.';
	}

	add_filter('login_errors', 'login_error_mess');

// JQuery

function my_scripts_method() {
    // register your script location, dependencies and version
    wp_register_script('jquery_script', get_template_directory_uri().'js/jquery-1.4.2.min.js', array('jquery'), '1.0');
    wp_register_script('jqfaq_script', get_template_directory_uri().'js/jq-faq-2.js', array('jquery'), '1.0');

    // enqueue the script
    wp_enqueue_script('jquery_script');
    wp_enqueue_script('jqfaq_script');
	}

function my_scripts_method2() {
    // register your script location, dependencies and version
    wp_register_script('jquery17_script', get_template_directory_uri().'js/jquery-1.7.1.min.js', array('jquery'), '1.0');
    wp_register_script('Cycle_script', get_template_directory_uri().'js/jquery.cycle.all.js', array('jquery'), '1.0');

    // enqueue the script
    wp_enqueue_script('jquery17_script');
    wp_enqueue_script('Cycle_script');
	}

	if( is_page_template( 'page-practice-area.php' ) ) {
	add_action('wp_enqueue_scripts', 'my_scripts_method');
	}

	if( is_page_template( 'front-page.php' ) ) {
	add_action('wp_enqueue_scripts', 'my_scripts_method2');
	}
?>

This line 861 & 862 in wp-includes\functions.php:

setcookie( 'wp-settings-' . $user->ID, $settings, time() + 31536000, SITECOOKIEPATH );
setcookie( 'wp-settings-time-' . $user->ID, time(), time() + 31536000, SITECOOKIEPATH );

How to fix the problem ?

(I already ask in the wordpress forum , and who knows if in php forum somebody can help me. :)

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.