Domanda

In the Visual view in Wordpress when I press <enter> it appears as if a new paragraph is started (see image 1). But when I go to the 'Text' tab, no <p> tag can be found (see image 2).

enter image description here

enter image description here

I've installed the TinyMCE plugin because I thought it would provide me more control. I also tried adding a codepiece to the functions.php file of my template (see here: http://www.adammershon.com/stop-wordpress-from-removing-br-and-p-tags/)

But I can't create paragraphs by entering text on the Visual tab, the only way is to insert p tags them manually on the Text view, which is unacceptable to my client.

Also when I press shift+enter on the Visual tab it goes to the next line, but on the Text there's no <br/> tag.

Important note I've integrated my Wordpress with ASP.NET where I directly request the content from the Wordpress database. So the rendering of the HTML is NOT done by Wordpress.

How can I have Wordpress add the paragraph tags when only editing on the Visual tab?

(I did not place this post in webapps.stackexchange.com because fixing my issue most likely requires some programming.)

È stato utile?

Soluzione

You Won't see p tags in text editor they will be generated at front-end

if you can't find p tags at frontend find and remove

remove_filter( 'the_content', 'wpautop' );

this can be in

  1. themes function.php
  2. plugin you activated

for more info check codex

UPDATE

To display the p and br tag we just need to install plugin which is tinymce-advanced and do some setting change. To change the setting just click check box for "Stop removing the p and br tags when saving and show them in HTML editor" and save. Now we can see the p and br tags in HTML mode and in database

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top