• Hi,

    I would like to center all my content without any sidebar for my blog page, single post pages, category page and searches.

    1. I have tried editing the blog page and selecting “full width” but that only works for this page. Any way to do this for all posts by default instead of having to edit all the individual posts?

    2. When I click on blog categories (travel, photography etc), the posts from that category are displayed with an invisible sidebar to the right, and this makes the content appear lopsided. Is there a way to center all content regardless of which page it is?

    Thanks so much.

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter gnohz

    (@gnohz)

    Hi Hannah,

    1. Thank you for pointing out that I have right padding added to h1 tags! I must have copied from some site without realising it.

    However, in addition, I am trying to display my post dates as a single line eg “13 Jul 2016” centered above the blog post titles. The CSS from Kevin works only for some posts but for the others, the dates are not aligned correctly (ie “day” is above, and “month” and “year” is below).

    For eg, the dates of the first 2 blog posts (www.truphotos.com/blog) are perfect, but the next 2 blog post, the dates are not. Moreover, clicking on the first post brings me to the single post page, and there the alignment of the date becomes off.

    2. Your css works perfectly! Thank you!

    1. The issue was with the width of the CSS I gave you. Since some post dates require more space, I’ve increased the max-width and adjusted some of the spacing here with some new CSS.

    You’ll want to replace this:

    .postdate.bg-lightgray.headerfont {
        float: none;
        width: 85px;
        margin-right: auto;
        margin-left: auto;
    }

    With this:

    .postdate.bg-lightgray.headerfont {
        float: none;
        min-width: 85px;
        max-width: 100px;
        margin-right: auto;
        margin-left: auto;
    }

    And try adding this:

    .postdate span {
        text-align: center;
        margin-right: auto;
    }

    The alignment isn’t as great as it was before, but at least your dates will stretch across the full width of their container. Let me know if this fixes it for you.

    Thread Starter gnohz

    (@gnohz)

    Hi Kevin,

    To simplify matters, I standardised the date font across the blog page and single post pages. Then I did some trial and error with the min-width and max-width parameters and managed to arrive at the final result.

    As you mentioned, the alignment between the numbers isn’t perfect, especially when single date digits are involved) but I think this is the closest I can get. I can always switch back to the original date layout and centre it on top of the titles. It doesn’t look that bad, actually.

    Thank you again to you, Hannah and Ben for all the help! This has really been one of the most versatile and easy to use themes I have used, with exceptional service. I appreciate it.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘[Theme: Virtue] How to center content on category page & single posts by default’ is closed to new replies.