Site logo

Archived topic

Custom Width for Any Specific Post/Page

7 replies · Started by Kulwant on January 30, 2019

Viewing posts 1–8 of 8

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.

Hi there,

simply wrap your CSS in style tags e.g.

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

And use the WP_Head hook.

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

Can you link me to one of the posts?

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.

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.

I think you missed this

<style type="text/css">
/* Add Your CSS Code Here. */
</style>

Ooops lol - good find.

This archived topic is closed to new replies.