Forums

[resolved] get from "file" folder (5 posts)

  1. Digerzero
    Member
    Posted 4 years ago #

    Hello everybody, its my first time here and I need some help please :'(

    I need to take images from "upload files" directory, my solution was:

    <img src="<?php echo get_bloginfo('siteurl'); ?>/files/YEAR/MONTH/ImageIneed.thumbnail.jpg" width="XX" height="XX" alt="whatever" />

    But not always is going to be the same month and the same year I would like to know if exist a way to get the Image I need (will always have the same name and extension jpg) but is going to be uploaded in diferent times.

    I need soemthing like

    <img src="<?php echo get_bloginfo('files'); ?>/ImageIneed.thumbnail.jpg" width="XX" height="XX" alt="whatever" />

    is it possible?

    Thank you :)
    and sorry for my English.

  2. alexleonard
    Member
    Posted 4 years ago #

    Potentially go to Options > Miscellaneous and un-tick "Organize my uploads into month- and year-based folders".

    This I think will leave all your uploads in one folder.

  3. Digerzero
    Member
    Posted 4 years ago #

    Thank u so much alexleonard :)

    But I am working with a version that do not have that option (wordpress mu) which complicated a little bit everything :'(

    Does it have that option in another menu or submenu? I'm new in that wordpress version :0

  4. Digerzero
    Member
    Posted 4 years ago #

    Ok I found the solution, if you want to have a picture uploaded in differents blogs but with same name lets say: author.jpg and you want that each author upload its own picture you have to hack includes->functions.php
    Find these lines:

    $dir = $dir; // . "/$y/$m";
    $url = $url; // . "/$y/$m";

    and delete them because the y(year) m(month) is the problem then you have to put in your file, lets say you want it in header.php

    <img src="<?php echo get_bloginfo('siteurl'); ?>/files/author.thumbnail.jpg" width="XX" height="XX" alt="whatever" />

    Just in case someone need it :D...
    Bye...

  5. alexleonard
    Member
    Posted 4 years ago #

    Glad you got it sorted - didn't realise you were on Mu there (completely different story!)

Topic Closed

This topic has been closed to new replies.

About this Topic