• Hi there,

    is it possible to add a content container, so i can set a different bakground color to the main content area and on “both” sides of the main content area?

    thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Yes, that is possible, but it can take different things for different page types (post, page, archive, category, blog…). Also are you wanting it to be just around the content (post/page content) or around the entire content area including comments, etc?

    Thread Starter sanderbloem

    (@sanderbloem)

    Great!
    I want it on only content and pages area.

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    You have a number of files you will have to copy over and into your child theme folder, depending on whether you want all page types to have the parent div around the content. If you go to Appearance > Editor and look at the list of template files, you will find these:

    content-home.php
    content-none.php
    content-page.php
    content-single.php
    content.php

    If you have not yet done so, I would suggest creating a child theme so that any customizations you make will not be overwritten by a future theme update.

    Child Themes
    Child Theme creation plugins

    You will need to use the web inspector in your browser to determine where to put your new div. As an example, on a normal home (posts) page, you would want the new div around this div in the content-home.php file:
    <div id="content" class="site-content">

    With the above, additional adjustments may need to be made to the CSS so that everything flows properly when browser windows are narrowed or when viewed on smaller devices. Media queries may be require in the CSS to adjust things for narrower screens and devices.

    For single posts and for pages, you will want the div as a parent of this div
    <div class="entry-content">
    which is within the article section.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘content container’ is closed to new replies.