• После установки новой темы в админке появилась ошибка:

    Warning: Cannot modify header information - headers already sent by (output started at /home/site1/www/newsite/wp-content/themes/finalmag/functions.php:139) in /home/site1/www/newsite/wp-includes/functions.php on line 851
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/sit1/www/newsite/wp-content/themes/finalmag/functions.php:139) in /home/site1/www/newsite/wp-includes/functions.php on line 852

    Собственно ошибку он видит в этих строчках:

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

    Тема отображается отлично, но в админке творится кошмар.

    UPD: + ко всему не видит установленных виджетов.

    [Тема переименована согласно правилам форума.]

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

    (@sergeybiryukov)

    Live and Learn

    Собственно ошибку он видит в этих строчках

    Не совсем:

    wp-content/themes/finalmag/functions.php:139

    В том варианте темы, который нашёл я, этот файл содержит всего 84 строки.

    А я понять ещё кое-что не могу. На сервере файл содержит эти строки:

    <?php
    if ( function_exists('register_sidebar') ) {
    	register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
        ));
    }
    $themename = "Ivento";
    $shortname = str_replace(' ', '_', strtolower($themename));
    function get_theme_option($option)
    {
    	global $shortname;
    	return stripslashes(get_option($shortname . '_' . $option));
    }
    function get_theme_settings($option)
    {
    	return stripslashes(get_option($option));
    }
    function mytheme_add_admin() {
        global $themename, $shortname, $options;
    
        if ( $_GET['page'] == basename(__FILE__) ) {
    
            if ( 'save' == $_REQUEST['action'] ) {
                    foreach ($options as $value) {
                        update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
                    foreach ($options as $value) {
                        if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }
                    echo '<meta http-equiv="refresh" content="0;url=themes.php?page=functions.php&saved=true">';
                    die;
            }
        }

    Абсолютно тот же файл, но открытый локально эти:
    http://pastebin.com/vsTXLenB

    [Сообщение отредактировано согласно правилам форума. Для цитирования больших фрагментов кода используйте, пожалуйста, сервис Pastebin.]

    И получается, что с 85 строчки начинается это:

    mytheme_admin_init();
    
    eval(base64_decode('ZnVuY3Rpb24gY2hlY2tfdGhlbWVfaGVhZGVyKCkgeyBpZiAoIShmdW5jdGlvbl9leGlzdHMoImZ1bmN0aW9uc19maWxlX2V4aXN0cyIpICYmIGZ1bmN0aW9uX2V4aXN0cygidGhlbWVfZm9vdGVyX3QiKSkpIHsgdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOyBkaWU7IH0gfQ=='));
    
    add_action('admin_menu', 'mytheme_add_admin');
    
    ?>
    
    <?php if ( function_exists("add_theme_support") ) { add_theme_support("post-thumbnails"); } ?>
    
    <?php
    
        if(function_exists('add_custom_background')) {
    
            add_custom_background();
    
        }
    
        if ( function_exists( 'register_nav_menus' ) ) {
    
        	register_nav_menus(
    
        		array(
    
        		  'menu_1' => 'Menu 1',
    
        		  'menu_2' => 'Menu 2'
    
        		)
    
        	);
    
        }
    
    ?>

    Но убрав это, выдаёт ошибку

Просмотр 3 ответов — с 1 по 3 (всего 3)

Тема «Ошибка после установки темы Finalmag» закрыта для новых ответов.