Shortcode always at top of content
You can’t just print output from a shortcode, you have to return it. Easiest way given your existing code is to use an output buffer. You can modify your draw_chain_menu() method like this: //shortcode action public function draw_chain_menu($args) { // previous code omitted… ob_start(); $this->generate_tax_select($args); return ob_get_clean(); }