Title: adding a post ID to a string &#8211; feedback please
Last modified: August 21, 2016

---

# adding a post ID to a string – feedback please

 *  [Shmoo](https://wordpress.org/support/users/macpresss/)
 * (@macpresss)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/adding-a-post-id-to-a-string-feedback-please/)
 * I’m trying for two days now and I finally got it done..
 * It seems like everything is working fine, I get no PHP errors but I rather ask
   somebody professional first before I add this code to a tutorial so more people
   can benefit from this.
 * What I’m trying to do is create custom **groups/series of badges** that can be
   earned on my website through the myCRED plugin.
 * Everything goes fine at the start, there is a Post Type for the badges section
   created by the myCRED developers and I’ve added a (category style) Taxonomy to
   that Post Type so I can group multiple badges together in the admin section.
 * ** Still need to find out how I can delete those badge_series (categories) because
   right now there is only an adding section **
 * This is what it looks like for logged_out users/visitors. They all get a list
   of all badges that can be earned in the comments section.
    [Screenshot](http://i.imgur.com/GLB1roD.png).
 * So far so good this wasn’t very difficult but adding a conditional tag to check
   if a user who”s logged_in has earned this badge before was a bit more complicated.
   
   All badges are stored in the **usermeta** table [like this](http://i.imgur.com/C7VsS3d.png).
   Just the badge name + ID attached to it.
 * So I thought let’s try and glue the post_ID against the meta_key column when 
   asking for it but I don’t know if that’s correct.
 * Please take a look at my code.
    The function **still_at_work()** at line 69 I
   attached the Post_ID against the meta_key and I don’t know it’s that’s correct.
   [Here is my code (pastebin)](http://pastebin.com/0yqsH79f)
 * It looks like it’s working in the end.
    [screenshot final](http://i.imgur.com/jKWP0wO.png)

The topic ‘adding a post ID to a string – feedback please’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Shmoo](https://wordpress.org/support/users/macpresss/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/adding-a-post-id-to-a-string-feedback-please/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
