Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Possible to show only the last 3 badges?
JanHoos
✭
Hi guys!
I've been trying out this plugin and it works nicely!
However, my website is going to use more than 5 badges, so I was wondering how I can tweak the loop to only show the last 3 badges. Maybe add a text in front of it that says: My last 3 badges: [ ] [ ] [ ]
I tried changing the foreach loop but that did not work.
Any pointers on how to tackle this?
Tagged:
0
Comments
Hi JanHoos,
You will first have to order the badges by date (see http://stackoverflow.com/questions/4282413/php-sort-array-of-objects-by-object-fields)
and then go through the first 3 items and display them (see http://www.php.net/manual/de/control-structures.for.php)
Best, Martin
PS: Sorry for the late reply. I have been really busy with the early access release of our game Imagine Earth.
Hi Martin,
No problem! In the meantime I made a plugin that enables people to select 3 badges and display those next to the posts
More options!
http://vanillaforums.org/addon/yagafeaturedbadges-plugin
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.