Warning: Cannot Modify header information - headers already sent by - Does anyone know how to resolve this error in Wordpress?

Asked

Viewed 9 times

0

I am beginner in Wordpress, I would like a help to resolve this error. Warning: Cannot Modify header information - headers already sent by (output Started at public_html/wp-includes/functions.php:74)pluggable.php on line 1296

   71 function current_time( $type, $gmt = 0 ) {
  72    // Don't use non-GMT timestamp, unless you know the difference and really need to.
 73     if ( 'timestamp' === $type || 'U' === $type ) {
// linha74          return $gmt ? time() : time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
        }
    
        if ( 'mysql' === $type ) {
            $type = 'Y-m-d H:i:s';
        }
    
        $timezone = $gmt ? new DateTimeZone( 'UTC' ) : wp_timezone();
        $datetime = new DateTime( 'now', $timezone );
    
        return $datetime->format( $type );
    }
  • Hello, Diego, welcome to Stackoverflow in English. 1) Already checked this answer to a similar question What are you showing as duplicate? 2) Which template (template) or part (template-part) or hook (hook) are you implementing the code you shared? If it’s a part or hook too early, maybe it’s before Wordpress sends the Headers, and you’ll need to implement your code later.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.