Wordpress - Images not showing up in the Media Library - wordpress

I have a huge problem with my Wordpress. My uploaded images don't list in the Media Library.
It is weird tho, it says I have 75 images, but display none. Take a look yourself.
Even weirder, if I go into gallery (the images you uploaded in the page itself), the images list just fine.
I already tried deactivating all my plugins, didn't work. Cache can be easily put out of the question, because it happened on at least 4 different computers, with Macs, PCs, and navigating with Safari, Firefox and Chrome.
Another interesting fact is that if I upload the image directly trough the computer (with the "From Computer" tab), everything goes fine. Another website on the same server works just fine too. And just to add to the complexity, when I go to the media page in the Wordpress Admin, all images show up just fine.
Oh, and before I forget... applying any filters, or doing a research in the media will always come up with the same problem.
So there... that's where I'm at.

I had a same problem just now, with missing media library images for my blog. The images appeared to be right there in the media library and were definitely on the actual web server (checked via FTP).
As Allen Z advised I did "check Settings → Media and make sure that Uploading Files folder is set to wp-content/uploads"
Mine were set to the default blank. I altered this to an absolute path http://www.example.com/wp-content/uploads
THIS DIDNT SOLVE THE PROBLEM when I refreshed the site in browser. However, I immediately changed the path back to blank (the default setting again) and everything came back! Woop
Everyone having this problem might want to try this before getting into the more technical fixes!

it was your permalinks... you must have changed to labeled-name... switch back to default.
that worked for me.

Check Screen Options (dropdown tab in the upper right hand corner of the page), and make sure there are sane settings for what to show on screen. All the column settings should be checked, and there should be a positive number of media items being shown on screen.
If that is ok, then check Settings → Media and make sure that Uploading Files folder is set to wp-content/uploads.
I believe these are the only settings that can be changed from the administrative screens.

