how to "petition" show using do_shortcode in template file in wordpress?
As mentioned in chat.civicrm.org the do_shortcode does work in a single template (single.php for example) but not in a sidebar.   

Two examples to get this going are https://github.com/aghstrategies/civicontribute-widget and https://github.com/agh1/civievent-widget