• Resolved Helleshoj

    (@helleshoj)


    I have a post with some custome html and css pasted into the html view of the tinymce window. The post contains background pictures and pictures that float on top of it. These pictures are not in the upload folder, but nested in another folder inside wp-content.
    When showing the post, I see the background picture, which is linked to through css, but the pictures, which should be shown in the divs layered on top of that background are not shown. A test in Firefox for image details shows the correct path, but a size of 0k by 0k, resized.
    The images are all in the same folder, they are physically there, have a certain size and can all be opened with photoshop. The permissions on the images are also correct. Still seem not to ecist in that place, when the post is shown. The same goes for almost all other images on the page shown. There are images in the right sidebar, that show correctly on the home page, but not on the single post page.
    The sidebar is a php snippets file loaded in the primary widget.

    Site is to be a webshop with WordPress 3.6, woocommerce and some other plugins. Disactivating plugins does not show a change.

    There must be something I am missing, but I can not see what.

Viewing 8 replies - 1 through 8 (of 8 total)
  • A test in Firefox for image details shows the correct path, but a size of 0k by 0k, resized.

    Can you link to this image here?

    Thread Starter Helleshoj

    (@helleshoj)

    When using the “show image” link I just get a 404 error. The same content is used in the webpage which I have to convert to WordPress. There I have no problems showing the images. Also when using the php.snippet file displayed on the home page, the same pictures in the same folder show up as they should. But in the post and on the single post page no images. The content of the php.snippet file is the same as the html content of the post. The css is the same too.

    There I have no problems showing the images. Also when using the php.snippet file displayed on the home page, the same pictures in the same folder show up as they should.

    That means the images are already there but the sizes are incorrectly shown and they don’t appear at certain other places.
    Can you deactivate all plugins and revert to Twenty Twelve theme to see if the problem persists?

    Thread Starter Helleshoj

    (@helleshoj)

    When deactivating all plugins and using the Twenty Twelve theme:
    Same thing.

    But while previewing the theme, the images show up.

    As soon as I activate a theme, they do not show up. Themes checked are Twenty twelve, woothemes Canvas and my subtheme for Canvas.

    I think I am in on the problem now. A close read og the image information in Firefox shows, that the url for the images is written on the basis of the permantent link, which gets the category in the link like: “https://dev.domainname.dk/home/wp-content/include/snippets/presentation/images/hotel_ikon.jpg”, should be “https://dev.domainname.dk/wp-content/include/snippets/presentation/images/hotel_ikon.jpg”

    Seems I can not use relative links to show the path to these images, the way I have set up permanent links preferences, because WP uses that to write the entire link.

    Any suggestions for a work around?

    By the way, the image that shows up is a backgroud image linked to through css. That is also set as a relative link, but ittranslates correctly into “https://dev.domainname.dk/wp-content/include/snippets/presentation/images/bygning.jpg”

    (Can’t put in a link to show you, since this still only is on a local server).

    It looks like the images are in the wrong folder. They should have been in the uploads folder (wp-content/uploads/). Can you upload a new image and see to which folder it is uploaded?

    Thread Starter Helleshoj

    (@helleshoj)

    Does having the images in the uploads folder solve the problem with the permanent links? I would very much like to have the images in folders close to the inserts I use. The uploads folder to me always seems a mess, where no pictures can be easily found. Also I do not want all the different sizes on images, which never will be used in more than one size. To keep trace of images used in different parts of the site I want them there, where the inserts are.

    Is there a way to ensure the relative path is translated into the correct path to the image – without changing the permanent link structure? For SEO purposes I want the category name in the permanent link, but that is, what creates the problem here, ABSPATH or __FILE__ or something like that?

    Thread Starter Helleshoj

    (@helleshoj)

    I found a solution: In the php snippets I use `$sti=get_bloginfo(“siteurl”);
    $prelink=$sti.”/”;`
    to determine the webpage’s actual location, echo this in all image links <?PHP echo $prelink; ?>wp-content/include …
    That way I still keep my “relative” link and can work with the same code on different servers and I tell WP where to find the images, which are outside the uploads folder.

    Thread Starter Helleshoj

    (@helleshoj)

    I think that does it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Problems showing images’ is closed to new replies.