WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] Events Widget adding extra Paragraph tags

[Resolved] Events Widget adding extra Paragraph tags

  • 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?

    http://wordpress.org/extend/plugins/events-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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' );
    }
    add_action('init','remove_autop_filters');

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

    Plugin Author Marcus

    @netweblogic

    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

    Marcus,
    Thank you for finding the bug with #_NOTES.

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

    Plugin Author Marcus

    @netweblogic

    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

    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.
    regards
    Micky

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Events Widget adding extra Paragraph tags’ is closed to new replies.
Skip to toolbar