Ready to get started?Download WordPress


Events Manager
[resolved] Events Widget adding extra Paragraph tags (6 posts)

  1. Daniel Payne
    Posted 1 year ago #

    I love this plugin, however for the Events widget it is producing HTML code with extra Paragraph tags. In my Events widget the List Item Format is:

    <a href="#_EVENTPAGEURL"><strong>#l, #M #j </strong></a>#_NOTES

    What I see in the HTML is instead:

    <ul><li><a href='event-path-name'><strong>Monday, Mar 4 </strong></a><p><p><p>My event notes show up here</p></p></p></li>

    So why is the Widget inserting three paragraph tags?

    My hack to work around this paragraph bug was to edit the plugin file: widgets/em-events.php

    Starting at line 67 there's a loop: foreach($events as $event)

    I added:

    $html = $event->output($instance['format']);
    $html = str_replace('<p>','', $html);
    $html = str_replace('</p>','',$html);

    Then in the loop I replaced the $event->output with $html. Now my HTML formatting is correct, but why do I have to hack this file? Why is the widget adding extra Paragraph tags?


  2. agelonwl
    Posted 1 year ago #

    your theme might have been adding extra p tags; you might want try to add this snippet in your theme functions.php

    function remove_autop_filters(){
    remove_filter( 'the_content', 'wpautop' );
    remove_filter( 'the_excerpt', 'wpautop' );

    or in your theme style.css p:empty{ display:none; }

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    there's a bug in EM with the #_NOTES placeholder actually... I'll be updating the dev version within a couple hours with the fix, you can install that by going to Settings > Admin Tools > Check Dev-versions

  4. Daniel Payne
    Posted 1 year ago #

    Thank you for finding the bug with #_NOTES.

    Uh, my theme is OK, remember I reported an issue with a plugin.

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    this bug cropped up in the last couple of updates, before (and still will after the fix), it still happened but the theme was at fault, hence his suggestion

  6. laCabriole
    Posted 10 months ago #

    hi Marcus , unfortunately the bug exists still in version 5.5.1
    Using #_CATEGORYNOTES in the single event layout produces 4 empty p tags and one for the notes. When I take out the #_CATEGORYNOTES the p tags are gone.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic