WPBadger icon indicating copy to clipboard operation
WPBadger copied to clipboard

Only showing five badges & image/evidence confusion

Open jamesmichie opened this issue 11 years ago • 5 comments

These might be separate issues but they arose at the same time so I have combined them. A student who I issued two badges to, emailed me to say that I had issued them the same badge twice. In the WP back end I have definitely issued different badges. However, when I go to the view the pages and click through to accept the badges. The one that was issued first is showing the 'badge image' and 'meta-data' for the one that was issued second.

At the same time this has arisen I came across another issue. When I added a sixth badge and went to issue it, I saw in the drop down menu that the first badge I added is not there. The page is there etc, but in the drop down menu when I go to award a badge it does not come up in the list. This will be a problem when I move forward as I am running the course with a new group of students.

Any help? Have you come across these issues before?

jamesmichie avatar Mar 04 '13 19:03 jamesmichie

I have just seen that the first issue explained above is the exact same one that gyststarblayze is having.

jamesmichie avatar Mar 04 '13 20:03 jamesmichie

As you mentioned, the first problem you described is the same one I'm having. I'm still waiting to hear a solution for that one.

However, I have a possible suggestion for your second issue. The number of badges listed in the Award drop-down menu is tied to the number of posts that appear on your pages. If you go to your Wordpress Dashboard > Settings > Reading you'll probably see the "Blog pages show at most" value set to 5. If that's the case, just increase this number and you should be able to see all your badges in the drop-down list. I had a similar issue and this is how I fixed it. It would be nice to specify the drop-down length separately, but perhaps that's a feature for another day. I'd prefer to see the badge issuing problem addressed first. :)

gyststarblayze avatar Mar 04 '13 21:03 gyststarblayze

Agreed re: the issuing problem and thanks for the advice. :+1:

jamesmichie avatar Mar 04 '13 21:03 jamesmichie

Made changes and it worked. Thanks @gyststarblayze, that's one issue resolved. Much appreciated. :+1:

jamesmichie avatar Mar 04 '13 21:03 jamesmichie

Hi all! Bug is in the file /wpbadger/includes/awards.php. WP_Query default returns in result only 10 posts. If you need more badges, add 'posts_per_page' => 9999 to the WP_Query.

My solution is replace code (/wpbadger/includes/awards.php):

$query = new WP_Query( array( 'post_type' => 'badge' ) );

by this code (/wpbadger/includes/awards.php):

$query = new WP_Query( array( 'post_type' => 'badge', 'posts_per_page' => 9999 ) );

Enjoy!

jiripavlicek avatar Apr 12 '13 21:04 jiripavlicek