[Resolved] Custom Width for Any Specific Post/Page

Home Forums Support [Resolved] Custom Width for Any Specific Post/Page

Home Forums Support Custom Width for Any Specific Post/Page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #796252
    Kulwant

    So here is something weird (or maybe interesting) I want to do.

    Here is the blog post I want to change.

    How To Start a Blog in 2019 That Makes Money on Autopilot

    I have found one CSS code to change the width of the full-width page.

    .no-sidebar:not(.generate-sections-enabled) .site.grid-container,  .generate-sections-enabled:not(.home) .generate-sections-inside-container {
        max-width: 950px !important;
    }
    
    .one-container .site-content {padding:40px 20px}

    But I want to make ONLY THIS post as per the width specified by this code.

    I have found one solution for this too.

    In the Hooks, I will create one hook with the code (I don’t know what that code will be) and make that hook be active on a specific TAG only.

    So by doing this, when I select that specific tag for any post, it will automatically take that layout.

    Tag

    Now help me to write the code which can do this for me.

    and let me know in which hook I should add that code.

    #796376
    David
    Staff
    Customer Support

    Hi there,

    simply wrap your CSS in style tags e.g.

    <style>
    /* CSS Rules in here */
    </style>

    And use the WP_Head hook.

    #796392
    Kulwant

    I did the same. It’s not working for me.

    #796422
    David
    Staff
    Customer Support

    Can you link me to one of the posts?

    #796423
    Kulwant

    I did it with a workaround. Rather selecting it for the tag, I selected that specific post in Hooks.

    And I will do this future posts as well where I will need this custom full-width layout.

    #796426
    David
    Staff
    Customer Support

    I am intrigued as to why it didn’t work, so will have a look when i get a spare minute. But glad you found a solution.

    #797358
    Kulwant

    I think you missed this

    <style type="text/css">
    /* Add Your CSS Code Here. */
    </style>
    #797737
    David
    Staff
    Customer Support

    Ooops lol – good find.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.