• I’m only writing this because i don’t want to be without the plugin anymore 😉

    Question: as soon as I use [expand title=”example”] Expandable text [/expand], I get an error displayed in the HTML markup using https://validator.w3.org/

    Error: No p element in scope but a p end tag seen.</div></p><div>

    Tag Attribute is set to div
    Targtag Attribute is set to div

    Thanks for a tip how to solve this.

    • This topic was modified 2 years, 1 month ago by W★.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author twinpictures

    (@twinpictures)

    OK, what is happening is a very common problem with wordpress’ wpautop filter. just google “wordpress adding extra p tags” and a long list issues and solutions are returned.

    Here is one quick thing to check: Be sure that there are no hard-returns after the short code. So like this:
    [expand title="example"]Expandable text[/expand]

    Not like this:

    [expand title="example"]
    Expandable text
    [/expand]

    Ping back with your findings, and if you still need assistance, we’ll make sure you get it.

    Thread Starter W★

    (@filmpuls)

    thanks for helping 🙂

    have tested adding in child theme function.php to remove autop for the category, which as a matter of fact removes all the p-tags

    remove_filter('term_description','wpautop');

    could be an option, although this would mean to add paragraphs manually for about 50 categories/tags … and what I do not yet understand:

    how would I manage to have a margin above/below the [expand]-shortcode? solving this using a tag attribute or using <div class=”…”> causes the HTML-mistake again.

    • This reply was modified 2 years, 1 month ago by W★.
    Plugin Author twinpictures

    (@twinpictures)

    correct. removing the wpautop function globally is not wise. There is just a standing issue on some installs with how wpautop is used during shortcode rendering. (https://stackoverflow.com/questions/51316972/wordpress-keeps-adding-auto-paragraph-tags-to-shortcodes-and-content)

    Under the Collapse-O-Matic settings page, see if changing the “Content Filter” setting has any affect.

    if that has no effect ping us back. do you have a dev site, or only the live site?

    • This reply was modified 2 years, 1 month ago by twinpictures.
    Thread Starter W★

    (@filmpuls)

    “filter” reduces the errors from two to one.

    No p element in scope but a p end tag seen.
    </p></div></p></div>

    it seems to me that for some reasons the [expand] triggers a closing </p> but not an opening p.

    have also testet the solution you offered concerning shortcode rendering – problem remains.

    have killed the stage some time ago to reset it one day, so at this point, there is only the live site. However, if you want to check it out, let me know your contact info.

    • This reply was modified 2 years, 1 month ago by W★.
    • This reply was modified 2 years, 1 month ago by W★.
    Plugin Author twinpictures

    (@twinpictures)

    Sure. You can contact us direct at info [at] twinpictures [dot] de and be sure to include a link back to this thread.

    Thread Starter W★

    (@filmpuls)

    backing up might take an minute, give me a moment please

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘HTML Markup Error: no p element’ is closed to new replies.