WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Javascript and Theme Alignment (and validation...why not?) (10 posts)

  1. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    OK, I'm trying to figure out how things work....I'm getting decent with basic theme setup, css, etc. With no plugins active my site validates just fine, and looks great.

    Now when plugins get activated some of them throw a javascript down in the footer (viewed in the source code). It seems that's in relation to where <?php wp_footer(); ?> is placed if I'm observing correctly?

    Now it appears that the javascript jacks up the alignment of my footer...sometimes. On some pageloads, my footer looks fine, other times it does not (from the same computer, from any computer). I've got that wp_footer right before the closing body tag, but I've experimented moving it all around. In some places it messed up the alignment worse than others, but it's always affecting my layout.

    Is there some kind of work I should be doing with my theme prevent/minimize this? I'd love for my footer text and images to stay where I put em.

    And there's the validation issues, seems any of the plugins inserting javascipt are also killing my validation....is this something I can fix, or do I just live with it if I'm needing that plugin functionality?

    Thanks folks!

  2. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    As far as the footer alignment goes, I find wrapping the wp_footer() call in its own <div> will generally eliminate most issues, although I have not tested with every plugin.

    You might have to live with the plugin(s) "killing" your URL validation, have you tried asking the plugin author(s) for work-arounds?

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    I've got it in a div, Ill watch how it behaves, thanks. So far it's looking good, but the behaviour was kind of random.

    As for the validation, I'm not too worried, I just wanted to make sure it wasn't due to some sort of action I should have been taking

  4. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    The key I found to wrapping with a <div> was then setting its style to "contain" whatever might hook into the wp_footer() call.

    For example, setting a fixed width, making sure the background repeats vertically, setting overflow-x, etc.

    I like using this plugin for testing purposes: http://wordpress.org/extend/plugins/add-to-footer/ ...

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Hmm..I'll have to figure this out....I've got a few plugins running js here, like some google analytics plugin, wp-postratings, some others....

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    well....I'm not real sure how to style this div....but Just wrapping it in a div really seems to have helped. Sometimes I get about a 10px gap at the bottom of my page, and sometimes I don't, but with the div in place, it doesn't affect my layout it seems, it just adds the gap under my footer, which I can live with. Thanks!

  7. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    It looks like it might be the wp-stats smiley that is giving you the gap at the bottom. Have you tried this:

    img#wpstats{display:none;}

    ... or you may be able to add a 'display:none' property to the <div> around wp_footer()

  8. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    oh what the crap!!!! I totally forgot about that smiley! heh....I noticed the gap at the bottom but didn't look real closely and totally forgot that thing was ever there. I'm pretty sure that's it! Thanks!

    I thought about a display:none, but it looks like the JS has been reeled in by wrapping it in the div.....if necessary I'll add it tho, now that you've reminded me of the smiley, I think I'm set

  9. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    meh...no matter what I do, when I'm not signed in, everything is good....when I am signed in, there is a gap at the bottom.... however, like I said, the div keeps everything aligned now at least, which is good enough, I'm just tryin to be picky here

  10. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    It looks like you are using the property 'visibility: hidden' which makes things "disappear" but it also works as a placeholder as well ... possibly leaving the gap you are seeing when you are logged in.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.