BuddyDev

Search

[Resolved] BP Custom Background for User Profile – Warning message

  • Participant
    Level: Initiated
    Posts: 17
    Leigh on #5665

    Hi Brajesh,

    Getting a Warning message on top site pages. Reads:

    Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at /home/xxx/wp-content/plugins/bp-custom.php:41) in /home/xxx/wp-content/plugins/wp-file-upload/wordpress_file_upload.php on line 2

    If I deactivate the plugin referred to above it just trips up at the next pluging. Line 2 refers to:

    if( !session_id() ) { session_start(); }

    You gave me the code below to add to bp-custom.php. Worked for a while but now has this warning since I migrated to a different host or perhaps updated wp. Happened at around same time.

    ============================================================

    add_filter( ‘bppg_iwilldo_it_myself’, ‘__return_true’ );//do not generate css for us

    //Our own css
    function buddydev_custom_inject_css() {
    if ( ! function_exists( ‘bppg_get_image’ ) ) {
    return ;// no trouble when the plugin is disabled
    }

    $image_url = bppg_get_image();

    if ( empty( $image_url ) ) {
    return;
    }

    $repeat_type = bp_get_user_meta( bp_displayed_user_id(), ‘profile_bg_repeat’, true );

    if ( ! $repeat_type ) {
    $repeat_type = ‘repeat’;
    }
    ?>
    <style type=”text/css”>
    body.is-user-profile .site{
    background: url(<?php echo $image_url; ?>);
    background-repeat: <?php echo $repeat_type; ?>;
    }
    </style>
    <?php
    }
    add_action( ‘wp_head’, ‘buddydev_custom_inject_css’, 200 );

    =============================================================

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #5666

    Hi Leigh,
    Please post your complete bp-custom.php on pastebin. It has nothing to do with my code. There are two possibilities:-

    1. There is at least once space before the beginning php or after the ending php tag

    2.Or the code trying to create session is running too late.

    Thank You
    Brajesh

  • Participant
    Level: Initiated
    Posts: 17
    Leigh on #5670

    Hi Brajesh,

    It was a space after the ending php. Pity the warning doesn’t read: There is a space after the ending php dummy!

    Thanks for the help.

    Leigh

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #5671

    Hi Leigh,
    no problem. I am glad It is resolved. Thank ou for marking it as resolved.

    Regards
    Brajesh

The topic ‘ [Resolved] BP Custom Background for User Profile – Warning message’ is closed to new replies.

This topic is: resolved