Good to hear from you again! Thanks for working with me by email to clarify your application goal.
The example plugin you found was intended to solve a somewhat different problem, i.e., it improves the performance of an application that originally had many separate SQL queries on one page. The example does one query and then organizes the results so they can be displayed in several separate gallery displays on the page.
Your application is simpler. You want to pick one or two or a few “player” images at random. Taxonomies are a good solution, but they are better at “including” specific terms rather than “excluding” terms. If you can assign a specific attachment_category or attachment_tag term to all the players (and only the players) you can code something like:
[mla_gallery attachment_tag=player numberposts=2 orderby=rand]
It looks like you’ve assigned a “team” tag to your images. You could use a taxonomy query to randomly show players from a specific team:
[mla_gallery]
numberposts=2
orderby=rand
tax_query="array(
array(
'taxonomy' => 'attachment_tag',
'field' => 'slug',
'terms' => array( 'player', 'oakland-raiders' ),
'operator' => 'AND'
),
) "
[/mla_gallery]
That looks complicated but I’ve used the “enclosing shortcode” syntax to break it out over several lines for readability. If you follow the taxonomy query link above you’ll see several examples that show what can be done. Taxonomy queries are the WordPress-recommended way to do these searches, but MLA also supports the older, simpler format:
[mla_gallery attachment_tag="player,oakland-raiders" tax_operator=AND numberposts=2 orderby=rand]
You want to “randomly display one or two (or however many) in the side bar.” You can put an [mla_gallery] shortcode in a WordPress text widget (new feature in the latest WordPress version) or you can use the “MLA Text” widget I provided for older WordPress versions.
I hope that gives you the information you need to accomplish your task. I am marking this topic resolved, but please update it or email me if you have any problems or further questions regarding the above suggestions. Thanks for your continued interest in the plugin.