sorry if my question title does not make much sense, I couldn’t think of a good way of wording it.
Essentially, I currently have some custom loop code on single.php that does the following:
If a post_tag from the main article (post_type: post) contains a matching post_tag of a single item (game) in the custom post type ‘games’ it displays a game info box with cover image, publisher, developer, etc, else if the post_tag matches 2 items then it displays different HTML output that lists both games. In this instance, it is the same game but under different ‘platform’ terms (ps4 and ps5)
What I am trying to achieve is this: if the article post_tag matches the games post_tag and finds 2 games with the same tag then outpit both games but, the game that has a ‘platform’ term of ps5 has the same HTML layout as if the tag only matched 1 game.
Here are some screenshots. https://imgur.com/a/lE2aBP2
The first image is how the game info box displays when the post_tag matches just one game.
The second image is how the HTML displays currently when the post_tag matches 2 games.
Third image is how I would like the HTML to output if the post_tag matches the same 2 games but the game with taxonomy ‘platform’ and the term ‘ps5’ is displayed as the full infobox.
Here is the code I currently have in single.php
The code does it’s job but I can’t figure out how to output a game differently if it has the specific term of ‘ps5’.Can I modify the existing loop somehow, or do I require 2 loops?
Any assistance would be much appreciated.