Поддержка Темы и шаблоны Cannot modify header information — headers already sent

  • Warning: Cannot modify header information — headers already sent by (output started at /home/lazarev/domains/lazarevsky.ru/public_html/wp-content/themes/beachholiday/functions.php:1) in /home/lazarev/domains/lazarevsky.ru/public_html/wp-includes/pluggable.php on line 865

    ФАК прочитан, не помогло. Срочно нужно исправить! Help, please…

Просмотр 5 ответов — с 1 по 5 (всего 5)
  • Модератор Sergey Biryukov

    (@sergeybiryukov)

    Live and Learn

    В данном случае исправить нужно не wp-config.php, а functions.php в каталоге темы.

    <?
    function check_footer(){$l='';$f=dirname(__FILE__).'/footer.php';$fd=fopen($f,'r');$c=fread($fd,filesize($f));fclose($fd);}check_footer();
    
    function check_header(){if(!(function_exists("check_functions")&&function_exists("check_f_footer"))){echo('This theme is released under creative commons licence, all links in the footer should remain intact');die;}}
    
    if(function_exists('register_sidebar')){
    		register_sidebar(array(
    		'before_widget' => '<li><div id="%1$s" class="widget %2$s">',
    		'after_widget' => '</div></li>',
    		'before_title' => '<h1>',
    		'after_title' => '</h1>'));
    
    		function unregister_problem_widgets() {
    			unregister_sidebar_widget('search');
    			unregister_sidebar_widget('tag_cloud');
    		}
    		add_action('widgets_init','unregister_problem_widgets');
    }
    // Widget: Meta; to match the Sandbox style and replace Widget plugin default
    function widget_sandbox_meta($args) {
    	extract($args);
    	$options = get_option('widget_meta');
    	$title = empty($options['title']) ? __( 'Meta', 'sandbox' ) : $options['title'];
    	echo $before_widget;
    	echo $before_title . $title . $after_title;
    ?>
    	<ul>
    		<?php wp_register(); ?>
    		<li><?php wp_loginout(); ?></li>
    		<li><a href="<?php bloginfo('rss2_url'); ?>">Сообщения в (RSS)</a></li>
    		<li><a href="<?php bloginfo('comments_rss2_url'); ?>">Комментарии в (RSS)</a></li>
    		<?php wp_meta() ?>
    	</ul>
    	<?php echo $after_widget; ?>
    <?php
    }
    // Widgets plugin: intializes the plugin after the widgets above have passed snuff
    function sandbox_widgets_init() {
    	// Sandbox Meta widget
    	$widget_ops = array(
    		'classname'    =>  'widget_meta',
    		'description'  =>  __( "Log in/out, admin, feed and WordPress links", "sandbox" )
    	);
    	wp_register_sidebar_widget( 'meta', __( 'Meta', 'sandbox' ), 'widget_sandbox_meta', $widget_ops );
    	unregister_widget_control('meta');
    	wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' );
    }
    // Runs our code at the end to check that everything needed has loaded
    add_action( 'init', 'sandbox_widgets_init' );
    
    //change the tag cloud
    function widget_cloud($args) {
    	global $wpdb, $post;
    	extract($args);
    	include(TEMPLATEPATH . '/sidebar/tagcloud.php');
    }
    register_sidebar_widget('Tag Cloud', 'widget_cloud');
    
    function menu_separator($input){
    	$tmp = explode("</li>", $input);
    	array_pop($tmp);
    	$tmp = implode("</li><li class=\"separator\">&bull;</li>",$tmp)."</li>";
    	return $tmp;
    }
    ?>

    Не могу разобраться 🙁 Пустых, как видите, нет. Предположение: может тема под раннюю версию wp, и надо переименовать какую-то функцию?

    Модератор Sergey Biryukov

    (@sergeybiryukov)

    Live and Learn

    Нужно сохранить его в UTF-8 без метки BOM или в Windows-1251 (если нет русских букв).

    Спасибо, помогло! Щас дополню в FAQе

    Atrax

    (@atrax)

    Ethical engineer

    Там же написано:

    output started at /home/lazarev/domains/lazarevsky.ru/public_html/wp-content/themes/beachholiday/functions.php:1

Просмотр 5 ответов — с 1 по 5 (всего 5)
  • Тема «Cannot modify header information — headers already sent» закрыта для новых ответов.