• Resolved northofhades

    (@northofhades)


    Hi!

    I am trying to create a custom page template for a full-width page. I do not want to affect ANY other page templates in the theme.

    I’m working with a child theme, and I’ve created a page template already. I have tried:
    –Changing the page template file ‘<div id=”content”>’ to ‘<div id=”content-fullwidth” ‘, and then adding this to the css:
    #content-fullwidth {
    margin: 0 0 0 0;
    width: 100%;
    }

    But my content is still not filling the page–it’s sitting to the right and down from where I think it should be.

    The page I’m working on is https://www.mechanicspeak.com/test-page-2/. Using firebug, the element my content is in looks like ‘entry-content’, not ‘content’ But the above instructions were from a tutorial on the web, and I don’t know how to alter ‘entry-content’ for a page template.

    And if I’m working with a page template, why wouldn’t I want to just set the parameters inside the page template file, instead of calling something from the css?

    Thanks for any insight!

Viewing 1 replies (of 1 total)
  • Thread Starter northofhades

    (@northofhades)

    Well! I found the answer, it’s buried in other posts on the topic, but for anyone stumbling across this one first, there are several ways. I appended the css file, and this is how to specify it to the page template:

    .page-template-templatefilename-php .entry-header,
    .page-template-templatefilename-php .entry-content,
    .page-template-templatefilename-php footer.entry-meta,
    .page-template-templatefilename-php #comments-title {
    width: 100%;
    }

    or you could just change the css file, and make it specific to an individual page, like so:
    .page-id-123.singular .entry-header,
    .page-id-123.singular .entry-content,
    .page-id-123.singular footer.entry-meta,
    .page-id-123.singular #comments-title {
    width: 100%;
    }

    Who knew it could be that easy? I hope somebody else finds this useful.

Viewing 1 replies (of 1 total)
  • The topic ‘TwentyEleven custom page template for full width page’ is closed to new replies.