• Resolved michael-howe

    (@michael-howe)


    Hello all! I recently setup my blog (at https://www.humanityguide.com/blog) and followed the instructions here: https://www.jestro.com/web-design/convert-xhtml-css-to-wordpress/ to use my pre-existing CSS and HTML to be used as a template. Well, the content is below everything!

    I’ve been trying to figure out how this is happening, but no such luck. I’m fine with CSS and XHTML (all the code I used for the main site is custom), but PHP eludes me. ><

    Here’s the code for my index.php file for the blog if anyone can help me out. Feel free to “View Source” if there’s something that you need to see or just ask me and I’ll post it:

    <?php get_header(); ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="https://gmpg.org/xfn/11">
    	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    	<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
    
    	<style type="text/css" media="screen">
    		@import url( <?php bloginfo('stylesheet_url'); ?> );
    	</style>
    
    	<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 1.0" 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 class="allcontent">
    
    <div class="belowbanner">
    
    <div id="main-content">
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php the_date('','<h2>','</h2>'); ?>
    
    <div class="post" id="post-<?php the_ID(); ?>">
    	 <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    	<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_tags(__('Tags: '), ', ', ' — '); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    
    	<div class="storycontent">
    		<?php the_content(__('(more...)')); ?>
    	</div>
    
    	<div class="feedback">
    		<?php wp_link_pages(); ?>
    		<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    	</div>
    
    </div>
    
    <?php comments_template(); // Get wp-comments.php template ?>
    
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    
    <?php endif; ?>
    
    <?php posts_nav_link(' — ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); ?>
    
    </div>
    </div>
    </div>
    
    </body>
    
    </html>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 6 replies - 1 through 6 (of 6 total)
  • First of all, delete </body> and </html> from index.php. The two should be in your footer.php.

    Thread Starter michael-howe

    (@michael-howe)

    Ah. Well, that would be a problem. I’ll go do that.

    Ok, I guess poster deleted his/her question when I posted this ??

    Thread Starter michael-howe

    (@michael-howe)

    Edit: Whoops. I’m not sure what happened. (My post disappeared when I tried to edit it.)

    EDIT 2: Well, that’s done. Still having trouble though… hmm… what would a validator say….

    EDIT 3: D’oh! I have DOCTYPES everywhere. ??; Gotta go change those….

    Thread Starter michael-howe

    (@michael-howe)

    Alright. I figured it out. Since the PHP is calling for each piece speratlely, it loads them all with the tags, so I only have DOCTYPE and such in the header, and /html tag at the footer. I also messed up and just needed to check my code.

    The problem was I accidentally pasted the command to get the footer and sidebar at the end of the header. After removing it, everything worked fine. I discovered it using W3.org ‘s validation system, when it said I had the html closing tag before my main content began. Thanks for helping me out, Mercime, though I feel rather foolish now. XD

    Do I mark this as resolved, or does a mod? >.>

    Glad it was resolved Michael. And yes, you mark it as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Main Content Below Footer’ is closed to new replies.