• Resolved 3tonine

    (@3tonine)


    First, thanks for the plugin, it’s absolutely the one and only choice for a buddypress integrated wordpress site. Solid, and features are so complete, after a whole night of exploring I think I have yet discovered half of its potential.

    During my little test with the plugin, I ran into a problem which I so much need some good advice on, so here I am trying my luck.

    I found that the Add /Edit Event Page on a buddypress profile page is the only page that’d break my theme’s basic structure, which generated by a very basic template “Page.php”

    It seems on this page, the template failed to distinguish that it is a singular page, and have a sidebar, and at the right point the page content area has ended, it should load up the footer, and it should continue to run the rest of the codes. As a result, the second sidebar on the right and the footer got messed up, displaced, like paste of mud on the floor.

    There’s actually no other sign showing like on other pages, sometimes there some weird empty div generated by the plugin, and got in the original content’s way, not on this particular page, but once I disable the plugin’s buddypress integration, every back to normal; and of course, if I deactivate the plugin as a whole, the page’d disappear and everything on buddypress pages back to normal too.

    I wonder why is this page so special and what possible I can do to fix this little theme compatibility issue. I test all my plugins on this theme “Magazine basic by bavatasan”, because of its simplicity, and is far more easy for me to diagnose and trace down possible conflicts. If you look into it, it follows like every wordpress rule for coding a theme, so good fellas, any hints or advice would be great help and much much appreciated. Thank you!

    PS. this is where I believe something started to go wrong, footer area of the template:

    <?php
    /**
    * The template for displaying article footers
    *
    * @since 3.0.0
    */
    global $mb_content_area;
    if ( is_singular() && ‘sidebar’ != $mb_content_area ) : ?>
    <footer class=”entry”>
    <?php
    wp_link_pages( array( ‘before’ => ‘<p id=”pages”>’ . __( ‘Pages:’, ‘magazine-basic’ ) ) );
    the_tags( ‘<p class=”tags”>’, ‘ ‘, ‘</p>’ );
    edit_post_link( __( ‘(edit)’, ‘magazine-basic’ ), ‘<p>’, ‘</p>’ );
    ?>
    </footer><!– .entry –>
    <?php
    endif;

    https://www.ads-software.com/plugins/events-manager/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    not sure if this helps but how about trying this php condition ?

    if( !empty($_GET['action']) && $_GET['action']=='edit' ){
    
    }
    Thread Starter 3tonine

    (@3tonine)

    Thanks for the reply Angelo, may I ask how is this condition going to help the situation and what should be the expected result if the condition’s requirement is meet?

    Thread Starter 3tonine

    (@3tonine)

    If I made a custom template for this particular page, would it help?

    If I do so, what type of template I should pick? Should I reference to some buddypress templates say member/plugin.php?

    Any advice would be great help, thanks all ??

    Hiya,

    I believe you should first compare your theme to the default theme. Given that it’s something with your theme, checking against the standards used by the default.

    That should highlight where your theme is falling down.

    Cheers

    Thread Starter 3tonine

    (@3tonine)

    First, thanks for the head-up, actually that’s something I’ve been trying to do.

    Question then changed to … which should be considered as default theme for this plugin? I checked the plugin’s template folder, I didn’t see any sign of a single page template.

    Should I take the buddypress’s page.php as reference? but that doesn’t come with a second sidebar… “head scratching hard…awww…”

    Thread Starter 3tonine

    (@3tonine)

    Just now I realize the add event page also breaks buddypress default theme’s structure, the sidebar fall out of the screen… wow!

    Thread Starter 3tonine

    (@3tonine)

    Further test results:

    Plugins activated: Buddypress, BBpress, Events Manager

    Themes & results:

    Buddypress – Sidebar fell out of screen
    Magazine Basic – Second sidebar fell into footer area
    DW Minion – Sidebar fell into next row
    MesoColumn – Sidebar fell into next row

    PS. Everything updated to latest versions & no events manager related messages in error log.

    If you take a look at /plugins/events-manager/templates you’ll see there are dedicated BuddyPress templates included that can be copied and customized.

    Take a look at this tutorial for how to do that in an upgrade safe way:
    https://wp-events-plugin.com/documentation/using-template-files/

    If you want to create a custom template for single events, use a file named single-event.php in your theme folder. That file will override the default template, so it should be possible to use that for your customizations.

    Thread Starter 3tonine

    (@3tonine)

    In my understanding, customization doesn’t involve “just to show the content right with the default theme”

    In this case, it is buddypress default theme. Because “add event by a member” should be a buddypress + events manager function right? It should show properly with the official theme. Instead of breaking it’s markup.

    I believe it doesn’t happen to everyone, or a lot of people, because this problem only happens under particular circumstances – the right event number, with the right events manager setting, right member with right privileges. These actually are not of my concerns at all. After two long nights of debugging, all I care is WHO did the wrong! Turns out, this is the killer:

    em-template-tags.php

    The victim, my site, it’s markup broke, because there’s an extra close tag </div>. It came from the function the_content on my template (this function appears in every single wp theme on earth right?).

    the_content got a set of <form> from EM, EM wrapped it with a “css-event-form” class div, but after passing certain condition loops in the em-template-tags.php, the “css-event-form” div came out with two div closing tag, which accidentally closed the em-wrapper div right outside, then its originally closing tag was left out, which then again, accidentally closed my template’s original content wrapper.

    Such a long story… anyway, after all of the accidents, the template’s main content column div was closed too early and lost its full clearfix, which eventually broke the markup, thank you very much.

    To sum up, adding comment lines after echoing tags is crucial, in my case, it is fatal… if there were hints telling me which tag should go with which, I wouldn’t end up spending two nights checking my theme from head to toe, eventually found out all was happened before the get content function.

    Thanks all for participating. I can finally go to sleep…zZZ

    Thanks for posting this. you just saved me the time to debug this which might take days ??

    on line 403 if( get_option(‘dbem_css_editors’) ) /*echo ‘</div>’*/;

    Yes removing a closing div solved my problem.

    Sure that works, but you’re hacking the code! if you set the option dbem_css_editors to 0 it will work as it should

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Add /Edit Event Page breaks template structure’ is closed to new replies.