WordPress.org

Ready to get started?Download WordPress

Forums

What's the WP variable to access the uploads folder? (4 posts)

  1. OM2
    Member
    Posted 2 years ago #

    What's the WP variable to access the uploads folder?

    What want is to assign images for a theme to be in the uploads directory - something that can be accessed through the media uploads in WP control panel

    What I want to allow is to let the user access this and change images for the theme

    Currently I have:

    <?php bloginfo('template_directory'); ?>/images/myimage.jpg

    What's the equivalent function/var that gives me access to the uploads directory?

    Hope that makes sense!

    Thanks

    Omar

  2. OM2
    Member
    Posted 2 years ago #

    OK... I found my answer: <?php $upload_dir = wp_upload_dir(); ?>

    But, the thing is, I can only access images that I upload through WP
    If I add an image through FTP, I can't see these

    And is there anyway of arranging the directories into which things get uploaded to?

  3. Eci-ww
    Member
    Posted 2 years ago #

    I've uploaded my images through ftp as well, and I can't see them in the library. They are showing up though on the site, but they're just not *there* in the library. Strange.

    I can't really answer your question, just wanted to mention the above...

  4. adsitus
    Member
    Posted 1 year ago #

    It's not strange that if you upload images through FTP they won't show up on wordpress' media library.

    When you upload through FTP you're not "telling" wordpress you've uploaded an image, which is what you do when you use wordpress' web interface. WordPress doesn't know that image exists, so of course it won't show up on the library.

    What you would need is a plugin that would scan the uploads folder, check for files that are NOT referenced in the image library, and then add those to the library.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.