I figured out a solution for this, which I will quickly share in case it helps someone in the future.
I noticed that X is inserting a .css declaration – based on the applicable category(s) – into the article
tag for each Portfolio item:
<article id="post-207" class="post-207 x-portfolio type-x-portfolio status-publish has-post-thumbnail hentry portfolio-category-residential x-portfolio-3e71b68023c9ea38b8c7d290bb0bb1df isotope-item" style="position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px); opacity: 1;">
Note portfolio-category-residential
above. We can exploit this!
Therefore, I added the following code to Global JS:
jQuery( ".x-iso-container-portfolio .entry-wrap.cf" ).prepend( "<div class=\"work-categories\"><span class=\"commercial\">COMMERCIAL <\/span><span class=\"community\">COMMUNITY <\/span><span class=\"institutional\">INSTITUTIONAL <\/span><span class=\"passive-house\">PASSIVE HOUSE <\/span><span class=\"residential\">RESIDENTIAL <\/span><\/div>\r\n" );
The above jQuery inserts the following into the code for each Portfolio item (obviously you would need to manually modify the code to use your own Categories).
<div class="work-categories"><span class="commercial">COMMERCIAL </span><span class="community">COMMUNITY </span><span class="institutional">INSTITUTIONAL </span><span class="passive-house">PASSIVE HOUSE </span><span class="residential">RESIDENTIAL </span></div>
At this point every project displays EVERY available Category:
So we add a little CSS to hide ALL Categories:
.commercial,
.community,
.institutional,
.passive-house,
.residential {
display: none;
}
And then harness X’s declarations to show ONLY RELEVANT Categories:
.portfolio-category-commercial .commercial,
.portfolio-category-community .community,
.portfolio-category-institutional .institutional,
.portfolio-category-passive-house .passive-house,
.portfolio-category-residential .residential {
display: inline;
}
Add a little extra styling:
.work-categories {
text-align: center;
width: 100%;
margin: 10px 0 0 0;
}
.work-categories span {
margin: 0 10px;
font-size: 90%;
}
And we’re done: