The images used in the Open Graph meta tags for Posts and Pages are chosen in this sequence:
- An image defined in the Post or Page NGFB Social Settings metabox (Pro version).
- E-commerce product image(s) (Pro version).
- A featured or attached image from NextGEN Gallery or the WordPress Media Library (featured images are selected first).
- An image from the NextGEN Gallery ImageBrowser (in combination with an
- A preview image from a NextGEN Gallery
- Image(s) from expanded NextGEN Gallery
- Image(s) from
<img/>HTML tags in the content text (see following for details).
- A default image defined in the NGFB General settings page.
When NGFB gets down to scanning the content in #7, it looks for:
- NextGEN Gallery <div|a|img/> HTML tags with the ‘data-ngg-pid’ or ‘data-image-id’ attribute.
- <img/> HTML tags with the ‘data-wp-pid’ attribute.
- Any other <img/> HTML tags with a ‘src’ attribute, and checking the image URL, it also tries to match a pre-v2 NextGEN Gallery image ID.
All of these methods will lead to a properly sized image of the correct dimensions (since the image ID can be determined), provided the original image is large enough. Always upload the largest images you can to the Media Library and/or NextGEN Gallery, and let WordPress create the re-sized / smaller versions as required. If an original image is smaller than the required Image Dimensions, it will be ignored by the plugin – so always upload the largest images possible.
The plugin also looks for any <img/> HTML tags in the content that have a a ‘width’ and ‘height’ attribute larger than the Image Dimensions setting.
A Note About Image Dimensions
NGFB provides several Image Dimension options, depending on the intended use for the image (Open Graph meta tags, various Twitter Card formats, etc.). The Image Dimensions should always be chosen for their intended use. For example, Open Graph meta tags are read by Facebook, Pinterest, Google+, LinkedIn, and others. Facebook has published a preference for images measuring 1200x630px, but horizontally cropped images may not show as well on Pinterest. A good compromise for your Open Graph Image Dimensions is 1200x1200px cropped. If you use these dimensions, make sure your original images are at least 1200px in both height and width.