Support » Fixing WordPress » What's the WP variable to access the uploads folder?

  • 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

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    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…

    adsitus

    (@adsitus)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What's the WP variable to access the uploads folder?’ is closed to new replies.