How to load a plugin when doing an Ajax call? [duplicate]

You are not using ajax right. Why are you adding your ajax callback function to the init action? You need to read http://codex.wordpress.org/AJAX_in_Plugins Attach your ajax callback function to wp_ajax_your_defined_action like this: add_action( ‘wp_ajax_your_defined_action’, ‘your_callbck_function’ ); For this to work you have to use wp-admin/admin-ajax.php as your ajax url and you have to post your_defined_action … Read more

Overwriting a Shortcode

A child theme’s functions.php file is loaded before the parent theme’s, so the behavior you’re seeing is correct. Try adding your shortcode on a later action instead: function wpa_add_child_shortcodes(){ add_shortcode( ‘jo_customers_testimonials_slider’, ‘jo_customers_testimonials_slider_with_thumbnail’ ); } add_action( ‘after_setup_theme’, ‘wpa_add_child_shortcodes’ );

Pull random comment from specific post, display on homepage with shortcode

The main issue with the code snippet is this line: function randomComment_handler($post_id) { Check out the Codex on add_shortcode() and see if you can find the error. Spoiler: It should be like this: function randomComment_handler( $atts, $content = NULL ) { ps: You should also avoid using extract(), use $atts[‘post_id’] instead. Further consider adding the … Read more