Using the wpautop() function, WordPress itself add paragraph tag to the content as well as the excerpt BUT if you wish to make an addition to this by adding paragraph tags to any text, simply add the following snippet and you will be able to add paragraph tags automatically in your WordPress blog.
1 2 3 4 | $my_text = 'Lorem ipsum dolor sit amet consectetur adipiscing elit. Nulla pretium libero eget gravida rutrum.'; echo wpautop( $my_text ); |
Snippet Source/Credit: Daniel Pataki