Skip to:
Content
Pages
Categories
Search
Top
Bottom

Avatars Not Working With Subdomain

  • Let me first say this is not a multisite. This is a separate install in a subdomain used for development and testing.

    How do I get the avatars working? It keeps looking for them in the main domain.

    `function nfm_bp_avtar_upload_path_correct($path){
    if ( bp_core_is_multisite() ){
    $path = ABSPATH . get_blog_option( BP_ROOT_BLOG,

    ‘upload_path’ );
    }
    return $path;
    }
    add_filter(‘bp_core_avatar_upload_path’,

    ‘nfm_bp_avtar_upload_path_correct’, 1);

    function nfm_bp_avatar_upload_url_correct($url){
    if ( bp_core_is_multisite() ){
    $url = get_blog_option( BP_ROOT_BLOG, ‘siteurl’ ) .

    “/wp-content/uploads”;
    }
    return $url;
    }
    add_filter(‘bp_core_avatar_url’, ‘nfm_bp_avatar_upload_url_correct’,

    1);`

    I tried the above with no luck.

Viewing 2 replies - 1 through 2 (of 2 total)

  • @mercime
    Participant

    @mercime

    The above old code is for multisite, while your install is not one per your first post.

    == It keeps looking for them in the main domain. ==

    I have one test site in physical subdomain and have no problems with avatars
    – WP/BP versions?
    – Are you using bp-default theme?
    – Installed WP in root of subdomain?
    – Installed WP via fantastico or simplescripts etc? Ditch that and start from scratch and do manual installation – FTP/cpanel upload, etc.
    – Is GD library installed in your server? What kind of server are you on?

    I fixed it. I just went into the WP options in the admin (wp-admin/options.php) and changed everything that was mydomain.com to dev.mydomain.com. I think the upload path was the key.

    I guess a search and replace in the phpmyadmin would have also worked but this was less risky.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Avatars Not Working With Subdomain’ is closed to new replies.
Skip to toolbar