Here's something a guy on Wordpress forum showed us. Add the following to your functions.php file. (remember to create a backup of your functions.php first)
add_filter( 'wp_image_editors', 'change_graphic_lib' );
function change_graphic_lib($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
...it was that simple.

Well, Seems like there was a bug when creating custom post types in the function.php file of the theme... which bugged that.

I had this problem with wordpress 3.8.1 and it turned out that my functions.php wasn't saved as utf-8. Re-saved it and it

I faced same issue on my wordpress site. After the lot of debugging i fixed my problem step by step like this.
First add given below code your db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then goto /wp-includes/js/wp-util.js files and find the code $.ajax(
options ) on line number 100 insert given below code into your file
deferred.jqXHR = $.ajax( options ).done( function( response ) {
try {
response = JSON.parse(response);
} catch (Exception) {
response = response;
}
Please check your may be resolved.
if you Removed constant from db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then compress your /wp-includes/js/wp-util.js file code and put your compressed code into /wp-includes/js/wp-util.min.js
*change your own risk if your update your wordpress version your changed may be lost.

Did you ever change the directory of your Wordpress install?
I had a problem with not finding my uploaded images after changing the Wordpress location on my server. In Wordpress, I went to Dashboard-> Settings -> Media and changed the uploads folder in the "Store uploads in this folder" field.

Considering the files were not uploaded via media uploader, they are present in the server but there's no reference to them in your database (in a little more detail).
In order to fix it, install the Media Sync plugin. Once it's active, under Media > Media Sync > Scan Files and select the files you want to import by click the checkbox next to them. Make sure also you untick the selectbox Dry Run (test without making database changes).
Then, when the time comes for you to be ready, just click "Import Selected" and you should see something like this
Once it is finished, you can visit Media > Library and you'll see all your imported files there.

How did you upload those images; via FTP or through WP uploader? You have to upload images THROUGH WP uploader in order to show them in the image library.

Ubuntu stores uploads in /var/lib/wordpress/wp-content/uploads . So what you need is to have this directory within your wordpress installation. Something like:
sudo ln -s /var/lib/wordpress/wp-content/uploads /var/www/www.mysite.com/wp-uploads
(replace mysite.com with your domain, the file should exist) should do the trick.
(Note that I've not tested this with multiple wordpress installations on one server.)
Further note that to make upload work at all (but this wasn't the question), you need to change Settings / Media / Store uploads in this folder to
wp-content/uploads
(no leading slash).

check .htaccess file in root of wordpress, maybe there is a rule for /uploads directory.
if so, remove it. but be careful and check which plugin did it, so disable the plugin, first.

Related

How to restore WordPress theme style,css from caches on internet

I deleted mistakly my child theme in wordpress site.
Is there any way I can get CSS contant somewhere cached over internet?
I accidentally wiped a CSS file, the website was still cashed so I inspected one of the elements and viewed the cached css resource and copied it from there.
If you were using Chrome, and had open the style.css file at least once then you may use this method to recover the cache:
chrome://cache/
You will get all the list of cached data there. Then ctrl+f to find the style.css for the same.
Once you find it. Copy all the data => Go Here and paste it in the text box.
See if it works.!
or you can try to open cache:domain.com as well.

Display images in template file

I have one template file for the main page, after creating home page I have added text to check if it reflect changes on my home page or not and it was successfully displaying text. But when I try to add image by clicking on add media option then image is uploaded but not displaying on my page. What piece of code should be used to get this image on my template file or any other suggestions?
i'am pretty sure u need to SETUP CHMOD to 744
because its randomly set to 600.
This means it is not public visible.
1.You just need to get an FTP Programm,
2.Connect to your Webspace,
3.Go to your Uploadfolder,
4.Choose Your Image to Show with an RightClick,
5.and set CHMOD to 744.
I'll show u here (FLASHFXP)
(Attribute set = READ)
I need to do this for every picture, so u will need to do it too.
Okay i didnt knowed that ;)
You can also try to set the file permissions via rightclick on the File in your Windows-System.
Like This:
http://i.imgur.com/wBptC7s.png
make sure you have Admin-Privileges and the File is allowed to be read, change and execute, then it should work.
There is another Option
i recommend to Setup Wordpress to "DONT SORT UPLOADED FILES" to seperate folders like "per month", "per year" and this kind of Stuff, its better to have them Uploads all in ONE-Directory.(Thats my experience)
In the past i also had my Problems with the Uploads, and it all occurred just because of the "Multiple Folder Uploads" that Wordpress makes.
To change that go to:
Settings -> Media -> Sort Uploads by...
I recommend you to get a Free-Webspace for testing purposes, in my opinion its more comfortable to work online, and you can access it from everywhere you are :) Work never stops
you can add any custom field with this module https://wordpress.org/plugins/advanced-custom-fields/. And can easily add it to your pages and posts.

Specify Relative location of images

Some fun stuff happened this morning at work. We don't have a backup for our Wordpress site and a user updated the theme. We are using Atahualpa 3.7.12 and upgraded to 3.7.14. Soon after the update, the images were lost and started displaying some default ones.
My images have this form
http://<website>/wp-content/uploads/2013/06/Tractor.png
http://<website>/wp-content/uploads/2012/05/home-header.png
but when I look in the debugger I see it points to
http://<website>/wp-content/themes/atahualpa/images/2013/06/Tractor.png
I have no experience with Wordpress and trying to restore the images. I am looking at
Atahualpa Theme Options -> Image Location -> Relative location of images which has the Default.
I changed it to the following:
Relative location of images? wp-content (which is the only other option in the dropdown)
Images Directory to uploads but the image is still not showing up.
Can someone please help?
One thing to try is resaving permalinks. Goto Settings >> Permalinks and hit save. Sometimes resaving these helps. Not a guaranteed solution here, but worth a try.
Alternatively, after playing with the settings in Atahulpa Theme Options you should go to your site to one of the pages that has missing themes. Using Google Chrome, right click the image and hit Inspect Element. This will show the HTML for the path that is is trying to point to. You can then see if your settings in theme options is getting you anywhere.

NextGEN Gallery still pointing to local drive

I recently moved a wordpress site from my C: drive to a pre-production environment, linux-based machine. The site works well-ish now.
I am using NextGEN galleries there and am using custom gallery theme. This is the problem: After moving, for some reason the galleries refer to the gallery with absolute path of the C: drive, which is obviously not working since this is another machine. I looked into the database to see if there's any value starting with C:\ and indeed I found out several of them and corrected them from C:\xampp\htdocs/wp-content/themes/subspace\nggallery\gallery-subspace.php to wp-content/themes/subspace\nggallery\gallery-subspace.php. However, after refreshing the page which used the gallery in WYSIWYG editor of WP and checking its settings, it stil referred to the template on the C: drive (namely, this is on the "display galleries tab", under "Customize the display settings", it is the value of the "Template" setting).
I checked the database again and there was no path like this in it. I refreshed the page, no difference. I got irritated and went to get a cup of coffee. When I returned, I ran the database query without any modifications again and found this in the wp_options table, option name "_transient_e4ae686b7454a142b0618b1ff15b38f4":
O:8:"stdClass":17:{s:2:"ID";i:4018;s:13:"post_password";s:0:"";s:10:"menu_order";i:0;s:16:"display_settings";a:20:{s:27:"override_thumbnail_settings";s:1:"0";s:15:"thumbnail_width";s:3:"120";s:16:"thumbnail_height";s:2:"90";s:14:"thumbnail_crop";s:1:"1";s:15:"images_per_page";s:2:"24";s:17:"number_of_columns";s:1:"0";s:15:"ajax_pagination";s:1:"1";s:20:"show_all_in_lightbox";s:1:"0";s:23:"use_imagebrowser_effect";s:1:"0";s:17:"show_piclens_link";s:1:"0";s:17:"piclens_link_text";s:14:"[Show PicLens]";s:19:"show_slideshow_link";s:1:"0";s:19:"slideshow_link_text";s:16:"[Show slideshow]";s:8:"template";s:73:"C:\xampp\htdocs/wp-content/themes/subspace\nggallery\gallery-subspace.php";s:19:"use_lightbox_effect";b:1;s:23:"display_no_images_error";i:1;s:18:"disable_pagination";i:0;s:17:"thumbnail_quality";s:3:"100";s:19:"thumbnail_watermark";s:1:"0";s:20:"ngg_triggers_display";s:5:"never";}s:8:"order_by";s:9:"sortorder";s:15:"order_direction";s:3:"ASC";s:10:"exclusions";a:0:{}s:13:"container_ids";a:1:{i:0;i:37;}s:22:"excluded_container_ids";a:0:{}s:9:"sortorder";a:0:{}s:10:"entity_ids";a:0:{}s:7:"returns";s:8:"included";s:20:"maximum_entity_count";s:3:"500";s:6:"source";s:9:"galleries";s:12:"display_type";s:35:"photocrati-nextgen_basic_thumbnails";s:4:"slug";N;s:8:"id_field";s:2:"ID";}
Which, as you can see contains the C:\ path again. I'm 100% positive this wasn't in the database a while ago and repeated the process with the same result (corrected this, waited a minute and it appeared again). Is it possible that this is pulled e.g. from some file?
You can follow the steps mentioned below:
In the wp-admin, go to "Gallery" -> "Other options" then, Click to "Lightbox effects" tab and Click "Show advanced settings" there, you'll find option to change the stylesheet and javascript urls. Change from 'localhost' to your baseurl or ( 127.0.0.1 ). Then save. Thats all.
Let me see if i can help.
Warning : do not try on production, get a dev or appropriate local version running. Also -- can't remember using NextGen, so my advice comes from a desire to do "best" practice in WP.
Easy try : kill cache if used such as JetPack or similar.
Regrading the _transient - should be able to kill -- this link Can I remove transients in the wp_options table of my WordPress install? seems to be dialed in. So if there is a cached element in the mix...bingo.
Next thing is the C:\...stuff rendered in the page source / html? If so, how is it rendered in the page (HTML please)? In other words, what part of the execution is writing C:\... to the page and why? WP has a bad habit of adding the site to the link (grr!). For example image src attribute will have the ``http://``` :
<img src="http://example.com/uploads/whatev..."
And this is written in the wp_posts table (fun migration issues esp if you change url) - so there is a slim possibility that the gallery info with the C drive ref is in the post or similar.
iD10t check: no config setting you missed in gallery? I hope there is not a 3rd party server/storage as #Hareesh mentioned!
Desperation (done this a few times) : dump the MySQL, get a large text editor and search for the string. Remember that weird stuff could be escaped as a " may turn into \" or the use of alternative "safe" quotes. See what can be learned.
Always an option : reinstall in a new WP site and see what/how things go.
If I think of anything else I will add it, but I just spilled how I would try to dissect the issue. GOOD LUCK.
You can use a search and replace tool to replace all C:/... instances with the correct ones.
But be sure to make a full DB backup beforehand, in case something breaks...

Drupal Imagecache not working

I created an Imagecache setting that just resizes to 125px wide. First issue is that the preview image is 404.
Then I want to print out an image via
<?php print theme('imagecache', 'imported_image', $node->picture, 'test', 'test', $attributes); ?>
'imported_image' being the preset and $node->picture is a correct path. The html prints out ok but the path it's trying load the image from does not exist. In sites/default/files/imagecache there is no folder with the name of the preset. Flushing the preset does nothing. The imagecache folder is writeable by everyone. This is on MAMP.
Anyone know what the issue could be?
Imagecache does not work when friendly url's are off. If this is the case, it can not 'find' the path to its folder in sites/default/files. When I turned them on, the folder with the name of the setting was created ok. The Imagecached images don't appear in here though. I'm putting it down to switching dev from Win to Mac, as a few people suggested on the Drupal forums.
posting last comment as an answer for ease in finding
Try to enable Lighttpd's "url.rewrite-if-not-file" directive
I posted it right here:
http://www.warp1337.com/content/solved-lighttpd-drupal-7-imagecache-images-are-broken-errorhandler404

Resources