WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_head tag moving page down (13 posts)

  1. dmd54
    Member
    Posted 1 year ago #

    I'm new at building websites using wordpress. I've been working on a personal, my first attempt at converting to a WP friendly one and I'm not understanding why the php wp_head tag is pushing my page down. When it's removed everything is the way it should be with the header at the top of the browser but as soon as I add it it's knocking the whole thing down. Any help is much appreciated. You can see what I mean if you go to the site I'm working on http://danielpaymar.com

  2. vtxyzzy
    Member
    Posted 1 year ago #

    The blank area is for a slideshow. It is probably either built into your theme or created by a plugin.

    Look for theme options or a plugin related to a slideshow.

  3. dmd54
    Member
    Posted 1 year ago #

    vtxyzzy - yes the blank area is the nivo-slider but it's not the plugin. i built the theme and all though the images are not showing up that is not my main problem. my problem is that the wp_head tag is moving my entire page down, adding a padding or margin to the top.

  4. vtxyzzy
    Member
    Posted 1 year ago #

    Can the margin be seen on the current home page?

    If yes, please explain exactly where it is located.

    If no, please add the wp_head function back so it can be seen.

    Something in your theme, or a plugin, is probably using the wp_head action hook to add content to the page. If there is no content defined, it may just add a blank line or something else that takes up space.

    If the problem can be seen on the screen, the source code of the screen can be examined to see what is being added. That may provide a clue to the source.

    You can read about wp_head here:

    http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

  5. dmd54
    Member
    Posted 1 year ago #

    Yes the margin can be seen, at least I see it. Basically the tip of the paper with my name on it should be touching the top of the browser. You should not be able to see the background texture.

    I have no plugins currently being used on my theme so i don't think that's the problem. The wp_head function is being used but i'm unsure you'd be able to see it since it's php?

    i'm at total loss here since i don't really know php.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    FYI, the page displays as you want it (if I'm understanding your description) in Firefox on a Mac... i.e. there is no gap above the header.

  7. vtxyzzy
    Member
    Posted 1 year ago #

    It also displays correctly in IE9.

  8. vtxyzzy
    Member
    Posted 1 year ago #

    Actually, there is one plugin that is inserting some javascript in the head section as evidenced by this line:

    <script type="text/javascript" src="http://danielpaymar.com/wp-content/plugins/cms/js/faq-frontend.js">

    Look for a plugin named 'CMS' and disable it.

  9. dmd54
    Member
    Posted 1 year ago #

    i deactivated the CMS plugin and the gap remains.

  10. dmd54
    Member
    Posted 1 year ago #

    ok so i think i found out what is causing the problem. when i wrapped the wp_head in HTML comments this is showing up, from where I don't know since those styles are not in my CSS file.

    <style type="text/css" media="print">#wpadminbar { display:none; }</style>
    <style type="text/css" media="screen">
    html { margin-top: 28px !important; }
    * html body { margin-top: 28px !important; }
    </style>

  11. vtxyzzy
    Member
    Posted 1 year ago #

    I believe that code is for the 'Admin Bar' that WP puts at the top of the screen. There are several plugins that will let you control when that is used.

  12. dmd54
    Member
    Posted 1 year ago #

    You're right...not sure why the usual dialogue wasn't showing up, that was causing my confusion. It just looked like a blank space. Thanks for the help!

  13. vtxyzzy
    Member
    Posted 1 year ago #

    If your problem has been solved, please use the dropdown on the right to mark this topic 'Resolved' so that anyone else with this question can see that there is a solution.

Topic Closed

This topic has been closed to new replies.

About this Topic