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 2 years, 5 months ago.

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


    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:

    Custom Div #1 with unique background (spanning browser width)
    Custom Div #2 with unique background (spanning browser width)

    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() {
        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…

    3.Template Name: my_homepage
    <!DOCTYPE html>
    <html lang="en-US" prefix="og:">
    ------- ALL MY HTML CONTENT -------

    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.




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

    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.