Support » Themes and Templates » 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)
  • 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;
Viewing 1 replies (of 1 total)
  • The topic ‘String Replace.’ is closed to new replies.