• Heres my situation:
    I want to us an include to pull WP into the body of my mainpage. Because of a number of different elements on the mainpage, I have to go this route.
    Here’s the problem…I’m using the same header image in the wrap, on my mainpage, as I’m using inWP. The result is having the header image appearing twice. Is there a way to comment the header out on one page and not the others? That way, on my mainpage, I get all the content, without the header.
    Hope this makes sense.
    Thanks!
    Martin

Viewing 2 replies - 1 through 2 (of 2 total)
  • I don’t really understand why you couldn’t/wouldn’t insert your elements on WP index page ?
    Anyway, what you’re asking isn’t really hard. You just need to insert this code at the very beginning of the page where you want WP’s content to be displayed :

    <?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    ?>

    And then insert the following lines where you want it to be inserted on your page :

    <div id="content">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php the_date('','<h2>','</h2>'); ?>
    <div class="post">
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></h3>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
    <div class="storycontent">
    <?php the_content(); ?>
    </div>
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>
    <!--
    <?php trackback_rdf(); ?>
    -->
    <?php include(ABSPATH . 'wp-comments.php'); ?>
    </div>
    <?php endforeach; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>
    </div>

    You’ll need to modify the CSS according to your desires. Don’t forget to adjust the path to your wp-blog-header.php also. I strongly suggest to keep this file inside wordpress directory.

    Solution? Strip the image/header from WordPress. This will be fine as long as the page is not called directly.

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

The topic ‘It’s A Double Header!’ is closed to new replies.