WordPress page without header

Hello experts,
Been looking everywhere for this solution, I hope someone here can help me out.

Background:
Currently our company blog is hosted with Hubspot.com under a subdomain of our tld (blog.mydomain.com).
Our main site is self hosted and running on Drupal (main.mydomain.com)  
Our current blog can be access one of two ways; blog.mydomain.com or main.mydomain.com/media/blog. The latter displays the blog in a iframe in order for it to look like its native to the site.

I have recently built a new blog called news.mydomain.com with WordPress.

To satisfy the requirements to allow me to move from Hubspot to WP is that I need to be able to bring the WP site into the main site without the header and footer.  Just the body of the WP site with the sidebars and updated posts.

Because of the this particular custom install of Drupal, any folder I add to the subdomain, main.mydomain.com, is not accessable via web browser.  I am forced to use a iframe. Yes, I know search engines ignore iframes.

I tried this plugin; "Just the Page" and its perfect.  But it does exactly what it is says, everything is stripped out.  If I could add the body, css, posts and side bar I would be out of the woods and add that page to the iFrame.  But the code to make that happen escapes me.

Thanks in advance
Richard
ezrhino5151Asked:
Who is Participating?
 
Jason C. LevineNo oneCommented:
You can do this by editing the theme files and removing the calls to the header and footer.  For example, here is a Custom Page Template I created for TwentyTen that strips out the header and footer.  However, it was a one-column page to start with so the sidebar is also removed:

<?php
/**
 * Template Name: One column, no sidebar, no header, no footer
 *
 * A custom page template without sidebar.
 *
 * The "Template Name:" bit above allows this to be selectable
 * from a dropdown menu on the edit page screen.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

//get_header(); ?>

		<div id="container" class="one-column">
			<div id="content" role="main">

			<?php
			/* Run the loop to output the page.
			 * If you want to overload this in a child theme then include a file
			 * called loop-page.php and that will be used instead.
			 */
			 get_template_part( 'loop', 'page' );
			?>

			</div><!-- #content -->
		</div><!-- #container -->

<?php //get_footer(); ?>

Open in new window


All I did was comment out get_header() and get_footer() and you should be able to do the same thing to get your desired result.
0
 
ezrhino5151Author Commented:
Thanks Jason, that did remove my footer but when I comment out the header I lose all formating.  Looks like the style sheet gets taken out along with it.
I'm using double column "Elegant Grunge" theme.  If that makes a difference.
0
 
Jason C. LevineNo oneCommented:
I thought you wanted just a plain/unformatted content to be embedded via iframe?  Anyway not a major problem.  Put the get_header() call back in and edit the theme's header.php file and remove elements manually.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ezrhino5151Author Commented:
Sorry if I wasnt clear.  I have been asking about this so much I think I am skipping details without knowing it.
I need to keep the WP install intact.  The blog will be accessable in both the iframe and in the subdomain, of where the install of the WP is.  So the blog will need all the elements.  Unless I can force the page to call on a seperate header that shares the same css style sheet.  And make the header a height of 1pixel.  Which I tried and was unsuccesful.
Thanks
Richard
0
 
Jason C. LevineNo oneCommented:
>> The blog will be accessable in both the iframe and in the subdomain

Ah-ha.  That makes things significantly harder.  So a given page or post has to look different if called from the iframe as opposed to being directly accessed from a subdomain?
0
 
ezrhino5151Author Commented:
Not a given page, only a specific page.  I was hoping that I could a create a specific page to place in the iframe that contained no header or footer, just body, side bars and posts.  
This will keep that particular page in the main site from having 2 headers.  When a user clicks on one of the posts in that page a new window would open to the WP domain with full header and footer.  I would add some java script with the iframe to force the the new window.
Thanks
Richard
0
 
Jason C. LevineNo oneCommented:
>> only a specific page

Okay, my original solution (custom page template, header and footer disabled) will still work then.  To avoid the formatting getting blown away, just add a calls to the CSS files in the customer page template.
0
 
ezrhino5151Author Commented:
Ok I'm all ears.  Where do I grab those calls? And I am guessing there is a specific place to put them in my page?
Thanks
Richard
0
 
dmgroomCommented:
If you have commented out "get_header();", then you need to add in a certain amount of HTML in your page  where the get_header(); was:

<html>
<head>
<link rel="stylesheet" href="http://link-to-my-stylesheet.css" type="text/css">
<head>
....followed by enough opening <div>'s  that were in the original header file, that are needed to  match </div>'s in the footer
0
 
ezrhino5151Author Commented:
With commenting out the header and footer worked.  Then adding the css to the page worked as well to get me this far.  I am only having one last issue this worked for all browsers except ie.  Is there any thing I can do about it?
Here is the code for the pages I am working on.
  Update:
Although I was trying the page directly from my browser and the page wasnt lining up.  When I try it in the iframe, it lines up perfectly.
Thanks for all the good info and patients.
Thanks
Richard
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.