WP Manifestindependent plugin directory
manifest / media / image-bg-position

Image Bg Position

Expand the media library to allow you to set a focal point

★ 0stars
380composer installs

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/briavers/image-bg-position/archive/refs/heads/master.zip

On Packagist as briavers/image-bg-position:

composer require briavers/image-bg-position
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Wordpress image Position

Expand the media library to allow you to set a focal point, which can be used to display an in image in cover while maintaining the needed parts.

Installation

Add the plugin to your plugins folder

Usage

<div class="team__member__header">
    @php
        $focalPoint = get_post_meta($item->image->id, 'bg_pos_desktop');
    @endphp
    <img
        src="{{ $item->image->url }}"
        srcset="{{ $item->image->srcset }}"
        alt="{{ $item->image->alt }}"
        style="{{ $focalPoint ? "object-position: {$focalPoint};" : '' }} {{ $objectFit ? "object-fit: {$objectFit};" : '' }} "
    >
</div>