How to show menu only in wordpress post? WordPress

Let me tell you that how to show menu only in wordpress post only and to hide on pages?

Step 1:

write the following code in functions.php

different sidebars for wp post and page
different sidebars for wp post and page

Step 2:

write the following code in sidebar.php

how to show different sidebars for post and page
how to show different sidebars for post and page

 

Step 3:

Go to Appearance – > widgets and select the menu for “post sidebar” only.

show categories only in wp post but not on page
show categories only in wp post but not on page