Create detect-element-place-elsewhere-in-dom

Background: 
   I had a client site, very large, tens of thousands of posts archived. They write posts via a WYSIWYG in WP. In the redesign, the headline and the photos had to line up, but not all posts have a photo, some have a YouTube or Vimeo embedded, so blanket style rules are out the window.

In addition to that, not all the pictures are the same height, affecting the styles I was trying. Also, Long or short H1s affected the styles. Floats, positioning, and display rules alone weren't cutting it.

When I repositioned the image above the H1 in these posts, however, I could write style rules that got the job done every time.

So the solution had to be twofold, detect posts with an image on the home or archive pages, add custom styles to both the H1 and <p> that contains the <img>.

Then, switch the order of the <h1> and first <p> (with the images) in the DOM.