Description
- Portfolio pages have no categories and Summary Blocks can’t pull from a Portfolio, so there is no native way to show related projects. This code adds them below every project: put a small Code Block with
data-categoryin each project, and it shows up to 4 other projects from the same category. This version uses a 4-column grid of image cards, with the title, excerpt and category labels over a dark gradient, under a heading like “Others from Branding”. - buy me a coffee

#1. Install Code
#1.1. Use this code to Portfolio Page Header Injection
<!-- 11.26c14v15 Portfolio: “Others from Category” Grid – Full-Image Cards in 4 Columns -->
<script>
window.portfolioRelatedOptions = {
headingText: 'Others from',
headingTag: 'h2',
headingSpaceBelow: '30px',
showArrow: true,
arrowSize: '56px',
arrowSizeMobile: '34px',
sectionSpaceAbove: '60px',
sectionSpaceBelow: '60px',
postLimit: 4,
columnsDesktop: 4,
columnsMobile: 2,
itemSpace: '2vw',
itemSpaceMobile: '12px',
itemHeight: '370px',
itemHeightMobile: '240px',
itemPadding: '40px 25px 30px',
itemPaddingMobile: '20px 15px 15px',
itemBackgroundColor: '#f4f4f7',
imageRadius: '33px',
imageRadiusMobile: '25px',
overlayColor: 'rgba(0,0,0,0.35)',
overlayStyle: 'gradient',
textColor: '#ffffff',
titleSpaceBelow: '10px',
showExcerpt: true,
excerptSpaceBelow: '15px',
showLabels: true,
labelLimit: 3,
labelGap: '6px',
labelPadding: '2px 10px',
labelBorderRadius: '100px',
labelBorderWidth: '1px',
labelBorderColor: 'rgba(255,255,255,0.8)',
labelFontSize: '12px'
};
</script>
<script src="https://code.beaverhero.com/portfolio/1126c14v15relatedportfoliov60.js"></script>

#1.2. Edit each Portfolio Item > Add a Code Block with syntax like this
<div data-category="Creative" data-excerpt="A warm lighting concept that blends soft glow with minimal interior details."></div>

#2. Customize
To change related heading text, style, arrow, space, edit this
headingText: 'Others from', headingTag: 'h2', headingSpaceBelow: '30px', showArrow: true, arrowSize: '56px', arrowSizeMobile: '34px', sectionSpaceAbove: '60px', sectionSpaceBelow: '60px',
To set limit of posts in related projects, number of columns, item height, space between items, space inside each item, edit this
postLimit: 4, columnsDesktop: 4, columnsMobile: 2, itemSpace: '2vw', itemSpaceMobile: '12px', itemHeight: '370px', itemHeightMobile: '240px', itemPadding: '40px 25px 30px', itemPaddingMobile: '20px 15px 15px',
To change overlay color over image, text color, image border radius, edit this
imageRadius: '33px', imageRadiusMobile: '25px', overlayColor: 'rgba(0,0,0,0.35)', overlayStyle: 'gradient', textColor: '#ffffff',
To enable/disable Excerpt, Category labels, edit this
showExcerpt: true, showLabels: true,
To change label categories style, edit this
labelLimit: 3, labelGap: '6px', labelPadding: '2px 10px', labelBorderRadius: '100px', labelBorderWidth: '1px', labelBorderColor: 'rgba(255,255,255,0.8)', labelFontSize: '12px'