Specify Relative location of images - wordpress

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.

Related

WordPress: Images and other assets not loading on localhost

First of all, a cordial greeting, friends! I have a problem, I am working with the design of a web page using WordPress via localhost with XAMPP. I have tried to view the project from different devices (cellphones, tablets) and by configuring the file httpd-XAMPP.config I have managed to enter the address correctly of the project.
The problem is that no image, icon, or logo that I have placed on the page loads (as seen in the attached image), the menu button does not work either.
With nothing more to add and thanking you in advance for any help you can provide, I say goodbye.
Have you checked the image path to see if it's correct?
Are you able to access the image from the full path in a browser for example
domain.com/wp-content/uploads/image.png like this?
Probable solution 1:
Most of the cases, it can be the permalink issue.
Please try to check by changing the permalink, first make it Plain Text and check, if it's not working then make it Post Name and then check. (To do it go to Admin dashboard > Settings > Permalink)
Probable solution 2:
Sometimes, if the image and CSS do not exist in the correct location then happen this kind of issue. Please check it.
Probable solution 3:
Put it in the config.php file
define('WP_HOME','yourdomain.com');
define('WP_SITEURL','yourdomain.com');
Thank you

How to set Plugin Header image on wordpress.org

I have developed a plugin for school project to parent login/register and uploaded on WordPress plugin directory, but i am not able to sat banner image on top.
Please guide me if have any idea.
Please check this link. You will find your solution.
Source: https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/
To Add a Plugin Header Image:
Make a 772×250 pixel JPG or PNG image file. (No animated GIFs. :) )
Check it in to your plugin’s SVN directory with the path assets/banner-772x250.(jpg|png). Note that the assets directory is added to your plugin’s root directory, not trunk.
On the next plugin directory refresh (every 15 minutes or so) you should see your image start showing up on the page.
For an example of this in action, check out Hello Dolly or Pluginception for HiDPI action.
You can also make larger images, which will be used on high-DPI displays (aka ‘retina’). To do so, make a second image with the size of 1544 pizels wide and 500 pixels high. This file will be named assets/banner-1544x500.(jpg|png). Note that you can not make this image alone, it only works as an “add-on” to the 772×250 image, because this larger image is only used on displays that can show the higher detail.
To add a plugin header image in the new directory:
Make a 1880×609 pixel JPG or PNG image file. (No animated GIFs. :) )
Check it in to your plugin’s SVN directory with the path assets/banner-1880x609.(jpg|png). Note that the assets directory is added to your plugin’s root directory, not trunk.
On the next plugin directory refresh (every 15 minutes or so) you should see your image start showing up on the page.
Unlike the old plugin directory, no other plugin banner is required.
Another thing to consider is the case for the international plugin directories. Some of these, like Hebrew and Arabic, use Right-To-Left languages. In these cases, the title will be overlaid on the right hand side of the image, not on the left side. Generally it is best to design your banner such that the title can be in either position. However, this may not work with all designs, so if you need to have a different image for RTL pages, then you can do so. Make the images in the same way as before, but name them with -rtl appended to the name. So an RTL banner would be named assets/banner-772x250-rtl.(jpg|png) and assets/banner-1544x500-rtl.(jpg|png) or assets/banner-1880x609-rtl.(jpg|png) for the new directory. On RTL pages, if these images are available, then they will be displayed instead.
After you check in your new banner(s), it will appear the next time the plugin refreshes itself in the directory. This may take a few minutes.
For development and testing, you can add a URL parameter to your plugin’s URL of ?banner_url=A_URL_TO_YOUR_IMAGE to preview what the page will look like with your own image. This will only work with your own plugins; you cannot use this parameter on anybody else’s plugins.

WordPress page broken image paths

I made a WP page a while ago (not for me) and all of a sudden most images can't be displayed ...
I took a look into html code and saw that the img paths are all wrong!
Those workig look like: http://www.niebauer.co.at/wp/wp-content/uploads/2013/04/senato-tasse-178x108px.jpg
The ones that DO NOT work: /usr/local/www/apache22/data/niebauer/www.niebauer.co.at/htdocs/wp/wp-content/uploads/et_temp/cool-2015-9941_165x184.jpg
I have NO idea why WP all of a sudden changed those paths. I tried to REUPLOAD some images but it seems, wp does this automatically "wrong". The only working solution I found was to upload them in the EXACT size they will display on the page. So I guess something is wrong with the WP asset manager but I did not change anything.

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...

Wordpress - Images not showing up in the Media Library

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.

Resources