Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress cover image function not working.


  • marufimran434
    Participant

    @marufimran434

    I am giving here the function. When I try this on localhost its working but on a previous developed site where I am working here is also have the function but it is not working. can you please help me? There has same themes and same plugins on 2 place. maybe its code conflict. can you please tell me where from the function is called? here are 2 screenshots also.

    function bp_nouveau_theme_cover_image( $params = array() ) {
    if ( empty( $params ) ) {
    return ”;
    }

    // Avatar height – padding – 1/2 avatar height.
    $avatar_offset = $params[‘height’] – 5 – round( (int) bp_core_avatar_full_height() / 2 );

    // Header content offset + spacing.
    $top_offset = bp_core_avatar_full_height() – 10;
    $left_offset = bp_core_avatar_full_width() + 20;

    if ( ! bp_is_active( ‘activity’ ) || ! bp_activity_do_mentions() ) {
    $top_offset -= 40;
    }

    $cover_image = isset( $params[‘cover_image’] ) ? ‘background-image: url( ‘ . $params[‘cover_image’] . ‘ );’ : ”;
    $hide_avatar_style = ”;

    // Adjust the cover image header, in case avatars are completely disabled.
    if ( ! buddypress()->avatar->show_avatars ) {
    $hide_avatar_style = ‘
    #buddypress #item-header-cover-image #item-header-avatar {
    display: none;
    }
    ‘;

    if ( bp_is_user() ) {
    $hide_avatar_style = ‘
    #buddypress #item-header-cover-image #item-header-avatar a {
    display: block;
    height: ‘ . $top_offset . ‘px;
    margin: 0 15px 19px 0;
    }

    #buddypress div#item-header #item-header-cover-image #item-header-content {
    margin-left:auto;
    }
    ‘;
    }
    }

    return ‘
    /* Cover image */
    #buddypress #item-header-cover-image {
    min-height: ‘ . $params[‘height’] . ‘px;
    margin-bottom: 1em;
    }

    #buddypress #item-header-cover-image:after {
    clear: both;
    content: “”;
    display: table;
    }

    <b>#buddypress #header-cover-image {
    height: ‘ . $params[‘height’] . ‘px;
    ‘ . $cover_image . ‘
    }
    </b>

    #buddypress #create-group-form #header-cover-image {
    position: relative;
    margin: 1em 0;
    }

    .bp-user #buddypress #item-header {
    padding-top: 0;
    }

    #buddypress #item-header-cover-image #item-header-avatar {
    margin-top: ‘ . $avatar_offset . ‘px;
    float: left;
    overflow: visible;
    width:auto;
    }

    #buddypress div#item-header #item-header-cover-image #item-header-content {
    clear: both;
    float: left;
    margin-left: ‘ . $left_offset . ‘px;
    margin-top: -‘ . $top_offset . ‘px;
    width:auto;
    }

    body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content,
    body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions {
    margin-top: ‘ . $params[‘height’] . ‘px;
    margin-left: 0;
    clear: none;
    max-width: 50%;
    }

    body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions {
    padding-top: 20px;
    max-width: 20%;
    }

    ‘ . $hide_avatar_style . ‘

    #buddypress div#item-header-cover-image h2 a,
    #buddypress div#item-header-cover-image h2 {
    color: #FFF;
    text-rendering: optimizelegibility;
    text-shadow: 0px 0px 3px rgba( 0, 0, 0, 0.8 );
    margin: 0 0 .6em;
    font-size:200%;
    }

    #buddypress #item-header-cover-image #item-header-avatar img.avatar {
    border: solid 2px #FFF;
    background: rgba( 255, 255, 255, 0.8 );
    }

    #buddypress #item-header-cover-image #item-header-avatar a {
    border: none;
    text-decoration: none;
    }

    #buddypress #item-header-cover-image #item-buttons {
    margin: 0 0 10px;
    padding: 0 0 5px;
    }

    #buddypress #item-header-cover-image #item-buttons:after {
    clear: both;
    content: “”;
    display: table;
    }

    @media screen and (max-width: 782px) {
    #buddypress #item-header-cover-image #item-header-avatar,
    .bp-user #buddypress #item-header #item-header-cover-image #item-header-avatar,
    #buddypress div#item-header #item-header-cover-image #item-header-content {
    width:100%;
    text-align:center;
    }

    #buddypress #item-header-cover-image #item-header-avatar a {
    display:inline-block;
    }

    #buddypress #item-header-cover-image #item-header-avatar img {
    margin:0;
    }

    #buddypress div#item-header #item-header-cover-image #item-header-content,
    body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content,
    body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions {
    margin:0;
    }

    body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content,
    body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions {
    max-width: 100%;
    }

    #buddypress div#item-header-cover-image h2 a,
    #buddypress div#item-header-cover-image h2 {
    color: inherit;
    text-shadow: none;
    margin:25px 0 0;
    font-size:200%;
    }

    #buddypress #item-header-cover-image #item-buttons div {
    float:none;
    display:inline-block;
    }

    #buddypress #item-header-cover-image #item-buttons:before {
    content:””;
    }

    #buddypress #item-header-cover-image #item-buttons {
    margin: 5px 0;
    }
    }
    ‘;
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar