WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Daniel Payne
    Member
    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?

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

  2. agelonwl
    Member
    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' );
    }
    add_action('init','remove_autop_filters');

    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
    Member
    Posted 1 year ago #

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

    Agelonwl,
    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
    Member
    Posted 9 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.
    regards
    Micky

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic