WordPress.org

Ready to get started?Download WordPress

Forums

can't search in media library (17 posts)

  1. gpuertas
    Member
    Posted 4 years ago #

    i dont know why, but i cant do searches in the media library i always get

    "No media attachments found."

    i tried using the title, the filename, wildcards, etc.
    even when i search for pictures that i uploaded 2 minutes ago, nothing.

    my db of images is growing really quick and it's becoming unmanageable

    any ideas ?

  2. robrat
    Member
    Posted 4 years ago #

    That's strange. When you navigate to the media library, are the images there at all, and just not showing up in search? Or are they not there at all?

    If the latter, check in settings > Media, where your files are being uploaded, and navigate to this location through your FTP and see if they're there?

  3. gpuertas
    Member
    Posted 4 years ago #

    Yeah, the images are there when i navigate, they are just not showing up in search :(

  4. gpuertas
    Member
    Posted 4 years ago #

    anyone ? please ? :)

  5. Seijun
    Member
    Posted 3 years ago #

    I have this same problem! Say I have the image "taz1.jpg". Searching for "taz" or even "taz1" returns "No media attachments found."

  6. davedg629
    Member
    Posted 3 years ago #

    Same problem, first noticed when I was using WP 3.0.3. Just upgraded to 3.0.4 and still not able to search the media library.

  7. C W
    Member
    Posted 3 years ago #

    I have the same problem: all the images are there, but the search box is non-functional. I haven't installed any new plugins or anything. It was working fine until very recently, and then the problem just randomly sprung up.

    I've also attempted to deactivate/reactivate plugins, just to be sure. But none of them seem to be responsible: even when all the plugins were deactivated, the same failure occurred.

  8. C W
    Member
    Posted 3 years ago #

    Sorry to double-post but I can't edit again. I've switched to TwentyTen and it turns out it's specific to my theme. However, I haven't the foggiest idea how to correct the problem now that I know it's something to do with the theme...

    EDIT: Gee my face is red. Turns out it was a rogue entry in my functions.php file. :P

  9. maorb
    Member
    Posted 3 years ago #

    @Cyril Washbrook - What rogue entry was in your functions.php file?
    I've just encountered this problem too, and when switched to twentyten it was ok, so I guess it is also something in my theme, but I cannot figure what...

    Any ideas what code can generate this issue?

    Thanks

  10. maorb
    Member
    Posted 3 years ago #

    Ok, I found the problem in my theme, maybe it might help others, so I post my solution..

    I added a function to limit search results to posts only, by setting the
    $query if is_search..
    So, it has been applied in the admin panel also, and limited the media library search to posts only, and ofcourse there are no posts in the media library, only attachments...
    The solution was to wrap the search limit with an if statement -

    if (!is_admin())	{
    // some code
    }

    is_admin is true on admin panel and false on front end.

  11. mcmarti
    Member
    Posted 3 years ago #

    I've never posted on here before usually use it more for reference, just wanted to say thankyou to maorb as i have been looking for this exact fix for a while, thought he should receive some credit for it!

  12. maorb
    Member
    Posted 3 years ago #

    Thank you mcmarti :)

  13. mongkolbest
    Member
    Posted 3 years ago #

    where to put

    if (!is_admin())	{
    // some code
    }

    i got the same error and i dont know how to add it.

  14. Rindy Portfolio
    Member
    Posted 3 years ago #

    The Hotfix plugin may resolve this issue. Worth a try.

  15. mongkolbest
    Member
    Posted 3 years ago #

    Portfola

    thank you very much

    !!!!

    :D

  16. deanbolton
    Member
    Posted 3 years ago #

    I too have signed up just so I can say... thank you maorb! This has been driving me nuts (for a while). Glad I found this thread and your solution.

  17. Alkorr
    Member
    Posted 3 years ago #

    maorb's solution sounds great but I don't understand where I should add that code, in which query/files in my theme?

    Thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic