Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting error while publishing the blog from Microsoft Word

I posted this question on wodpress.stackexchange.com without getting any response.

I realized it could be a programming issue in PHP.

I am trying to publish a blog post into wordpress based website from Microsoft Live Writer. Here is the sample text that I added in Microsoft which I published as well.

" Temporary Blog Post
I am adding a temporary blog post here 
Let’s see how it goes
Thanks"

However, when I published the post, this is how it looked

/pI am adding a temporary blog post here
/ppLet’s see how it goes
/ppThanks

Notice the \pp tags which is getting added in text.

Any idea the reason behind the formatting error? I thought when you publish from Microsoft word or Microsoft Live Writer, it should look the same as in the Microsoft Word/Live Writer.

Update : I am having the same error when I am posting from other publishing software like Windows Live Writer etc.

like image 635
Kiran Avatar asked Mar 10 '13 06:03

Kiran


1 Answers

By default, WordPress automatically inserts paragraph tags all over the place when displaying ‘the_content’ – this often gets in the way when you’re trying to space out your text, and also creates validation issues (inserting implicit p tag). If you want to strip the automatically inserted paragraph tags from your content, simply insert this line in your template file above ‘the_content’ tag:

<?php remove_filter (‘the_content’, ‘wpautop’); ?>

OR

Use the cleanup_shortcode_fix() function that should help with your issue.

Check out below links for more information,

  1. Remove the p tags auto wrap
  2. Removing <p> and <br/> tags in WordPress posts
  3. wordpress-wrapping-shortcodes-with-p-tags
  4. Disable wpautop

may this help you.

like image 104
Tony Stark Avatar answered Sep 18 '22 16:09

Tony Stark