• Resolved roblund

    (@roblund)


    Hi,

    I have recently created some new achievements and I am using the code given by Michaelhere to display the achievements to users on the front end of my site.

    The problem I have is that each badge that is created/earned is displayed in duplicate on the page with the above code – once with the badge that I created and secondly with the thumbs up image that comes as default with the BadgeStack add on…weird. Here is what I mean – my badge on left and the duplicate on the right. The only difference is that the duplicated badge uses the badge description instead of the title.

    Screenshot

    I deleted the BadgeStack add on but still no luck.

    Any suggestions would be appreciated.

    https://www.ads-software.com/plugins/badgeos/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Well, one thing to keep in mind is that deleting the plugin doesn’t delete the posts created for them in the post table. BadgeOS plugins purposely don’t delete content created at this time.

    Are you using this code I provided on any sort of archive page? That may explain why the extra ones are showing.

    Thread Starter roblund

    (@roblund)

    Hi Michael,

    The code is being used on a template file called profile.php here is the code.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Nothing is immediately standing out to me with the code pastebin, however I also can’t determine exactly which part of it is displaying the plain badges on the right either. With the page you’re seeing this on, do you have any sort of shortcode going on in the post editor?

    Thread Starter roblund

    (@roblund)

    Currently there is nothing at all in the post editor. I think that the problem originates when I create a new achievement. The duplicate badge images are added to my media library this is the name of one of the files:
    af2e834c1e23ab30f1d672579d61c25a_154.PNG

    The duplicate badges are also being shown on the wordpress profile page /wp-admin/profile.php as well.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm, well we need to pinpoint what section of the code is producing the unwanted part.

    Do you have an accessible url for this? or is it all localhost? If the latter, I could probably get by well enough with a screenshot of the entire rendered page, not just a small part of it.

    Thread Starter roblund

    (@roblund)

    There is a url but you would need to be a member to view the page. Here is a screenshot of the entire page, let me know if a screenshot is not good enough. Thanks for your help with this.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’m curious to see what would happen if you passed in a specific achievement type. Logically based on the function you linked from me, it should only be showing 1, by default. However, it’s showing all of that.

    Thread Starter roblund

    (@roblund)

    That’s it, as soon as I passed in an achievement type the rogue badges disappeared. If I still want to display all achievement types would the best way be to create a new function for each?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm. At the moment, that may have to be a custom thing. There are some post types that BadgeOS creates that aren’t meant to be public, like the logs.

    *gets technical*

    I believe we have a function of badgeos_get_achievement_types() that is meant to grab the appropriate ones. However that’s going to return an array, which wouldn’t be able to be passed in as is, for this function. However, you could fetch the achievement types, loop over the array, and inside that loop pass in each one to the function from earlier.

    This may or may not be ideal because it’d just display them in sections by achievement type, with no ability to group/sort/etc without amending the function. In short, there’s room to improvise and improve what code you already have for this, to fit your exact need.

    *stops technical*

    Hope that helps or at least spurs some ideas in your head ??

    Thread Starter roblund

    (@roblund)

    Thanks for all your help with this Michael I’ll see what I can come up with…

    This problem exists for me as well.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘New badges being duplicated with default thumbs up image’ is closed to new replies.