WordPress.org

Ready to get started?Download WordPress

Forums

Installed in subdirectory - now double folder reference in media library (5 posts)

  1. Llasse
    Member
    Posted 3 years ago #

    I have installed WordPress (with P2 theme) and some other Plugins in my root.com/blog/ folder. After fixing design etc., I wanted to make it accessible via root.com so I did what the tutorial told me to do (e.g. this: http://askwpgirl.com/how-do-i-move-wordpress-from-a-subdirectory-to-the-root-directory/) and everythings seems to works fine, EXCEPT:
    When I upload any images to my media library, there is a double-reference of the subdirectory when I access the little "popup" to Upload images while editing/creating an article.
    It gives a wrong URL to link to and also does not display (as img src shows to a wrong direction):
    http://root.com/blog/blog/wp-content/uploads/2010/11/mypicture.jpg

    Also, when I try to "insert" the picture to the article, it gives me the same problem.. and also an HTML-code (I remember WordPress to show it as an image..)

    It seems to be only the case, when using this "front end" media library, when I go over the Admin-Interface, everthing is put correctly..

    Any help?

  2. Llasse
    Member
    Posted 3 years ago #

  3. gixxer188
    Member
    Posted 3 years ago #

    What do you have for paths in the Settings, Media fields for Uploading Files?

  4. Llasse
    Member
    Posted 3 years ago #

    Settings:
    wordpress-adress: http://root.com/blog/
    blog-adress: http://root.com

    media library settings fields for uploading are both empty

    also, when i change the blog-adress to http://root.com/blog/ back again, it works again..

  5. Llasse
    Member
    Posted 3 years ago #

    I have fixed it for now, as I have commented the following line in

    /wp-content/themes/p2/inc/p2.php

    add_filter( 'wp_get_attachment_url', lambda( '$url', 'str_replace(get_bloginfo("url")."/", site_url("/"), $url);' ), 11);

    I don't really understand it, but I think it replaces the blogurl with the siteurl (which in my case has an extra /blog/ attached) so that it produces double /blog/blog/ whenever this is used..

    Maybe someone else has this problem and could be helped by this.. I will also report this thread to P2-developers..

Topic Closed

This topic has been closed to new replies.

About this Topic