• Resolved dccharron

    (@dccharron)


    Love this theme. Thanks again for all your fine work…

    I’ve discovered a ramdomly occuring problem when displaying posts. In some instances, the post is displayed as if it had a “featured image” despite the fact that there is no featured image. The image appears at the top of the post above the title. The image it uses is an edited version of the first image on the page.

    I’ve observed the problem on both Firefox and Chrome.

    When I “refresh” the browser, the “featured image” disappears and the post looks correct.

    This problem is intermittent but has been reported by my client. They too find that refreshing the page fixes it. Today, I too experienced the problem and captured some useful information. I’m hoping you can use this information to help identify the source of the problem.

    I’ve done a “view source” on both the faulty view and of the correct view. The HTML generated is quite different.

    To help you to identify the problem I’ve uploaded some images and text files as follows:

    1- Screenshot of the post showing “featured image” (the faulty view).
    2- Screenshot of the post as refreshed (the correct view).
    3- Screenshot of editing the post showing that there is no “featured image”.
    4- HTML (excerpt of the relevant part) the faulty view.
    5- HTML (excerpt of the relevant part) after refreshing (correct view).

    If you compare the two text files containing the HTML you can see the img tag in one (width 996) and that img tag is not present on the correct view. In other words the theme appears to be generating different HTML when displaying the same post and I don’t know why it would do that.

    Is there anything else you need to try to identify the cause of this condition? Just let me know.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter dccharron

    (@dccharron)

    I think I’ve resolved this problem myself. I found a useful link on github:
    https://github.com/presscustomizr/customizr/issues/815
    The problem seems to be related to a rather old bug (classic misuse of “==” instead of “=”) which, according to the aforementioned article had been fixed. But it clearly has re-appeared (at least intermittently).

    The cause is as follows:
    Apparently, in “Media”, each image has a status of “Uploaded to”. This status connects an image to a post. The status depends on how the image is uploaded. If it is uploaded via the “Media” menu => Add New, the image remains “Unattached”. But if the image is uploaded during the “edit” process of the post itself, the image gets “attached” to the post. That’s the first part of what was causing this problem. The “attach” status is visible in the “media” menu when viewed as a list (not as a grid).

    The second part it the way WordPress treats a post with no specified “Featured Image”. WordPress looks for any image that is “attached” to the post, and, if found, treats it as the posts “featured image”. In other words, the image becomes a default “featured image” for the attached post.

    In the “Customizr” theme, when specified, the featured image is displayed above the title of the post with a max height of 100px. The image is automatically stretched and/or cropped to 100px in height and is stretched to 1170px width. In my particular case, the post had an “attached” image. That “attached” image was treated as a “featured image”. In this case, the “attached” image was already 1170 wide but was 400 high. The cropping process in Customizr chopped off the bottom of the image before displaying it above the title.

    To solve my problem, I’ve used the “detach” link in the “media” list. The problem “seems” to be resolved (it hasn’t re-appeared so far). I’m hoping that’s because when “Customizr” doesn’t detect any attached image, it doesn’t display anything above the post title.

    While this correction should fix my problem, it doesn’t explain why, when I was experiencing the problem, the problem only appeared intermittently. That suggests there is still a bug to be found but I’ll leave that to others.

Viewing 1 replies (of 1 total)

The topic ‘Different HTML being generated for same post – intermittent’ is closed to new replies.