• DebT

    (@debbiet)


    Hi,
    Now that this site is up and running, my client decided she wants to have a blog page too. The theme is a child of twenty-twelve and I’ve used the Full-Width No Sidebar page template for all the regular pages. I want to be able to use a separate template for the Blog so that can make the posts sit at the left side of the page and not indented as the regular pages are.

    I copied the full-width.php template and renamed it blog.php. Inside, I changed an id from “content” to “content-blog” thinking that I could make a new id style to fix the formatting. In Edit Page, when I select the new Blog Pages Template and view the Source Code, it’s still showing the div id of “content” rather than “content-blog.”

    Is there a different file I need to edit? I also made a page-blog.php hoping that would help, but to no avail.

    I may not even be approaching this from the right angle, there may be a simple CSS fix that I’m not seeing. Any help would be greatly appreciated!

    Here’s the blog page: https://bodyfuel4health.com/blog/
    Home: https://bodyfuel4health.com/

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

    (@crouchingbruin)

    Hi, Debbie:

    If all you are doing is moving things around (i.e., you’re not adding or removing content), then you should be able to do things like adjusting indentation by using CSS. For properly constructed themes which call the body_class() function, the body element will be assigned a class called blog on pages which display a blog, so to target your CSS to just the blog page, add the .blog class to the beginning of the selector:

    .blog #content {
       margin-left: -150px;
    }

    `

    Thread Starter DebT

    (@debbiet)

    Thanks once again CrouchingBruin! I did manage to get it fixed somehow with CSS, but I will compare what you say here to what I actually did.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Making a custom page template’ is closed to new replies.