Title: Different HTML being generated for same post &#8211; intermittent
Last modified: April 6, 2018

---

# Different HTML being generated for same post – intermittent

 *  Resolved [dccharron](https://wordpress.org/support/users/dccharron/)
 * (@dccharron)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/different-html-being-generated-for-same-post-intermittent/)
 * 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).](http://jag.org.au/wp-content/uploads/2018/04/Display-of-Post-in-Chrome-showing-image-appearing-in-the-wrong-place.jpg)
   
   2- [Screenshot of the post as refreshed (the correct view).](http://jag.org.au/wp-content/uploads/2018/04/Display-of-Post-in-Chrome-correctly-displayed.jpg)
   3- [Screenshot of editing the post showing that there is no “featured image”.](http://jag.org.au/wp-content/uploads/2018/04/Screenshot-Showing-that-this-Post-has-no-Featured-Image.jpg)
   4- [HTML (excerpt of the relevant part) the faulty view.](http://jag.org.au/wp-content/uploads/2018/04/Source-HTML-for-the-faulty-view-of-post.txt)
   5- [HTML (excerpt of the relevant part) after refreshing (correct view).](http://jag.org.au/wp-content/uploads/2018/04/Source-HTML-for-the-correct-view-of-post.txt)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdifferent-html-being-generated-for-same-post-intermittent%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [dccharron](https://wordpress.org/support/users/dccharron/)
 * (@dccharron)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/different-html-being-generated-for-same-post-intermittent/#post-10180981)
 * I think I’ve resolved this problem myself. I found a useful link on github:
    
   [https://github.com/presscustomizr/customizr/issues/815](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.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

## Tags

 * [featured image](https://wordpress.org/support/topic-tag/featured-image/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * 1 reply
 * 1 participant
 * Last reply from: [dccharron](https://wordpress.org/support/users/dccharron/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/different-html-being-generated-for-same-post-intermittent/#post-10180981)
 * Status: resolved