Custom plugin with shortcode not working

add_shortcode(‘myCustomShortcode’, ‘this_particular_function’); As soon as I looked at my code this morning I realized I was trying to pass the function name ([this_particular_function]) as the shortcode, not the shortcode name ([myCustomShortcode]). I overlooked this SO many times yesterday trying to look for some complex answer! I am smacking my head on the desk. Everything works … Read more

Can I associate a custom post type with another custom post type?

Yes, you can. You would need to add a custom field that would store the ID of other post type. I would recommend using a select list. You could try something along these lines: add_action( ‘add_meta_boxes’, ‘wpse_143600_add_box’ ); add_action( ‘save_post’, ‘143600_save_box’ ); //create the metabox function wpse_143600_add_box() { add_meta_box( ‘related_testimonial’, __( ‘Testimonails’, ‘wpse_143600_translation’ ), ‘wpse_143600_testimonial_box’, … Read more

getJSON response to PHP

After more reading and testing, i’ve realised that i misunderstood how AJAX works, therefore it was never gonna work the way i thought it would. For those who come across this, i hope this will help. In shortcode function i generated the api url with params specific to the page where shortcode is called. eg … Read more