REC Posted March 3, 2011 Share Posted March 3, 2011 Hey people, I've been coming here for a while but just decided to join. I'm new to php and I'm trying to make a website with WordPress as the CMS. Anyway, I'm basically making my own theme because I don't want my website to look like a blog, and it's going pretty smoothly so far but theres this huge top margin gap in the browser even when I set margins to 0px. I tried trial and error and found out that it's being caused by: <?php wp_head(); ?> which is located right before the closing head tag. If I remove the snippet then it's all fine, but I would prefer to leave it in there. here is the full code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> <title><?php bloginfo('name'); ?><?php wp_title(); ?></title> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please --> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_get_archives('type=monthly&format=link'); ?> <?php //comments_popup_script(); // off by default ?> <?php wp_head(); ?> </head> <body> <div id="wrapper"> <div id="header"> <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo(‘name’); ?></a></h1> <div class="navigation"> <?php wp_nav_menu(); ?> <?php wp_list_pages('depth=3&title_li=<h2>Pages</h2>'); ?> </div> </div> <div id="container"> <?php if(have_posts()): ?><?php while(have_posts()):the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <div class="entry"> <?php the_content(); ?> <p class="postmetadata"> <?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?><br /> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?> </p> </div> </div> <?php endwhile; ?> <?php else : ?> <div class="post"> <h2><?php _e('Not Found'); ?></h2> </div> <?php endif;?> </div> <div class="sidebar"> <ul> <li id="search"><?php include(TEMPLATEPATH . '/searchform.php'); ?></li> <?php wp_list_pages('depth=3&title_li=<h2>Pages</h2>'); ?> <li><h2><?php _e('Categories'); ?></h2></li> <ul> <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?> </ul> <li><h2><?php _e('Meta'); ?></h2></li> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li> <?php wp_meta(); ?> </ul> </ul> </div> <div id="footer"> <p> Copyright © 2007 <?php bloginfo('name'); ?> </p> </div> </div> </body> </html> I appreciate the help guys. Quote Link to comment Share on other sites More sharing options...
REC Posted March 3, 2011 Author Share Posted March 3, 2011 Never mind, I figured it out. There's nothing wrong with it, it's just where the top admin menu should go. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.