Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: How to Use Full-Width Page Template for Posts?

Discussion in 'Misc WordPress Requests' started by Mr Case, Mar 14, 2018.

  1. Mr Case

    Guest

    Reply To: How to Use Full-Width Page Template for Posts?, by Mr Case

    I see what you mean. And generally, yes a CSS rule would target every element across your site that had whatever class or ID you specified. However I noticed that your theme gives a class to the specific page/post you are on. So you can, if you choose, target each specifically to achieve your results. It is extremely cumbersome, but doable. For example on this page:

    http://www.thecyclingcanadian.com/getting-30-day-tourist-visa-extension-indonesia/

    if you inspect the code you see the <body> has a class of ‘postid-26942’ so with that very specific knowledge you can target elements just on that page with this css:

    /* make content full width */
    .postid-26942 #content.left {
    width: 96%;
    }
    /* hide sidebar content */
    .postid-26942 #sidebar {
    display: none;
    }

    and it should only affect THAT particular page. And if you want to give other pages that same style then you could just keep adding to the list, for example if you want to add this page:

    http://www.thecyclingcanadian.com/staring-camera-like-buffoon/

    which has a <body> class of ‘postid-27116’

    you could add to your css like this:

    /* make content full width */
    .postid-26942 #content.left,
    .postid-27116 #content.left {
    width: 96%;
    }
    /* hide sidebar content */
    .postid-26942 #sidebar,
    .postid-27116 #sidebar {
    display: none;
    }

    Like I said, you see how this could get cumbersome. But it would work if you really want to have specific use cases for going full width or not. hope that makes sense and helps

    Reply To: How to Use Full-Width Page Template for Posts?
     
    #1

Share This Page

Monarch Social Sharing Plugin