How to add module positions to a Joomla 3.x template

To view Module Positions in Joomla 3.x, Let's login into your Joomla 3.x administrative dashboard, chose Extensions-> Template Manager-> Options-> Templates-> Preview Module Positions, chose Enabled. Then in front-end, insert ?tp=1 to the end of url site you want see, for example: example/joomla_test?tp=1, you will see all positions in template. create-module-position-joomla Now, we will create a module position for template. I use template protostar for example
Step 1: Open file templateDetails.xml in url: yoursite/joomla_test/templates/protostar/templateDetails.xml , find line 27 to 46: insert this code between over code: Step 2: Open file index.php in this url: yoursite/joomla_test/templates/protostar/index.php , insert this code: in area you want create position, i will add position to area main-content we created successful new position: create-module-position-joomla2