• Resolved liarandathief

    (@liarandathief)


    I tested the plugin on one site and it worked well. When I installed it on the site I was working on, it wasn’t working. The menu button is there and I can customize things, but the slideout doesn’t appear. Eventually I figured out that the .mob-menu-slideout-over class wasn’t in the body tag. If I added it in the inspector it works. If I put
    document.body.classList.add("mob-menu-slideout-over");
    in the JS box it breaks the whole thing.

    However, if I put the javascript in the footer manually, everything works great. I’m just wondering if there’s a less hacky way to fix this.

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

    (@takanakui)

    Hi @liarandathief,

    If the class isn’t in your body is probably because of your template that isn’t including the body_class() function has expected.

    Your body tag code should look like this.

    <body <?php body_class(); ?>>

    Check in the header.php of your theme.

    Thread Starter liarandathief

    (@liarandathief)

    The theme is Thesis 2, which is a highly customizable theme. It doesn’t have a header.php. I don’t even think it uses body_class(), but rather I think it uses hooks. However. I was just able to test it on another site using Thesis 2 and it worked without adding the class manually. Odd. Could it be another plug-in causing the problem? Or a problem with the installation?

    If it helps, and if it’s relevant, the sample text boxes don’t work on the first site (the one with the issue) I get an 500 error message. And they do work on the second site I tested it on.

    Plugin Author Rui Guerreiro

    (@takanakui)

    Look in the theme code for the <body> tags and confirm that he uses the body_class() as recomended by WordPress, if it doesn’t have an header.php the body should be somewhere else.

    Something (plugin or custom code) can be hacking the filter that returns the body classes.

    Here goes the link to the body_class() documentation.
    https://developer.wordpress.org/reference/functions/body_class/

    Thread Starter liarandathief

    (@liarandathief)

    I no longer think this is related to Thesis, at least not directly. I tried it on another site with the same Theme and it worked fine. I even added all the same plugins and it still worked.

    But I made a clone of the bad site on my local machine and it has the same problem. I’ve turned on all debug and error reporting, I’m not getting any php errors, any javascript errors.

    I would like to try a clean install, including stripping out all the entries from the database. Do you have instructions for that?

    Plugin Author Rui Guerreiro

    (@takanakui)

    @liarandathief

    I think the problem here is some plugin that is causing the issue, so reseting the datavbase won’t change the situation.

    I will suggest that you disable all plugins except WP Mobile Menu, clear the cache and test if it works.

    If it works, then enable the plugins one by one or several at each time until figuring out the problematic plugin.

    Plugin Author Rui Guerreiro

    (@takanakui)

    Will close the topic for now.
    Let me know if you need further help with this.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘body class doesn’t get added which breaks the plugin’ is closed to new replies.