Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/05/2012, 13:41
arquidea
 
Fecha de Ingreso: abril-2009
Mensajes: 233
Antigüedad: 15 años
Puntos: 5
Error headers wordpress

Hola a todos,

Tengo un portal web donde hace algunos días que instale wordpress para tener además un blog ofreciendo noticias relacionadas con mi portal.
Todo la instalación de wordpress y la preparación fue perfecto.

El problema me viene al sacar las los últimos tres archivos desde la home de mi web, ya que esta no es de wordpress, si no que está hecha por mi con php.
Encontré un código para extraer los últimos tres post, es este:

Código PHP:
<?php
require('./noticias/wp-blog-header.php');
$my_query = new WP_Query('showposts=3');
while (
$my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate $post->ID;
?>

    <li><a href="<?php the_permalink() ?>" target="_blank" rel="bookmark" class="titulopost">
    <?php the_title(); ?></a>
    
<?php 
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
  
the_post_thumbnail( array(100,100) );

?>

           <p>
           
   <?
$content 
get_the_excerpt();

$MaxLENGTH=150;
$TextoResumen substr($content,0,strrpos(substr($content,0,$MaxLENGTH)," "));
echo 
$TextoResumen." …";

?>
Se muestran los últimos tres artículos genial pero me da el siguiente error Warning por los headers y no se me ocurre como puedo solucionarlo...

Código PHP:
WarningCannot modify header information headers already sent by (output started at /home/.../public_html/index.php:5in /home/.../public_html/noticias/wp-content/plugins/w3-total-cache/lib/W3/Referrer.php on line 50 
El código del archivo que falla en dicha linea es:

Código PHP:
    function get_http_referrer() {
        
$http_referrer '';

        if (isset(
$_COOKIE[W3TC_REFERRER_COOKIE_NAME])) {
            
$http_referrer $_COOKIE[W3TC_REFERRER_COOKIE_NAME];
        } elseif (isset(
$_SERVER['HTTP_REFERER'])) {
            
$http_referrer $_SERVER['HTTP_REFERER'];

             
setcookie(W3TC_REFERRER_COOKIE_NAME$http_referrer0w3_get_base_path());

       }

        return 
$http_referrer;
    } 

Alguien tiene idea?

Gracias de antemano!