I always placed PHP code in theme files to get the widget functionality in WordPress page or post page. But I stopped doing this when I found plugin Widget Shortcode.
By using this we will get short code for any WordPress Widget and can place any page/post or anywhere.
For install Widget Shortcode plugin, login to WordPress admin area and click on Plugins > Add New.
Find the plugin by typing the plugin name – Widget Shortcode and then click the ‘Install Now’ button.
After this, you will see the success message with a link to activate the plugin. Click on the activate plugin link.
Go to Appearance > Widgets > You can see Widgets right across on the right hand side of the dashboard labelled “Widget Shortcode”.
Drap and drop the widget to “Widget Shortcode”, enter title and click save.
After that you can see the Shortcode