0

In the WordPress API is there a way to set the width of the post/page container? Or is this solely up to the theme developer - they decide and have total control over the width of the post/page container?

Usecase; my plugin will allow users to create sliders and place them in posts/pages. I want to allow them to create full-width sliders that take up the full width of the page.

I know there is a global $content_width but thats for media max widths I think. Is there something similar to that variable but for post/page width? This way my plugin can set that global when the shortcode is called and the slider content is inserted.

0

It's totally up the the theme developer, and whether or not the theme properly uses $content_width to match their post/page content width would depend on the theme, and any other ways the theme made the width available would also depend on the theme.

I'd suggest building sliders so that they are responsive, then it won't matter what the width of the content is. Most themes are responsive these days, and their content width would only be accurate for desktop anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.