PHP code example of briavers / image-bg-position
1. Go to this page and download the library: Download briavers/image-bg-position library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
briavers / image-bg-position example snippets
bladehtml
<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>