Insert Custom HTML Template Into Page?

Community Forums Forums General Discussion Insert Custom HTML Template Into Page?

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  ISeemToBeAVerb 1 year ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48397

    ISeemToBeAVerb
    Participant
    Post count: 11

    I have some custom HTML I’d like to insert into my homepage that bypasses the content wrap.

    I may be making this WAY more complicated than it needs to be, but I’m basically doing this because I want to have a series of divs that contain content, but have backgrounds that span the full browser width. So it would be something like this:

    Header
    Nav
    Custom Div #1 with unique background (spanning browser width)
    Custom Div #2 with unique background (spanning browser width)
    Content
    Footer

    My initial thought was to do something like this:

    In page_homepage.php (my custom homepage template)…

    
    add_action( 'genesis_after_header', 'my_custom_content' );
    
    
    function my_custom_content() {
        ob_start();
        get_template_part('my_homepage');
        return ob_get_clean();   
    } 
    

    I’m no PHP expert, but as far as I know, this code should allow me to pull in a template_part where I can put my HTML.

    The problem I’m having is that I don’t know how to structure the template document to actually display the HTML.

    Currently, I just have something like this for the my_homepage.php…

    
    .<?php
    2./*
    3.Template Name: my_homepage
    4.*/
    5.?>
    <!DOCTYPE html>
    <html lang="en-US" prefix="og: http://ogp.me/ns#">
    <html>
    ------- ALL MY HTML CONTENT -------
    </html>
    genesis();
    

    So that’s where I’m at right now. If there is a better way to go about this, I’m all ears. Otherwise, I’m just in need of advice for how to structure the template_part I’m trying to load.

    Thanks,
    -Michael

    #48399

    ISeemToBeAVerb
    Participant
    Post count: 11

    Thought I’d add an example of what I’m trying to achieve…

    http://www.copyblogger.com/

    So here is the Copyblogger homepage. Notice how each section has a unique background that spans the whole width of the browser. That’s what I want to do.

    I had my page 95% The way I wanted it, but I didn’t know how to get the backgrounds to expand beyond the content wrapper. I know I could use a single image, but then I’d have to change it every time I wanted to modify the layout.

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

You must be logged in to reply to this topic.