last day (14 days later) » 

2:14 PM
0
Q: How to set taxonomy in custom plugin?

shellysajuI am trying to create a plugin, I need a custom post and taxonomy. But it can be accessible in admin side, but the taxonomy is not working on front-end. This is how I registered the custom post and taxonomy: function post_type_questionnaire() { $labels = array( 'name' => _x('Questio...

 
@PiyushDhanotiya yes, it is showing in backend
@PiyushDhanotiya its not working, qcategories is the custom taxononmy and I have added it above
 
@shellysaju You have posts assigned to the terms/taxonomy you are trying to do Query for? Also you sure that 'terms' => $atts["name"] has the value which is actual slug (for the term you are trying to fetch for)?
Try to echo or var_dump this $atts["name"] and see if you have correct slug being feeded into the query, or better try by manually giving some slug for the known term in the query and test if query returns results...
 
@Mohsin I have tried it, the value is coming correctly
 
@shellysaju Looks good the $args you shared, are you sure you have posts assigned to 'new' term, and also that those posts are published and public.. Also could it be some other filter being applied to the query, try with suppress filters 'suppress_filters' => true
 
@Mohsin yes, the posts are published and public and also I have assigned posts to 'new' term.
@Mohsin also I tried the suppress filters 'suppress_filters' => true
 
2:27 PM
Hi can you try to var_dump your query results and see if you get any info there
 
no, it doesn't enter there, but without tax_query its fine
 
What could be the issue? have you in this theme done tax_query before? You think something can be issue we can look into?
 
hi, is there a way I can send you the plugin files, I know it is not good
ok thanks, I will send the files right now
 
NP , hope we can solve this as everything looks fine.
I am new to chat, is this chat public? I worry my email getting spammed, i may delete it if i can find some way.
I have flagged that for Mod to delete that, you may also please flag my the message which has my email, so Mod may delte that. thank you
 
2:42 PM
to flag a mod you have to select "mod flag" not just flag
the regular flags are announced to all logged in users with 10K + rep
 
@rlemon thank you
 
Hi, I have flagged the message which has your mail, I have shared it via google drive
 
@shellysaju Thanks
 

last day (14 days later) »