Helping you Build Your Own Social Network!

Faster, better and easier!

Uploading different file types

(5 posts) (2 voices)
  • Started 8 months ago by yoursocialbox
  • Latest reply from yoursocialbox

  1. Hey I looked through the forums and found this code

    ("gallery_valid_file_extension_for_photo","my_custom_photo_extensions",20);
    function my_custom_photo_extensions($ext){
    return array("jpg","jpeg","png","gif","JPEG","JPG","PNG","GIF");
    }

    When I added it to my functions.php it doesn't work, and just adds the actual code to the top of my page... what am I doing wrong? :S

    Posted 8 months ago #
  2. Hi Chris,
    the first line should be

    add_filter("gallery_valid_file_extension_for_photo","my_custom_photo_extensions",20);

    and not
    '("gallery_valid_file_extension_for_photo","my_custom_photo_extensions",20);
    `
    Please try that.

    Posted 8 months ago #
  3. Okay, so I now added this

    add_filter("gallery_valid_file_extension_for_photo","my_custom_photo_extensions",20);
    function my_custom_photo_extensions($ext){
    return array("jpg","jpeg","png","gif","JPEG","JPG","PNG","GIF");
    }

    to functions.php, but it still comes up at the top of the page :/

    Posted 8 months ago #
  4. @sbrajesh with no change to anything else, any ideas? :)

    Posted 8 months ago #
  5. I figured it out :) I was putting the code in the functions of my theme, I didn't notice there was also a functions in the gallery folder :)

    There is still a problem though, (I'm guessing on this part), but when it gets to over 1000kb, it uploads the photo, and puts it in the uploads folder, but it doesn't actually show up on the website, or in any gallery, and it just says I haven't uploaded anything yet.

    The part I was guessing was when it reaches over 1000kb, as small files work, but when they get big, it doesn't work.

    So if you had any idea on that, I would be grateful :)

    Posted 8 months ago #

Reply

You must log in to post.