Problema con el header de un theme propio
-
He heredado un proyecto en el cual otra persona creo un theme y me salta un error en el header que no logro resolver:
En el archivo: header.php Coloco esta función:
<?php
header(‘Content-Type: ‘.get_bloginfo(‘html_type’).’; charset=’.get_bloginfo(‘charset’));
?>Y me tira los siguiente dos errores:
Warning: Cannot modify header information – headers already sent by (output started at /home/investinsa/domains/investinsantander.es/public_html/wp-content/themes/sodercan/functions.php:15) in /home/investinsa/domains/investinsantander.es/public_html/wp-includes/pluggable.php on line 1173
El en archivo functions.php está creada esta función para el Sidebar
/wp-content/themes/…/functions.php:15
<?php// Main Sidebar
if(function_exists(‘register_sidebar’)){
register_sidebar(array(
‘name’ => ‘Main Sidebar’,
‘after_widget’ => »,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’,
));
}
?>Y en el archivo: pluggable.php me dice que en esta línea: status_header($status); // This causes problems on IIS and some FastCGI setups
Hay otro error el propio WordPress ya me avisa de que puede causar error.
/wp-includes/pluggable.php on line 1173
function wp_redirect($location, $status = 302) {
global $is_IIS;/**
* Filter the redirect location.
*
* @since 2.1.0
*
* @param string $location The path to redirect to.
* @param int $status Status code to use.
*/
$location = apply_filters( ‘wp_redirect’, $location, $status );/**
* Filter the redirect status code.
*
* @since 2.3.0
*
* @param int $status Status code to use.
* @param string $location The path to redirect to.
*/
$status = apply_filters( ‘wp_redirect_status’, $status, $location );if ( ! $location )
return false;$location = wp_sanitize_redirect($location);
if ( !$is_IIS && php_sapi_name() != ‘cgi-fcgi’ )
status_header($status); // This causes problems on IIS and some FastCGI setupsheader(«Location: $location», true, $status);
return true;
}
endif;Espero que puedan guiarme, muchas gracias.
- El debate ‘Problema con el header de un theme propio’ está cerrado a nuevas respuestas.