Site icon Hip-Hop Website Design and Development

Customized discipline and class question

I’ve created customized .php file that ought to present listing of all posts that correspond to consumer’s selection. I’ve 3 customized fields and 1 class situation.
I’ve tried all of the queries i may probably discover in wordpress codex database however nothing appears to work.

I’ve created 3 customized fields: a_field,a_fieldd,a_fielddd (and ofcourse i’ve posts with these fields already posted for the check) now I simply need to present the entire posts with customized fields with specified values (consumer’s selection) and provided that these posts are contained in the chosen class

EDIT

I’ve a question (with simply 1 worth for check), which appears to be working, however typically takes 0,00002s someties as much as 4 seconds. any strategies? I do know it could be higher if I take advantage of wp_query however I discovered this approach to be simpler to switch.
on this instance i’m attempting to get the publish with meta_key a_field with worth “5”

SELECT wp_posts.ID FROM wp_posts 
INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)
INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id)
INNER JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id)
WHERE 1=1 AND wp_posts.post_type = 'publish' 
AND wp_posts.post_status = 'publish'
AND ( (wp_postmeta.meta_key = 'a_field' 
AND  find_in_set('5',wp_postmeta.meta_value)) ) 
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10  

any strategies?