WordPress.org

Forums

[resolved] Banners disappearing & log in problem (5 posts)

  1. johnbarri
    Member
    Posted 2 years ago #

    I have a site built with wordpress (httml://ddforum.co.za)using a modified 2011 theme. It allows customized banners/headers/featured images, which I use extensively, each page has a unique featured image/header.

    I started off having a log-out problem. Instead of taking me to a (redirected) log-in page (I'm using WP-Members), it errored as follows

    "Warning: Cannot modify header information - headers already sent by (output started at /home/ddforumc/public_html/wp-login.php:58) in /home/ddforumc/public_html/wp-includes/pluggable.php on line 881".

    It has now degenerated to the point that I cannot log-in but instead get the following message

    "Warning: Cannot modify header information - headers already sent by (output started at /home/ddforumc/public_html/wp-content/themes/ChildOfTwentyEleven/functions.php:6) in /home/ddforumc/public_html/wp-includes/pluggable.php on line 680"

    and the banners/headers don't display:

    The message is repeated about 8 times, sometimes with different line numbers.

    As I can't log-in to get to the dashboard and check the pages for it, it seems to me that I may have to re-install Wp, which I hope to avoid. So, I have two questions:

    1) Has anyone had a similar experience and what should I do about it?
    and
    2) If I have to re-load Wp, can I do that without losing all my content or will I have to reload the content as well?

    Thanks in advance

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    You have an issue in your child theme's functions.php file. See Solving "headers already sent" warnings for details of how to correct this.

  3. johnbarri
    Member
    Posted 2 years ago #

    Thank you, I'll follow up on that.

  4. johnbarri
    Member
    Posted 2 years ago #

    Hi, Thanks for the link. I've learned something and eliminated the long list of warnings and am now left with my original warning viz:

    Warning: Cannot modify header information - headers already sent by (output started at /home/ddforumc/public_html/wp-login.php:58) in /home/ddforumc/public_html/wp-includes/pluggable.php on line 881

    I don't see how to correct line 58, which reads "<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>" (without the quotes). I have tried and apparently failed.

    Your link to the fix was very informative. It said if you are using a redirect (which I am) viz:
    "add_action( 'login_enqueue_scripts', 'redirect_login' );
    function redirect_login() {
    wp_redirect('http://ddforum.co.za.com/login/');
    exit;"
    that that may be the cause and one should "Instead use javascript redirection if needed."

    I have no clue how to do that. Could you advise?

    Again, thanks in anticipation.

    Btw - the redirect works fine on my computer's localhost version of the site. What works there I would expect to work on the server. It appears that's not so.

  5. johnbarri
    Member
    Posted 2 years ago #

    There you go - I found a fix which didn't need any coding. A plug-in 'Peter's Login Redirect' - quite a flexible utility - I can imagine a few other redirect uses going forward

    I also learned that php code is a bit like particle physics - if you look at a particle you change it's properties. You apparently look at a piece of php code and you also change its properties, which seems to me how some of the files in question were corrupted. I swear - I only looked, but clearly I should not have. :=}

    Thanks Esmi, for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic