• Resolved clayhendrix

    (@clayhendrix)


    When users click the Share Facebook button, the following message is displayed in a new tab with a white background:

    Warning: Cannot modify header information – headers already sent by (output started at /home/farmingtonchurch/public_html/index.php:4) in /home/farmingtonchurch/public_html/wp-includes/pluggable.php on line 1207

    The URL for the tab that is opened after you click the share button is

    https://www.farmingtonchurchofchrist.com/sermons/?share=facebook

    The same thing happens with the Share Twitter button, but with the URL of the new tab having twitter instead of facebook.

    Site URL https://www.farmington.church

    I am clicking on the Sermons button in the nav bar and trying to share that page using the Facebook button at the bottom of the page.

    I have never enabled the sharing buttons before now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter clayhendrix

    (@clayhendrix)

    Additional information:

    I get the same error when I try to submit the contact form on this page:

    https://www.farmingtonchurchofchrist.com/planned-improvements/

    Warning: Cannot modify header information – headers already sent by (output started at /home/farmingtonchurch/public_html/index.php:4) in /home/farmingtonchurch/public_html/wp-includes/pluggable.php on line 1207

    Clearly, to me, they are related. Here is lines 1190 to 1211 in pluggable.php

    ‘line 1190 * 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 != ‘cgi-fcgi’ )
    status_header($status); // This causes problems on IIS and some FastCGI setups

    line 1207 header(“Location: $location”, true, $status);

    return true;
    }
    endif;’

    Thread Starter clayhendrix

    (@clayhendrix)

    Additional information.

    When I type the URL farmington.church, I am redirected to https://www.farmington.church and see the website perfectly.

    When I type the URL farmingtonchurchofchrist.com, I get the same error as above.

    Warning: Cannot modify header information – headers already sent by (output started at /home/farmingtonchurch/public_html/index.php:4) in /home/farmingtonchurch/public_html/wp-includes/pluggable.php on line 1207

    I think that information should help someone determine what the problem is. It seems to me that I have a DNS or some type of domain setting that is incorrect.

    Both farmington.church and farmingtonchurchofchrist.com domains are setup the same way in godaddy and in my host’s cPanel. Well, apparently, they are not, but I intend for them to be, can someone give me a clue as to where to look?

    Thread Starter clayhendrix

    (@clayhendrix)

    I have resolved my issue. I searched the wordpress forum for

    “Warning: Cannot modify header information – headers already sent by”

    which was the beginning of the error received when trying to use the share buttons. I found this page:

    https://codex.www.ads-software.com/FAQ_Troubleshooting

    and FAQ #8 (at the time of this posting) helped me solve my problem. I learned that the offending code was in index.php line 4 and pluggable line 1207 was the victim.

    Also in the FAQ #8, I learned some information about .php file structure.

    I had added google-site-verification code to the index.php file to verify with google that I owned this domain. I had to put the verification code between <head> and </head> and in a .php file the first characters must be “<?php” and my file had <head> for the reason stated.

    I deleted the entire head and made certain the file started with <?php as it originally did. I also checked some other rules I found in FAQ# 8 to be certain.

    This fix immediately solved my problem. I am going to mark it as resolved, although someone smarter than I might well have additional information to add.

    I hope this helps someone.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Share Buttons Error’ is closed to new replies.