Yes, often the best way is as you describe. In your template file add something like this:
<div class="container-wrap se-366024">
Then in your style.css
(or any other enqueued stylesheet)
.se-366024 {
width:960px;
}
If you are wanting to set a max width across the site you may want to look into the $content_width
global supported by Core and many plugins:
Related Posts:
- Truncate title to single line & container width
- Need Help With Making Full-Width Template for Blog Posts (common methods aren’t working)
- How to declare a global variable in php?
- Undefined variable in functions.php file [closed]
- Mega Menu Walker
- How to add a class to the attachment images
- How to export/import theme customizer settings?
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- Why can I not use setup_postdata($post) in the sidebar?
- load/require specific php files for specific pages/templates/post types
- Drop down+sort blog posts date added/most popular
- Activate different theme for temporary preview
- Store loop into array
- Get WooCommerce shipping methods programmatically
- Add a custom text field to WooCommerce admin product data “Variations”
- Show Specific Footer Widget for Specific Pages
- How do I output a database option that is an array into a get_posts array?
- Why is it necessary to prevent direct access to included files?
- Run a Parallel PHP Application with WordPress
- Passing jQuery value using Ajax to a page template
- Change logo based on incoming domain
- Why can’t I use “%s” format value in the WordPress function checked?
- Password protecting content in custom template
- Creating login session via CURL
- WordPress vs. Custom PHP [closed]
- How to Display a Single Post Excerpt
- Trouble With Conditional Logic in PHP
- How to make drop down post title
- how to delete 30 day old data using PHP [closed]
- Remove meta description on certain pages
- Image media upload metabox
- Is there CSS to expand the gallery limit on Index Pages?
- Hide categories that are not used in the post type
- esc_html_e() is not translating string in wordpress [closed]
- Limit 1 global comment per minute
- How can I add an area/option for a custom page description?
- Menu jumping when calling it via PHP
- Problem custom control Customizer
- Running code before object-cache.php runs
- Is there a way to conditionally check whether a WordPress post title is empty?
- Advanced Custom Fields – display label and value only if value entered
- Use WordPress function in php file
- How to parse multiple links from one variable?
- Issue with php version 7.2 in running search
- $wpdb returns duplicate posts
- How Can I Edit the Registration Code?
- What is the right way to add PHP code to a certain part of a page
- load more button in plugin
- Display attribute on shop page after the title
- Cant connect to database with php 7.3
- WordPress WP_Query without query GET parameters
- How to clone all WordPress Rest API end points
- Get the name of menu item with wp_nav_menu
- Controlling image output size ACF repeater [closed]
- Initial offset of number of posts in home page on the posts page
- Run JS Code on userlog out
- Twentyfifteen style author comment
- I installed WordPress locally now how do I login?
- display specific widget to a page
- How to set base url for php widget
- Remove the Tag from wp_nav_menu
- How do I choose not to display the title header on a specific page?
- save_post trigerred twice
- Time Delay a URL Redirect for Specific Page
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Sort column in Users admin Tab
- jquery & ajax getting data from php in wordpress . admin-ajax.php returns 400
- Is it possible to order posts using multiple meta queries, i.e. show posts from first meta query, then the second?
- File from parent theme imported to child theme doesn’t work – any ideas?
- image uploader for widget
- use php variable in wordpress page
- Polylang and template files
- Need to show 7 posts from actual date
- Make wp_editor required
- Add custom ID attribute to all woocommerce products on archive pages
- problem in using wpdb->prepare and a string placeholder
- Custom content using in_category
- Get the total Author Favorited posts
- Need help with PHP functions
- When using shortcode, content stops generating after the_content
- How do you detect if a specific word is at the end of a the_title()
- WordPress styling recent post
- add bootstrap modal after login in wordpress
- featured post as div background
- Combining fancybox with multiple thumbnail plugin
- How to display thumbnail if post is assigned one otherwise not
- get_post_meta no longer working
- Highlight posts currently being edited on multiple editor site?
- How to check “From Email” via WordPress before an email is sent
- WordPress Plugin Receive a Link
- Php echo into tag
- Add specific phrase after every product title including the discounted price? [closed]
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- Remove Unused Menu Locations
- a problem in class in class-wp-hook.php
- How do I a custom search form by taxonomies?
- WordPress REST API – Custom field not added to pages
- Woocommerce – add tracking code to another email template
- How to add custom user role into wordpress
- change title of page dynamically