Title: String Replace.
Last modified: August 20, 2016

---

# String Replace.

 *  [frankfolk](https://wordpress.org/support/users/frankfolk/)
 * (@frankfolk)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/string-replace/)
 * Hello.
 * I am creating a wordpress site for a client and i am experiencing a problem.
 * When creating a post from the dashboard pressing enter only creates a line break
   rather than a paragraph. So it moves it to a new line instead of having a space
   between the paragraphs.
 * So i figure what i have to do is a string replace that finds 
    tags and replaces
   them with <p> tags. The only thing is i actually have no idea how to it haha.
   So my div i am calling in the content using the <?php the_content(); ?>
 * Where do i go from here? I apologize because i don’t like creating such an open
   question but i really don’t know where to start with it…

Viewing 1 replies (of 1 total)

 *  Thread Starter [frankfolk](https://wordpress.org/support/users/frankfolk/)
 * (@frankfolk)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/string-replace/#post-2886657)
 * Right, i have amended someone else’s code and i believe this should work.
 *     ```
       function replace_content($content)
       {
       	$content = str_replace('/n', '<p></p>',$content);
       	return $content;
       }
       add_filter('the_content','replace_content');
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘String Replace.’ is closed to new replies.

## Tags

 * [content](https://wordpress.org/support/topic-tag/content/)
 * [paragraph](https://wordpress.org/support/topic-tag/paragraph/)

 * 1 reply
 * 1 participant
 * Last reply from: [frankfolk](https://wordpress.org/support/users/frankfolk/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/string-replace/#post-2886657)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
