=== Media focus point === Contributors: wpcompany Tags: image, video, focus point, focal point, focus, focal Requires at least: 6.0 Tested up to: 6.7.1 Requires PHP: 7.4 Stable tag: 1.2 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Media focus point Plugin allows you to set a focus point on an image or video background, ensuring that when the image is resized or its background changes, the selected focus area remains centered and visible. It provides a seamless way to keep important parts of an image or video in view, regardless of screen size or layout adjustments. See the plugin in action on [WP Company](https://www.wpcompany.nl/ "The WordPress specialist") == Description == This plugin helps you manage image and video backgrounds by enabling you to set a specific focus point. When the image or video is resized or its background changes, the focus point ensures that the selected area remains visible and centered. Whether you're working with responsive layouts or dynamic backgrounds, this plugin helps maintain visual consistency, making sure important parts of your media are always in view, no matter the screen size or resolution. == Frequently Asked Questions == = How do I set a focus point? = When you upload an image or video, the default focus point is centered. To change this, follow these steps: 1. Upload your image or video: After uploading, you’ll see the standard focus point set to the center of the media. 2. Edit the focus point: Below the alt text and description fields, you’ll find an option labeled Focus Point. Click on this the 'Change' button. 3. Select the focus area: A preview of your image or video will appear. Simply click on the part of the image or video you want to focus on. The plugin will visually mark the selected focus area. 4. Save your selection: After selecting the focus point, click Save. The plugin will record your choice. 5. Adjust percentage: Once saved, you will see two percentage fields: one for the horizontal and one for the vertical focus point. These percentages represent the exact position of your selected focus area relative to the image’s dimensions. 6. No additional save required: Once the percentages are set, the focus point is automatically applied, and there’s no need to save the image itself again. The focus point will now remain centered on the selected area as the image or video resizes, ensuring the most important parts are always visible, no matter the screen size or layout changes. = Is this plugin compatible with all themes? = Yes, the plugin is designed to be compatible with most WordPress themes that use image or video backgrounds. If you encounter issues, please reach out to our support team. = How to use the image in my custom template? = To display an image in your custom template with the focus point applied, you can use the following code snippet: Most WordPress themes already use this standard WordPress method to render featured images. For featured images (post thumbnails): `` For images from Advanced Custom Fields (ACF): `` The plugin automatically adds an inline style attribute to the image element, such as: `style="object-position: 50% 38%;"` To ensure the image fills its element while maintaining the focus point, use the object-fit property in your CSS. For example: `img { height: 300px; width: 100%; object-fit: cover; }` == Screenshots == 1. This screenshot shows how to set the focus point for an image or video. 2. This screenshot demonstrates the image resizing while keeping the focus point centered. == Changelog == = 1.2 = * Added i18n support = 1.1 = * Replaced jQuery with vanilla JavaScript for improved performance and compatibility. * Added the ability to set a focus point on video backgrounds. = 1.0 = * Initial release with the ability to set a focus point on image backgrounds. == Upgrade Notice == = 1.0 = This is the first stable version of the plugin. Upgrade to enjoy the full functionality of setting and maintaining focus points for media backgrounds.