briavers/image-bg-position

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

Installs: 55

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:wordpress-plugin

pkg:composer/briavers/image-bg-position

1.1.1 2025-10-16 09:41 UTC

This package is auto-updated.

Last update: 2025-12-16 10:02:45 UTC


README

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>