Home Forums Front-end Issues ACF plugin is causing "headers already send by…" error Reply To: ACF plugin is causing "headers already send by…" error

  • Thanks for your help. I fixed the code as you suggested, but the same error shows:
    Warning: Cannot modify header information – headers already sent by (output started at /home/customer/www/ in /home/customer/www/ on line 1421

    Here is a snippet of the fixed code:

    if (get_field(‘general_redirect’, $bifrost_queried_object) && get_field(‘general_redirect_url’, $bifrost_queried_object)) {
    wp_redirect(get_field(‘general_redirect_url’, $bifrost_queried_object));
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <meta charset=”<?php bloginfo(‘charset’); ?>”>
    <meta name=”viewport” content=”width=device-width, initial-scale=1″>
    <meta http-equiv=”X-UA-Compatible” content=”ie=edge”>
    * Queried Object
    * In case it is shop page get_queried_object won’t
    * work, it needs to be changed to a custom WooCommerce
    * function wc_get_page_id.
    $bifrost_queried_object = class_exists(‘WooCommerce’) && is_shop() ? wc_get_page_id(‘shop’) : get_queried_object();


    Thanks so much for your help!